/* ===== CSS VARIABLES ===== */
:root {
    --color-primary: #556B2F;
    --color-secondary: #000000;
    --color-dark: #1a1a1a;
    --color-light: #ffffff;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #e0e0e0;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    --font-serif: 'Georgia', 'Garamond', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

    --transition: all 0.3s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-white);
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

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

a:hover {
    color: var(--color-secondary);
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #ffffff;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0.28rem 0;
}

.header.nav--scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-md);
    padding: 0.21rem 0;
}

.navbar {
    width: 100%;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0;
}

.language-switcher::after {
    content: '';
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 96px;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-white);
    cursor: pointer;
    transition: var(--transition);
}

.language-switcher .lang-flag {
    display: none;
}

.language-switcher .lang-flag.is-active {
    display: inline-flex;
    position: relative;
    z-index: 2;
}

.language-switcher:hover .lang-flag,
.language-switcher:focus-within .lang-flag {
    display: inline-flex;
}

.language-switcher:hover .lang-flag:not(.is-active),
.language-switcher:focus-within .lang-flag:not(.is-active) {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 3;
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.lang-flag.is-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(85, 107, 47, 0.2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.logo {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 112px;
    width: auto;
    object-fit: contain;
}

.header.nav--scrolled .logo-image {
    height: 78px;
}

.logo-text {
    font-size: 2.25rem;
    font-weight: 300;
    color: inherit;
    font-family: var(--font-serif);
    transition: color 0.3s ease;
}

.header.nav--light .logo-text {
    color: var(--color-white);
}

.header.nav--dark .logo-text {
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-xl);
    margin: 0;
    margin-left: 0;
}

.nav-link {
    font-weight: 200;
    transition: color 0.3s ease;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    color: #000000;
}

.nav-link:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Light theme (text white) */
.header.nav--light .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

.header.nav--light .nav-link:hover::after {
    width: 100%;
}

/* Dark theme (text dark) */
.header.nav--dark .nav-link {
    color: var(--color-text);
}

.header.nav--dark .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.header.nav--dark .nav-link:hover::after {
    width: 100%;
}

/* ===== CART BUTTON ===== */
.cart-button {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.cart-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cart-button:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

.cart-icon {
    width: 24px;
    height: 24px;
    color: #000000;
}

.header.nav--light .cart-button {
    color: #000000;
}

.header.nav--light .cart-icon {
    color: #000000;
}

.header.nav--dark .cart-button {
    color: #000000;
}

.header.nav--dark .cart-icon {
    color: #000000;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 0.72rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 6px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.header.nav--light .hamburger-line {
    background-color: var(--color-white);
}

.header.nav--dark .hamburger-line {
    background-color: var(--color-text);
}

.header.nav--scrolled .hamburger-line {
    background-color: var(--color-text);
}

/* Hamburger animation: open state */
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(11px);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-11px);
}

/* ===== MOBILE MENU ===== */
@media (max-width: 768px) {
    .header {
        padding: var(--spacing-md) 0;
    }

    .header.nav--scrolled {
        padding: var(--spacing-sm) 0;
    }

    .nav-container {
        padding: 0 var(--spacing-md);
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        list-style: none;
        margin: 0;
    }

    .nav-menu.nav--open {
        max-height: 400px;
    }

    .nav-link {
        display: block;
        padding: var(--spacing-md) var(--spacing-lg);
        color: var(--color-white);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover {
        background-color: rgba(212, 175, 55, 0.1);
    }
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.hero-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/elia.jpg');
    background-size: cover;
    background-position: center;
    /* Replace above with actual image:
       background-image: url('path/to/hero-image.jpg');
       background-size: cover;
       background-position: center;
    */
    z-index: 1;
}

/* VIDEO BACKGROUND (Optional - uncomment .hero-video in HTML to use)
.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: transparent;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #ffffff;
    max-width: 900px;
    padding: var(--spacing-lg);
}

.hero-badge {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid #ffffff;
    border-radius: 50px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 300;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-title-line {
    display: block;
}

.hero-subtitle {
    font-size: 2.205rem;
    margin-bottom: var(--spacing-2xl);
    opacity: 1;
    line-height: 1.8;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    text-align: center;
    margin-left: -2rem;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 4px;
    font-weight: 300;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: #556B2F;
    color: var(--color-white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

/* Hero secondary button visibility */
.hero .btn-secondary {
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    font-weight: 600;
}

.hero .btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 1);
}

.hero .btn-primary {
    background-color: #556B2F;
    color: #ffffff;
    border: 2px solid #556B2F;
    backdrop-filter: blur(6px);
    font-weight: 600;
}

.hero .btn-primary:hover {
    background-color: #3d4b1f;
    color: #ffffff;
    border-color: #3d4b1f;
}

/* ===== SECTIONS ===== */
section {
    padding: var(--spacing-2xl) 0;
}

