/*
 * Gri Coffee Premium CSS Design System
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Theme: Light/Cream Mode (Default Luxury) */
    --bg-primary: #F9F6F0;       /* Cream */
    --bg-secondary: #EFE9DB;     /* Warm Beige */
    --bg-card: #FFFFFF;
    --text-primary: #2D1F18;     /* Espresso */
    --text-secondary: #5A3E2B;   /* Coffee Brown */
    --text-muted: #8E7C74;
    --color-accent: #C5A880;     /* Soft Gold */
    --color-accent-hover: #B59870;
    --color-dark: #1A1A1A;       /* Matte Black */
    --color-white: #FFFFFF;
    --border-color: rgba(90, 62, 43, 0.15);
    --shadow-sm: 0 2px 4px rgba(45, 31, 24, 0.05);
    --shadow-md: 0 10px 20px rgba(45, 31, 24, 0.08);
    --shadow-lg: 0 20px 40px rgba(45, 31, 24, 0.12);
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --header-height: 80px;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1A1A1A;
    --bg-card: #1E1E1E;
    --text-primary: #F9F6F0;
    --text-secondary: #C5A880;
    --text-muted: #A89C94;
    --border-color: rgba(249, 246, 240, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.8);
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

.text-center { text-align: center; }
.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background-color: var(--color-accent);
    color: var(--color-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--color-dark);
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    color: var(--color-dark);
    transform: translateY(-2px);
}

/* Header & Navigation */
header {
    height: var(--header-height);
    background-color: rgba(249, 246, 240, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

[data-theme="dark"] header {
    background-color: rgba(18, 18, 18, 0.85);
}

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

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.logo span {
    color: var(--color-accent);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--color-accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-icon {
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    background: none;
    border: none;
    color: var(--text-primary);
}

.nav-icon:hover {
    color: var(--color-accent);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--color-accent);
    color: var(--color-dark);
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mega Menu Dropdown */
.has-mega-menu {
    position: static;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: var(--transition);
    padding: 40px 0;
    z-index: 999;
}

.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.mega-menu-col h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    color: var(--color-accent);
}

.mega-menu-col ul {
    list-style: none;
}

.mega-menu-col li {
    margin-bottom: 10px;
}

.mega-menu-col a {
    font-size: 0.9rem;
    color: var(--text-primary);
    opacity: 0.8;
}

.mega-menu-col a:hover {
    opacity: 1;
    color: var(--color-accent);
    padding-left: 5px;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(26, 26, 26, 0.8) 30%, rgba(26, 26, 26, 0.4));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    color: var(--color-white);
    max-width: 700px;
}

.hero h1 {
    font-size: 4rem;
    color: var(--color-white);
    margin-bottom: 24px;
    font-weight: 700;
}

.hero h1 span {
    color: var(--color-accent);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; }
}

/* Product Cards */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--color-accent);
    color: var(--color-dark);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 12px;
    text-transform: uppercase;
    z-index: 5;
    border-radius: var(--radius-sm);
}

.product-badge.limited {
    background-color: var(--text-primary);
    color: var(--color-white);
    border: 1px solid var(--color-accent);
}

.product-image-wrapper {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card-body {
    padding: 24px;
}

.product-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.product-title {
    font-size: 1.15rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.product-meta-specs {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

.product-meta-spec span {
    font-weight: 600;
    color: var(--text-primary);
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.product-price del {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-left: 8px;
}

.btn-add-cart-icon {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-cart-icon:hover {
    background-color: var(--color-accent);
    color: var(--color-dark);
}

/* Sections */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 60px auto;
}

/* Fresh Roast Parallax */
.fresh-roast {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 450px;
    position: relative;
}

.fresh-roast::before {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background-color: rgba(45, 31, 24, 0.7);
}

.fresh-roast-content {
    position: relative;
    z-index: 5;
    color: var(--color-white);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.fresh-roast h2 {
    color: var(--color-white);
    font-size: 3rem;
    margin-bottom: 20px;
}

/* Subscription Block */
.sub-panel {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-radius: var(--radius-lg);
    padding: 60px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 60px;
}

.sub-panel-text {
    flex: 1;
}

.sub-panel-image {
    flex: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 992px) {
    .sub-panel { flex-direction: column; padding: 30px; gap: 30px;}
}

/* Side Draw Shopping Cart */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

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

.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-close {
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
}

.cart-items-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

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

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cart-item-price {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: max-content;
    margin-top: 8px;
}

.cart-qty-ctrl button {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--text-primary);
}

.cart-qty-ctrl span {
    padding: 0 8px;
    font-size: 0.85rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 8px;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.cart-totals {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 20px;
}

/* Shop & Catalog Sidebar Layout */
.shop-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-top: 30px;
}

.shop-sidebar {
    border-right: 1px solid var(--border-color);
    padding-right: 35px;
}

.shop-sidebar h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 6px;
    display: inline-block;
}

.shop-sidebar ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.shop-sidebar ul li {
    margin-bottom: 10px;
}

.shop-sidebar ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s, padding-left 0.2s;
    display: block;
}

.shop-sidebar ul li a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

.shop-sidebar select, 
.shop-sidebar input[type="text"], 
.shop-sidebar input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
}

.shop-sidebar select:focus, 
.shop-sidebar input[type="text"]:focus, 
.shop-sidebar input[type="number"]:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

/* Footer */
footer {
    background-color: var(--color-dark);
    color: #A89C94;
    padding: 80px 0 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer h3, footer h4 {
    color: var(--color-white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.footer-col p {
    margin-top: 20px;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-col h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 24px;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    font-size: 0.9rem;
    color: #A89C94;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 15px; text-align: center; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
}

.toast {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease forwards;
    border-left: 4px solid var(--color-accent);
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; visibility: hidden;
    transition: var(--transition);
}

.modal.open {
    opacity: 1; visibility: visible;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    background: none; border: none;
    color: var(--text-primary);
}

/* ========================================== */
/* MOBILE RESPONSIVE NAVIGATION DRAWER */
/* ========================================== */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: -320px; /* slides from left */
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}
.mobile-nav-drawer.open {
    left: 0;
}
.mobile-nav-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobile-nav-close {
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
    line-height: 1;
}
.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.mobile-nav-links a {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}
.mobile-nav-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: var(--text-primary);
}
.mobile-submenu {
    list-style: none;
    padding-left: 15px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mobile-submenu a {
    font-size: 0.9rem;
    text-transform: none;
    opacity: 0.8;
}
.mobile-submenu strong {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    display: block;
    margin-top: 5px;
}

/* Visibility utilities */
.mobile-only {
    display: none !important;
}

@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }
    
    /* Responsive grids */
    .shop-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    .shop-sidebar {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-right: 0 !important;
        padding-bottom: 30px !important;
        margin-bottom: 10px !important;
    }
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        margin-bottom: 40px !important;
    }
    .product-reviews-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    .checkout-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    
    /* General content spacing for mobile layout */
    header .logo {
        font-size: 1.4rem;
    }
}

@media (max-width: 576px) {
    .product-review-form-fields,
    .checkout-form-row {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .checkout-payment-methods {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .hero h1 {
        font-size: 2rem !important;
    }
    .section-title {
        font-size: 1.8rem !important;
    }
}

