/* 
    Selah - Premium Judaica Landing Page
    Colors:
    - Primary: #2C1E16 (Dark Brown)
    - Gold: #B89947 (Gold)
    - Background: #FDFBF7 (Bone White)
*/

:root {
    --primary-color: #2C1E16;
    --gold-color: #B89947;
    --gold-hover: #C5A059;
    --bg-color: #FDFBF7;
    --white: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-muted: #665C54;
    --header-height: 80px;
    --transition-standard: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 20px rgba(44, 30, 22, 0.08);
    --shadow-elevated: 0 10px 40px rgba(44, 30, 22, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, .logo-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

h1 { font-size: 3rem; margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.8rem; margin-bottom: 0.8rem; }

p { font-weight: 300; }

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-standard);
}

ul { list-style: none; }

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo-text {
    font-size: 1.8rem;
    letter-spacing: 0.15em;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 5px;
}

.logo-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold-color);
    transform: scaleX(0.7);
    transform-origin: left;
}

/* Header */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(10px);
    transition: var(--transition-standard);
    border-bottom: 1px solid rgba(184, 153, 71, 0.1);
}

header.scrolled {
    height: 70px;
    box-shadow: var(--shadow-soft);
}

@media (max-width: 768px) {
    header.scrolled {
        height: var(--header-height); /* Keep consistent height on mobile to prevent gaps */
    }
}

.header-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu ul {
    display: flex;
    gap: 2.5rem;
}

.nav-menu ul li a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
    color: var(--primary-color);
    position: relative;
}

.nav-menu ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold-color);
    transition: var(--transition-standard);
}

.nav-menu ul li a:hover::after {
    width: 100%;
}

.nav-menu ul li a:hover {
    color: var(--gold-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-icon-container {
    position: relative;
    cursor: pointer;
    transition: var(--transition-standard);
}

.cart-icon-container:hover {
    color: var(--gold-color);
    transform: scale(1.1);
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--gold-color);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    padding: 4rem 2rem;
    background: radial-gradient(circle at 100% 0%, rgba(184, 153, 71, 0.05) 0%, transparent 50%);
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1.2s ease-out;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-elevated);
}

.hero-image::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border: 1px solid var(--gold-color);
    top: -20px;
    left: -20px;
    z-index: -1;
}

.hero-image::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border: 1px solid var(--gold-color);
    bottom: -20px;
    right: -20px;
    z-index: -1;
}

.hero-content {
    max-width: 500px;
    animation: slideUp 1s ease-out;
}

.hero-badge {
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    color: var(--gold-color);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--gold-color);
}

.hero-title {
    line-height: 1.1;
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-standard);
}

.btn-gold {
    background-color: var(--gold-color);
    color: var(--white);
}

.btn-gold:hover {
    background-color: var(--gold-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(184, 153, 71, 0.3);
}

.btn-dark {
    background-color: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-dark:hover {
    background-color: #4A3B3B;
    transform: translateY(-2px);
}

/* Benefits Section */
.benefits {
    padding: 6rem 0;
    background-color: var(--primary-color);
    color: var(--white);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
}

.benefit-card {
    text-align: center;
}

.benefit-icon {
    color: var(--gold-color);
    margin-bottom: 1.5rem;
    transform: scale(1.5);
}

.benefit-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--gold-color);
}