section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: var(--spacing-lg);
    color: #000000;
    text-align: center;
    font-weight: 300;
}


.products h2,
.products p {
    color: var(--color-primary);
}

.about h2,
.contact h2 {
    color: var(--color-primary);
}

.about,
.contact {
    background-color: var(--color-light);
}

.products {
    background: #ffffff;
}

.about:nth-child(even),
.contact:nth-child(even) {
    background-color: var(--color-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

section p {
    font-size: 1rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.about,
.products,
.contact {
    color: var(--color-primary);
}

#contact {
    padding: var(--spacing-lg) 0;
}

#contact h2 {
    margin-bottom: var(--spacing-sm);
}

#contact p {
    margin-bottom: var(--spacing-sm);
}

.contact-form {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.contact-form .btn {
    align-self: center;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-2xl);
}

/* ===== ARCHIVE-STYLE PRODUCT GRID ===== */
/* Product grid layout */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* New product card design */
.p-card {
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.p-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Image area */
.p-media {
    height: 260px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.p-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 18px;
}

/* Content area */
.p-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.p-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 500;
    color: #000;
}

.p-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.p-tag {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    font-weight: 500;
    text-transform: uppercase;
}

/* Price + qty + Add row */
.p-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.p-price {
    font-size: 18px;
    font-weight: 600;
    color: #1f3b2c;
    margin-right: auto;
}

.p-coming-soon {
    font-size: 18px;
    font-weight: 600;
    color: #9b6b47;
    margin-right: auto;
    font-style: italic;
}

/* Quantity selector */
.p-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 999px;
    padding: 6px 10px;
}

.p-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    color: #333;
    transition: all 0.2s ease;
}

.p-qty-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.p-qty-btn:active {
    transform: scale(0.95);
}

