/* ==========================================================================
   TERROIR MAROC — PREMIUM LUXURY THEME
   Inspired by: Famille Mary & Terre Terroir
   ========================================================================== */

:root {
    --color-bg-primary: #FCFBF9; /* Warm off-white / Cream */
    --color-bg-secondary: #F5F1EB; /* Warm beige */
    --color-brand-primary: #8B7355; /* Gold / Bronze */
    --color-brand-primary-hover: #735F45;
    --color-brand-secondary: #2C4A3E; /* Forest Green */
    --color-brand-secondary-hover: #1E332A;
    --color-text-title: #1C1917; /* Slate Black */
    --color-text-body: #44403C; /* Warm Dark Grey */
    --color-text-muted: #78716C; /* Soft Stone Grey */
    --color-border: #E7E5E4; /* Light Border */
    --color-border-hover: #D6D3D1;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-body);
    font-family: var(--font-sans);
    line-height: 1.6;
    margin: 0;
}

/* Announcement Bar */
.announcement-bar {
    background-color: var(--color-brand-secondary);
    color: #FFFFFF;
    text-align: center;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.announcement-bar p {
    margin: 0;
}

/* Navbar */
.navbar {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text-title);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--color-brand-primary);
    font-style: italic;
    font-weight: 400;
    margin-left: 2px;
}

/* Search Form */
.search-form {
    display: flex;
    align-items: center;
    background-color: var(--color-bg-secondary);
    border-radius: 50px;
    padding: 2px 6px 2px 18px;
    width: 320px;
    max-width: 100%;
}

.search-input {
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    width: 100%;
    color: var(--color-text-title);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-btn:hover {
    color: var(--color-brand-primary);
}

/* Nav Actions */
.nav-actions-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-login-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--color-text-title);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-login-link:hover {
    color: var(--color-brand-primary);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-title);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #FFFFFF;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    z-index: 1;
    overflow: hidden;
    margin-top: 5px;
}

.user-dropdown-content a, 
.user-dropdown-content button {
    color: var(--color-text-title);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    text-align: left;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.2s ease;
}

.user-dropdown-content a:hover, 
.user-dropdown-content button:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-brand-primary);
}

.user-dropdown:hover .user-dropdown-content {
    display: block;
}

/* Cart Icon */
.cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text-title);
    font-size: 14px;
    font-weight: 500;
}

.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--color-brand-primary);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50px;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Bar */
.nav-categories-bar {
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: 10px 20px;
}

.categories-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.cat-link {
    text-decoration: none;
    color: var(--color-text-body);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 4px 0;
    position: relative;
    transition: color 0.2s ease;
}

.cat-link:hover, .cat-link.active {
    color: var(--color-brand-primary);
}

.cat-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-brand-primary);
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--color-border);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

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

.toast-icon {
    font-weight: 700;
    font-size: 16px;
    margin-right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success {
    border-left: 4px solid #10B981;
}
.toast-success .toast-icon {
    background-color: #D1FAE5;
    color: #10B981;
}

.toast-error {
    border-left: 4px solid #EF4444;
}
.toast-error .toast-icon {
    background-color: #FEE2E2;
    color: #EF4444;
}

.toast-message {
    font-size: 14px;
    color: var(--color-text-title);
    flex-grow: 1;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding-left: 10px;
}

/* Footer styling */
.footer {
    background-color: #1C1917;
    color: #E7E5E4;
    padding: 80px 20px 40px;
    margin-top: 100px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    border-bottom: 1px solid #292524;
    padding-bottom: 50px;
    margin-bottom: 30px;
}

.brand-col h3 {
    font-family: var(--font-serif);
    font-size: 26px;
    color: #FFFFFF;
    margin-top: 0;
}

.brand-col h3 span {
    color: var(--color-brand-primary);
}

.footer-desc {
    color: #A8A29E;
    font-size: 14px;
    max-width: 320px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    color: #A8A29E;
    transition: color 0.2s ease;
}

.footer-social a:hover {
    color: var(--color-brand-primary);
}

.footer-col h4 {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin-top: 0;
    margin-bottom: 25px;
    letter-spacing: 0.05em;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #A8A29E;
    text-decoration: none;
    font-size: 13.5px;
    transition: color 0.2s ease;
}

.footer-col ul li a:hover {
    color: var(--color-brand-primary);
    padding-left: 2px;
}

.footer-bottom {
    text-align: center;
    color: #78716C;
    font-size: 13px;
}

/* Mobile responsive navigation & toggles */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background-color: var(--color-text-title);
    transition: all 0.3s ease;
}