.benefit-card p {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Catalog Section */
.catalog {
    padding: 8rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.separator-gold {
    width: 60px;
    height: 3px;
    background: var(--gold-color);
    margin: 1.5rem auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3rem;
}

.product-card {
    background: var(--card-bg);
    border-bottom: 3px solid transparent;
    transition: var(--transition-standard);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-img {
    height: 350px;
    overflow: hidden;
    background: #F0EEEA;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-standard);
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-elevated);
    border-bottom-color: var(--gold-color);
}

.product-info {
    padding: 2rem 1.5rem;
    text-align: center;
}

.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.1rem;
    color: var(--gold-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 6rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 6rem;
}

.footer-logo .logo-text {
    color: var(--white);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.footer-logo p {
    opacity: 0.7;
    font-size: 0.95rem;
}

.footer-grid h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold-color);
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links ul li a {
    font-size: 0.95rem;
    opacity: 0.8;
    transition: var(--transition-standard);
    display: inline-block;
}

.footer-links ul li a:hover {
    opacity: 1;
    color: var(--gold-color);
    padding-left: 5px;
}

.footer-contact p {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-contact p i {
    width: 20px;
    height: 20px;
    color: var(--gold-color);
    flex-shrink: 0;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-icons a {
    color: var(--white);
    opacity: 0.8;
    transition: var(--transition-standard);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icons a i, 
.social-icons a svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.social-icons a:hover {
    opacity: 1;
    color: var(--gold-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2.5rem;
}

.footer-bottom p {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-content {
        margin: 0 auto;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        text-align: center;
    }
    
    .footer-contact p {
        justify-content: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-logo .logo-text::after {
        left: 50%;
        transform: translateX(-50%) scaleX(0.7);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        padding-top: var(--header-height);
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition-standard);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.2rem;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .footer-grid {
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
        text-align: center;
        width: 100%;
    }

    .footer-logo, .footer-links, .footer-contact, .footer-social {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-links ul {
        align-items: center;
        padding-left: 0;
    }
}

@media (max-width: 430px) {
    .hero {
        padding-top: 6rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .section-title h2 {
        font-size: 1.6rem;
    }
}

/* --- CATALOG FILTERS --- */
.catalog-filters {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--gold-color);
    color: var(--primary-color);
    padding: 0.8rem 2.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.filter-btn:hover {
    background: rgba(184, 153, 71, 0.1);
}

.filter-btn.active {
    background: var(--gold-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(184, 153, 71, 0.3);
}

@media (max-width: 480px) {
    .catalog-filters {
        gap: 0.8rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.8rem;
    }
}

/* --- REVEAL ON SCROLL --- */
/* --- CART DRAWER --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-standard);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 2001;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(184, 153, 71, 0.2);
}

.cart-items-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(184, 153, 71, 0.1);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.cart-item-info p {
    color: var(--gold-color);
    font-weight: 700;
}

.remove-item {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0.7;
}

.remove-item:hover {
    opacity: 1;
}

.empty-cart-msg {
    text-align: center;
    margin-top: 3rem;
    opacity: 0.6;
    font-style: italic;
}

.cart-footer {
    padding: 2rem;
    background: #fdfaf5;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.checkout-btn {
    width: 100%;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
}

/* filtering states */
.product-card.hidden-filter {
    display: none;
}

@media (max-width: 480px) {
    .cart-drawer {
        width: 100%;
    }
    
    .cart-header {
        padding: 1.2rem;
    }
    
    .cart-items-container {
        padding: 1.2rem;
    }
    
    .cart-item-img {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-info h4 {
        font-size: 0.9rem;
    }
    
    .cart-footer {
        padding: 1.5rem;
    }
    
    .cart-total {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

/* --- PRODUCT MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 30, 22, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-standard);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-color);
    width: 900px;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-standard);
}

.close-modal-btn:hover {
    transform: rotate(90deg);
    color: var(--gold-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.modal-img-container {
    background: #f0eeea;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 3rem;
    overflow-y: auto;
}

.modal-info h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.modal-description {
    margin: 2rem 0;
    color: var(--text-muted);
}

.modal-description ul {
    margin-top: 1rem;
}

.modal-description li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.modal-description li::before {
    content: "•";
    color: var(--gold-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.modal-actions {
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .modal-content {
        max-height: 82vh;
        width: 85vw; /* Stricter width for perfect margins */
        max-width: 370px;
        margin: auto;
        left: 0;
        right: 0;
        transform: none;
    }
    
    .modal-body {
        display: flex;
        flex-direction: column;
        height: 100%;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .modal-img-container {
        height: 180px;
        flex-shrink: 0;
    }
    
    .modal-info {
        padding: 1.2rem;
        overflow-y: auto;
        text-align: center;
        flex-grow: 1;
    }
    
    .modal-info h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-description {
        margin: 1rem 0;
        font-size: 0.85rem;
    }
    
    .modal-description li {
        display: inline-block;
        margin: 0 5px;
        padding-left: 0;
    }
    
    .modal-description li::before {
        content: none;
    }
    
    .modal-actions {
        margin-top: 1.5rem;
        padding-bottom: 0.5rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Specific delays for a cascading effect */
.benefit-card:nth-child(2) { transition-delay: 0.1s; }
.benefit-card:nth-child(3) { transition-delay: 0.2s; }

.product-card:nth-child(even) { transition-delay: 0.05s; }
/* --- ERROR PAGES --- */
.error-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-color);
}

.error-content {
    max-width: 600px;
}

.error-code {
    font-size: 8rem;
    font-family: 'Cinzel', serif;
    color: var(--gold-color);
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.error-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.error-message {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
}

.error-actions .btn {
    padding: 1rem 3rem;
}

@media (max-width: 768px) {
    .error-code { font-size: 5rem; }
    .error-title { font-size: 1.8rem; }
}