.p-qty-val {
    min-width: 18px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

/* Add button */
.p-add {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    background: #1f3b2c;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.p-add:hover {
    background: #27542c;
    box-shadow: 0 4px 12px rgba(31, 59, 44, 0.3);
    transform: translateY(-2px);
}

.p-add:active {
    transform: translateY(0);
}

@media (max-width: 700px) {
    .p-media {
        height: 220px;
    }
    .p-title {
        font-size: 18px;
    }
    .p-bottom {
        flex-wrap: wrap;
    }
    .p-add {
        width: 100%;
    }
}

.product-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.product-size-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.product-size-select:hover:not(:disabled) {
    border-color: var(--color-primary);
}

.product-size-select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.product-size-select:disabled {
    background-color: var(--color-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.product-footer {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding-left: 0;
    margin-left: -12px;
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.product-quantity-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-primary);
    padding: 0;
}

.qty-btn:hover:not(:disabled) {
    border-color: var(--color-secondary);
    background: rgba(212, 175, 55, 0.05);
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-display {
    flex: 1;
    text-align: center;
    font-weight: 600;
    min-width: 24px;
    color: var(--color-text);
}

.product-price {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 300;
    color: #000000;
    margin-bottom: var(--spacing-xs);
}

.product-add-to-cart {
    flex: 0 0 auto;
    padding: 0.7rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    min-height: 28px;
    white-space: nowrap;
}

.product-add-to-cart:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background-color: #18a975;
}

.product-add-to-cart:disabled {
    background-color: var(--color-light);
    color: var(--color-text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.product-out-of-stock {
    padding: var(--spacing-md);
    text-align: center;
    background-color: #ffebee;
    color: #d32f2f;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

/* ===== RESPONSIVE PRODUCT GRID ===== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--spacing-md);
    }

    .product-image-container {
        height: 130px;
    }

    .product-card {
        padding: var(--spacing-md);
    }
}

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

    .product-image-container {
        height: 200px;
    }
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--color-primary);
    color: var(--color-light);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.footer p {
    color: var(--color-light);
    font-size: 0.95rem;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-socials a {
    color: var(--color-light);
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
}

.footer-socials a:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-socials svg {
    width: 24px;
    height: 24px;
}

.footer-follow {
    color: var(--color-light);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.footer-info {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-info p {
    color: var(--color-light);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.footer-info a {
    color: var(--color-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ===== IMAGE MODAL GALLERY ===== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease;
}

.image-modal[hidden] {
    display: none;
}

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

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1;
}

.modal-container {
    position: relative;
    z-index: 2;
    background-color: var(--color-white);
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-text);
    cursor: pointer;
    z-index: 3;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--color-light);
    color: var(--color-primary);
}

.modal-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: auto;
    padding: var(--spacing-lg);
}

.modal-main-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background-color: var(--color-light);
    border-radius: 4px;
    min-height: 400px;
    margin-bottom: var(--spacing-lg);
}

.modal-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-thumbnails {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
}

.modal-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid var(--color-border);
    transition: all 0.2s ease;
    flex-shrink: 0;
    overflow: hidden;
}

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

.modal-thumbnail:hover {
    border-color: var(--color-primary);
}

.modal-thumbnail.active {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px var(--color-secondary);
}

.modal-thumbnail:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== RESPONSIVE MODAL ===== */
@media (max-width: 768px) {
    .image-modal {
        padding: var(--spacing-sm);
    }

    .modal-container {
        max-height: 95vh;
        border-radius: 4px;
    }

    .modal-content {
        padding: var(--spacing-md);
    }

    .modal-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 40px;
        height: 40px;
        font-size: 1.75rem;
    }

    .modal-main-image-container {
        min-height: 300px;
        margin-bottom: var(--spacing-md);
    }

    .modal-thumbnail {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .image-modal {
        padding: 0;
    }

    .modal-container {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    .modal-content {
        padding: var(--spacing-md);
    }

    .modal-main-image-container {
        min-height: 250px;
        margin-bottom: var(--spacing-md);
    }

    .modal-thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* ===== CART DRAWER ===== */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    display: none;
    width: 100%;
    animation: slideInRight 0.35s ease;
}

.cart-drawer.cart-drawer--open {
    display: flex;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.cart-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.cart-container {
    position: relative;
    z-index: 2;
    background-color: var(--color-white);
    max-width: 450px;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    margin-left: auto;
}

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

.cart-header h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin: 0;
    color: #000000;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--color-text);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cart-close:hover {
    background-color: var(--color-light);
    color: var(--color-primary);
}

.cart-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    min-height: 200px;
    background-color: var(--color-white);
}

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

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

.cart-item-image {
    width: 80px;
    height: 80px;
    background-color: var(--color-light);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-weight: 600;
    color: #000000;
    margin-bottom: var(--spacing-xs);
}

.cart-item-size {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.cart-item-price {
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.quantity-btn {
    background-color: var(--color-light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.quantity-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.cart-item-remove:hover {
    color: #c82333;
}

.cart-item-remove:focus-visible {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-light);
    text-align: center;
    padding: var(--spacing-lg);
}

.cart-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    flex-shrink: 0;
    background-color: var(--color-white);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.cart-footer[hidden] {
    display: none;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--color-primary);
}

.cart-subtotal span:last-child {
    color: var(--color-secondary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
}

.cart-total span:last-child {
    color: var(--color-secondary);
}

/* ===== RESPONSIVE CART DRAWER ===== */
@media (max-width: 768px) {
    .cart-container {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .cart-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 var(--spacing-md);
    }

    .nav-menu {
        gap: var(--spacing-md);
    }

    .hero-buttons {
        gap: var(--spacing-sm);
    }

    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
        flex: 1;
        min-width: 120px;
    }

    section {
        padding: var(--spacing-xl) 0;
    }

    section h2 {
        margin-bottom: var(--spacing-md);
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: var(--spacing-sm);
        font-size: 0.9rem;
    }

    .hero-content {
        padding: var(--spacing-md);
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* ===== CHECKOUT SECTION ===== */

.checkout {
    background-color: var(--color-light);
    padding: var(--spacing-2xl) 0;
    position: relative;
}

.checkout.hidden {
    display: none;
}

.checkout .container {
    position: relative;
}

.checkout h2 {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

.checkout h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    color: #000000;
}

.checkout-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-close:hover {
    color: var(--color-primary);
    transform: scale(1.2);
}

.checkout-content {
    display: -webkit-box;
    display: -webkit-grid;
    display: -ms-grid;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    background: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    -webkit-box-shadow: var(--shadow-md);
}

.checkout-form-section,
.checkout-summary-section {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

/* Form Styles */
.checkout-form {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-row {
    display: -webkit-box;
    display: -webkit-grid;
    display: -ms-grid;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 600;
    color: #000000;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: var(--spacing-xs) var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    -webkit-box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group input.field-error {
    border-color: #d32f2f;
    background-color: rgba(211, 47, 47, 0.05);
}

.error-message {
    color: #d32f2f;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 20px;
}

/* Checkout Summary */
.checkout-summary {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.checkout-items {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-border);
}

.checkout-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-xs);
    background-color: var(--color-light);
    border-radius: 4px;
}

.checkout-item-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.checkout-item-name {
    font-weight: 600;
    color: #000000;
}

.checkout-item-total {
    font-weight: 700;
    color: var(--color-secondary);
    font-size: 1rem;
}

.checkout-item-details {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.checkout-empty {
    padding: var(--spacing-md);
    background: var(--color-light);
    border-radius: 6px;
    text-align: center;
    color: var(--color-text-light);
}

.checkout-totals {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.payment-methods {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-light);
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.payment-methods h4 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 1.05rem;
    color: #000000;
}

.payment-method-option {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--color-text);
}

.payment-method-option:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    -webkit-box-shadow: var(--shadow-sm);
}

.payment-method-option input {
    width: 16px;
    height: 16px;
}

.checkout-subtotal,
.checkout-shipping,
.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-subtotal span:first-child,
.checkout-shipping span:first-child,
.checkout-total span:first-child {
    color: var(--color-text-light);
}

.checkout-subtotal span:last-child,
.checkout-shipping span:last-child {
    color: var(--color-text);
    font-weight: 600;
}

.checkout-total {
    padding: var(--spacing-md);
    background-color: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
}

.checkout-total span:first-child {
    color: var(--color-primary);
}

.checkout-total span:last-child {
    color: var(--color-secondary);
}

/* Stripe Payment Element */
.stripe-section {
    background-color: var(--neutral-100);
    padding: var(--spacing-lg);
    border-radius: 8px;
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--neutral-200);
}

.stripe-section h3 {
    margin-bottom: var(--spacing-md);
    color: var(--neutral-900);
    font-size: 18px;
    font-weight: 600;
}

#stripe-payment-element {
    min-height: 250px;
    width: 100%;
    display: block;
    position: relative;
}

/* Ensure Stripe payment elements display properly across all browsers */
#stripe-payment-element iframe {
    width: 100% !important;
    height: auto !important;
}

/* Apple Pay and Mobile Pay Button Support */
@supports (-webkit-appearance: none) {
    .stripe-payment-element,
    #stripe-payment-element {
        -webkit-font-smoothing: antialiased;
        -webkit-text-size-adjust: 100%;
    }
}

/* Firefox Support */
@-moz-document url-prefix() {
    #stripe-payment-element {
        min-height: 280px;
    }
}

/* Safari-specific optimizations for wallet buttons */
@supports (padding: max(0px)) {
    #stripe-payment-element {
        padding: max(0px, env(safe-area-inset-bottom));
    }
}

/* Mobile Pay and Apple Pay Button Container */
.payment-methods-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
}

/* Ensure payment method buttons display properly */
[role="button"],
.ApplePay,
.MobilePay,
[data-test-id="ApplePayButton"],
[data-test-id="MobilePayButton"] {
    min-height: 44px;
    width: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
}

.stripe-message {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 4px;
    margin-top: var(--spacing-md);
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.stripe-message-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.stripe-message-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

/* Payment Button Loading State */
#stripePayBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

#stripePayBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner[hidden] {
    display: none !important;
}

@keyframes spin {
    to { 
        -webkit-transform: rotate(360deg);
        -moz-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* Checkout Actions */
.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.checkout-confirmation {
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: #4caf50;
    color: white;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

/* ===== CHECKOUT PAGE ===== */
.checkout-page .header {
    position: static;
    background-color: var(--color-white);
    box-shadow: none;
}

.checkout-page-main {
    padding: 16px 0 24px;
}

.checkout-page-grid {
    display: -webkit-box;
    display: -webkit-grid;
    display: -ms-grid;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--spacing-md);
    -webkit-box-align: start;
    -webkit-align-items: start;
    -ms-flex-align: start;
    align-items: start;
}

.checkout-summary-panel h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 3vw, 2rem);
    margin: 0 0 var(--spacing-xs) 0;
    color: #000000;
}

.checkout-intro {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.checkout-summary-panel .checkout-summary,
.checkout-summary-panel .checkout-totals {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-xs);
    box-shadow: var(--shadow-sm);
}

.checkout-summary-panel .checkout-totals {
    margin-top: var(--spacing-xs);
}

.checkout-form-panel h2 {
    font-family: var(--font-serif);
    color: #000000;
    margin: 0 0 var(--spacing-xs) 0;
    font-size: clamp(1.7rem, 3vw, 2rem);
    font-weight: 600;
}

.checkout-notice {
    min-height: 24px;
    color: #d32f2f;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 900px) {
    .checkout-page-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== SUCCESS PAGE ===== */
.success-main {
    min-height: 100vh;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    background-color: var(--color-light);
    padding: var(--spacing-2xl) 0;
}

.success-card {
    background-color: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.success-card h1 {
    font-family: var(--font-serif);
    margin-bottom: var(--spacing-md);
    color: #000000;
}

.success-order {
    font-weight: 600;
    margin: var(--spacing-lg) 0;
}

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

/* Responsive Design for Checkout */
@media (max-width: 768px) {
    .checkout-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkout-close {
        top: var(--spacing-md);
        right: var(--spacing-md);
    }

    .checkout h2 {
        padding-right: 50px;
    }
}

@media (max-width: 480px) {
    .checkout {
        padding: var(--spacing-xl) 0;
    }

    .checkout-content {
        padding: var(--spacing-md);
    }

    .checkout h3 {
        font-size: 1.25rem;
    }

    .checkout-item-details {
        font-size: 0.8rem;
    }
}