@media (max-width: 900px) {
    .nav-search-section {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-categories-bar {
        display: none;
        width: 100%;
        background-color: #FFFFFF;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-categories-bar.open {
        display: block;
    }
    
    .categories-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .user-name-label {
        display: none;
    }
}

@media (max-width: 500px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   WHATSAPP & NOTIFICATIONS CUSTOM STYLES
   ========================================================================== */

/* WhatsApp Fixed Floating Button */
.whatsapp-fixed {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-fixed:hover {
    transform: scale(1.1) translateY(-5px);
    background-color: #20BA5A;
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

/* Navbar WhatsApp Action Icon */
.nav-whatsapp-btn {
    background: none;
    border: none;
    color: #25D366;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-whatsapp-btn:hover {
    color: #20BA5A;
    transform: scale(1.1);
}

/* Notification Dropdown Container */
.notification-dropdown {
    position: relative;
    display: inline-block;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--color-text-title);
    padding: 8px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.2s ease;
}

.notification-btn:hover {
    color: var(--color-brand-primary);
    transform: scale(1.05);
}

.notification-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
}

/* Dropdown Content */
.notification-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #FFFFFF;
    min-width: 340px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    z-index: 1001;
    overflow: hidden;
    margin-top: 12px;
    animation: fadeInDropdown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Show on Click toggle via .open class */
.notification-dropdown.open .notification-dropdown-content {
    display: block;
}

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

.notification-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--color-text-title);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--color-brand-primary);
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    transition: color 0.2s ease;
}

.mark-all-read:hover {
    color: var(--color-brand-primary-hover);
    text-decoration: underline;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: block;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background-color: var(--color-bg-secondary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notif-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--color-text-title);
    margin-bottom: 4px;
}

.notif-message {
    font-size: 12.5px;
    color: var(--color-text-body);
    line-height: 1.5;
    margin-bottom: 6px;
}

.notif-time {
    font-size: 11px;
    color: var(--color-text-muted);
}

.notification-empty {
    padding: 40px 18px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 13.5px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .notification-dropdown-content {
        position: fixed;
        left: 15px;
        right: 15px;
        top: 80px;
        min-width: 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 768px) {
    .container,
    .footer-container,
    .nav-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nav-brand-section {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-actions-section {
        gap: 10px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .nav-login-link span,
    .cart-label,
    .nav-whatsapp-btn {
        display: none;
    }

    .user-dropdown-btn {
        padding: 6px 0;
        gap: 4px;
    }

    .search-form {
        width: 100%;
    }

    .nav-categories-bar {
        padding: 14px 16px;
    }

    .categories-links {
        align-items: stretch;
        gap: 10px;
    }

    .cat-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px 12px;
        border: 1px solid var(--color-border);
        border-radius: 8px;
        background: var(--color-bg-primary);
    }

    .cat-link.active::after {
        display: none;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 84px;
    }

    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
        padding: 14px 16px;
    }

    .notification-header {
        gap: 12px;
        align-items: flex-start;
    }

    .hero-section {
        height: auto !important;
        min-height: 420px;
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    .hero-content-box {
        max-width: 100% !important;
    }

    .home-section,
    .home-banner-section,
    .home-features-section {
        padding-top: 56px !important;
        padding-bottom: 56px !important;
    }

    .home-section-head {
        margin-bottom: 28px !important;
    }

    .home-banner-grid {
        gap: 28px !important;
    }

    .home-banner-stats {
        flex-wrap: wrap;
        gap: 14px !important;
    }

    .product-detail-page {
        margin-top: 24px !important;
        margin-bottom: 24px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .product-purchase-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .product-purchase-row > div:first-child {
        width: 100% !important;
    }

    .ratings-overview-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .review-item {
        flex-direction: column;
        gap: 12px !important;
    }

    .review-item form {
        align-self: flex-end;
    }

    .footer {
        padding-top: 56px;
        margin-top: 64px;
    }

    .whatsapp-fixed {
        width: 54px;
        height: 54px;
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .announcement-bar {
        font-size: 11px;
        padding: 8px 12px;
    }

    .logo {
        font-size: 22px;
    }

    .nav-actions-section {
        gap: 8px;
    }

    .notification-dropdown-content {
        left: 10px;
        right: 10px;
        top: 72px;
    }

    .notification-item,
    .notification-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-section {
        min-height: 360px;
    }

    .home-section,
    .home-banner-section,
    .home-features-section {
        padding-top: 44px !important;
        padding-bottom: 44px !important;
    }

    .product-detail-page {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .whatsapp-fixed {
        width: 50px;
        height: 50px;
        right: 12px;
        bottom: 12px;
    }
}
