/* --- CSS VARIABLES & RESET --- */
:root {
    --color-black: #111111;
    --color-white: #ffffff;
    --color-accent: #e0dcd5; /* Soft Beige */
    --color-gray: #f5f5f5;
    --color-text: #333333;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --spacing-container: 1200px;

    /* Z-Index System */
    --z-header: 1000;
    --z-chat: 2000;
    --z-overlay: 2500;
    --z-sidebar: 2501;
    --z-mobile-menu: 2502;
    --z-popup: 3000;
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--color-black);
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { width: 100%; height: auto; display: block; object-fit: cover; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }

/* --- UTILITIES --- */
.container {
    max-width: var(--spacing-container);
    margin: 0 auto;
    padding: 0 20px;
}
.btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--color-black);
    color: var(--color-white);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.btn:hover {
    background-color: var(--color-accent);
    color: var(--color-black);
}
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-black);
    color: var(--color-black);
}
.btn-outline:hover {
    background-color: var(--color-black);
    color: var(--color-white);
}
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease-in; }

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

/* --- HEADER --- */
header {
    padding: 20px 0;
    position: sticky;
    top: 0;
    background-color: rgba(255,255,255,0.95);
    z-index: var(--z-header);
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}
header.scrolled {
    border-bottom: 1px solid var(--color-gray);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: "Playwrite CZ", cursive;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    font-weight: 700;
}
/* --- PROMO MARQUEE --- */
.promo-marquee {
    background: linear-gradient(90deg, #000000 0%, #001f3f 100%);
    color: var(--color-white);
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.marquee-content {
    display: inline-block;
    animation: marquee 40s linear infinite;
    padding-left: 100%; /* Start from right */
}
@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.nav-links {
    display: flex;
    gap: 30px;
}
.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--color-black);
    transition: width 0.3s;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}
.nav-links a.active {
    font-weight: 600;
}

.mobile-nav-links a.active {
    text-decoration: underline;
    font-weight: 600;
}
.nav-icons {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
}
.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Removed .cart-label style */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #007AFF;
    color: var(--color-white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- NAV DROPDOWNS --- */
.nav-dropdown-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-white);
    border: 1px solid #eee;
    min-width: 120px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: var(--z-header);
}
.nav-dropdown-wrapper:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown a {
    display: block;
    padding: 10px 15px;
    font-size: 0.85rem;
    color: var(--color-text);
    white-space: nowrap;
    border-bottom: 1px solid #f9f9f9;
}
.nav-dropdown a:last-child {
    border-bottom: none;
}
.nav-dropdown a:hover {
    background-color: var(--color-gray);
    color: var(--color-black);
}

/* --- HERO CAROUSEL --- */
.hero {
    height: 85vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}
.hero-img-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.carousel-slide.active {
    opacity: 1;
}
.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 2;
}
.hero-content {
    position: relative;
    z-index: 3;
    color: var(--color-white);
    max-width: 800px;
    padding: 20px;
}
.hero-title {
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
}
.hero-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 15px;
}
.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}
.dot.active {
    background-color: var(--color-white);
    transform: scale(1.2);
}

/* --- OFF-CANVAS CART --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background-color: var(--color-white);
    z-index: var(--z-sidebar);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    will-change: transform;
}
.cart-sidebar.open {
    transform: translate3d(0, 0, 0);
}
.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}
.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: var(--color-gray);
}
.close-cart {
    font-size: 1.5rem;
    cursor: pointer;
}

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


/* --- FEATURED SECTION --- */
.featured {
    padding: 80px 0;
    background-color: var(--color-white);
}
.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* --- PRODUCT CARD --- */
.product-card {
    transition: transform 0.3s;
}
.product-card:hover {
    transform: translateY(-5px);
}
.product-image {
    height: 400px;
    background-color: var(--color-gray);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}
.product-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.product-card:hover .product-image img {
    transform: scale(1.05);
}
.add-to-cart-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.9);
    padding: 15px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.product-card:hover .add-to-cart-overlay {
    transform: translateY(0);
}
.product-info {
    text-align: center;
}
.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
}
.product-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-family: var(--font-serif);
}
.product-price {
    font-weight: 600;
}

/* --- SHOP SECTION --- */
.shop-layout {
    display: flex;
    gap: 40px;
    padding: 60px 0;
}
.sidebar {
    width: 250px;
    flex-shrink: 0;
}
.filter-group {
    margin-bottom: 30px;
}
.filter-title {
    font-size: 1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.filter-list li {
    margin-bottom: 10px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}
.filter-list li:hover, .filter-list li.active {
    color: var(--color-black);
    font-weight: 600;
}
.shop-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

/* --- PRODUCT DETAIL --- */
.product-detail-container {
    padding: 60px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.detail-image {
    width: 100%;
    height: auto;
    background-color: var(--color-gray);
    display: flex;
    justify-content: center;
    align-items: center;
}
.detail-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
}
.detail-info h2 {
    font-size: 3rem;
    margin-bottom: 10px;
}
.detail-price {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #555;
}
.detail-desc {
    margin-bottom: 30px;
    color: #666;
}
.detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}
.quantity-selector {
    display: flex;
    border: 1px solid #ddd;
    height: 45px;
}
.qty-btn {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}
.qty-input {
    width: 50px;
    border: none;
    text-align: center;
    font-size: 1rem;
}

/* --- CART SECTION --- */
.cart-section {
    padding: 60px 0;
    max-width: 800px;
    margin: 0 auto;
}
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}
.cart-img {
    width: 80px;
    height: 100px;
    object-fit: cover;
}
.cart-summary {
    margin-top: 40px;
    background-color: var(--color-gray);
    padding: 30px;
    text-align: right;
}
.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* --- CHECKOUT SECTION --- */
.checkout-section {
    padding: 60px 0;
    max-width: 600px;
    margin: 0 auto;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    font-family: inherit;
}
.success-message {
    text-align: center;
    padding: 60px 0;
}
.success-icon {
    font-size: 4rem;
    color: var(--color-black);
    margin-bottom: 20px;
}

/* --- NEWSLETTER SECTION --- */
.newsletter-section {
    padding: 80px 0;
    background-color: var(--color-gray);
    text-align: center;
}
.newsletter-content {
    max-width: 600px;
}
.newsletter-title {
    font-size: 2rem;
    margin-bottom: 15px;
}
.newsletter-desc {
    color: #666;
    margin-bottom: 30px;
}
.newsletter-form {
    display: flex;
    gap: 10px;
}
.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    outline: none;
    font-family: inherit;
}
.newsletter-form button {
    white-space: nowrap;
}
.success-msg {
    color: green;
    font-weight: bold;
    padding: 10px;
}

@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }
    .newsletter-form button {
        width: 100%;
    }
    
    /* Mobile Product Detail Fix */
    .product-detail-container {
        padding: 40px 20px;
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .detail-info {
        padding: 0 10px;
    }
    
    /* Checkout Gate Mobile */
    .checkout-gate-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Checkout Layout Mobile */
    .checkout-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    /* Order Summary should come first on mobile? Usually below form is standard, but sometimes above.
       Let's keep default order (Form then Summary) which is standard for mobile. */
}

/* --- VALUES SECTION --- */
.values-section {
    padding: 80px 20px;
    background-color: #fcfcfc; /* Very light gray background to separate from white */
}
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    text-align: center;
}
.value-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-family: var(--font-sans);
    font-weight: 600;
}
.value-item p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}
.value-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--color-black);
    transition: transform 0.3s;
}
.value-item:hover .value-icon {
    transform: scale(1.1);
}

/* --- FOOTER --- */
footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 60px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    color: var(--color-white);
    margin-bottom: 20px;
    font-size: 1.2rem;
}
.footer-col .logo {
    font-size: 1.8rem;
    color: var(--color-white);
    margin-bottom: 15px;
}
.footer-links li { margin-bottom: 10px; color: #aaa; }
.footer-links li:hover { color: var(--color-white); }

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 2rem;
    color: #aaa;
    margin-top: 10px;
}
.payment-icons i:hover {
    color: var(--color-white);
}

.social-icons {
    display: flex;
    gap: 15px;
}
.social-icons a {
    color: #aaa;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.social-icons a:hover {
    color: var(--color-black);
    background-color: var(--color-white);
    border-color: var(--color-white);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.8rem;
    color: #666;
}

/* --- MOBILE MENU --- */
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: var(--z-mobile-menu-toggle);
}
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-white);
    z-index: var(--z-overlay);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
    transform: translateY(-20px);
}
.mobile-nav-overlay.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mobile-nav-links {
    text-align: center;
}
.mobile-nav-links a {
    display: block;
    font-family: var(--font-serif);
    font-size: 2rem;
    margin: 20px 0;
    color: var(--color-black);
    opacity: 0;
    transform: translateY(20px);
    transition: 0.3s;
}
.mobile-nav-overlay.open .mobile-nav-links a {
    opacity: 1;
    transform: translateY(0);
}
.mobile-nav-overlay.open .mobile-nav-links a:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav-overlay.open .mobile-nav-links a:nth-child(2) { transition-delay: 0.2s; }
.mobile-nav-overlay.open .mobile-nav-links a:nth-child(3) { transition-delay: 0.3s; }
.mobile-nav-overlay.open .mobile-nav-links a:nth-child(4) { transition-delay: 0.4s; }

/* --- SALE PROMO SECTION --- */
.sale-promo {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../assets/photo-1558769132-cb1aea458c5e.avif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 120px 0;
    text-align: center;
    color: var(--color-white);
    margin-top: 80px;
}
.sale-content {
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 40px;
    backdrop-filter: blur(5px);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-toggle { display: block; margin-right: 20px; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; padding: 0 20px; }
    .shop-layout { flex-direction: column; }
    .sidebar { width: 100%; margin-bottom: 30px; }
    .product-detail-container { grid-template-columns: 1fr; gap: 30px; }
    .detail-image { height: 400px; }
    .detail-image img { max-height: 100%; }
    .detail-actions { flex-direction: column; }
    .detail-actions button { width: 100%; }
    .cart-item { grid-template-columns: 60px 1fr; grid-template-rows: auto auto; gap: 10px; }
    .cart-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
    
    /* Animation fix already handled in main class, just ensuring no conflicts */
    /* .cart-sidebar { width: 100%; } handled in previous media query */
    
    .sale-promo { padding: 80px 0; }

    /* Product Card Mobile UX: Always show Add to Cart */
    .add-to-cart-overlay {
        transform: translateY(0) !important;
        background: rgba(255,255,255,0.95);
        padding: 10px;
    }
    .product-image img {
        transform: scale(1) !important; /* Disable zoom on scroll/touch */
    }

    /* Footer Mobile Optimization */
    .footer-grid { grid-template-columns: 1fr; text-align: left; gap: 40px; }
    .footer-col h4 { margin-bottom: 15px; }
    .social-icons { justify-content: flex-start; }
    .payment-icons { justify-content: flex-start; }
    .copyright { padding-bottom: 80px; text-align: left; } /* Extra space for bottom-fixed elements if any */

    /* Re-order navbar for mobile: Logo (Left) - Icons - Hamburger (Right) */
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Reset default space-between to handle custom spacing via margins */
    }
    
    .logo { 
        order: 1; 
        font-size: 1.5rem; 
        margin-right: auto; /* Pushes everything else to the right */
    }

    .nav-icons { 
        order: 2; 
        gap: 20px; /* Increased gap for touch targets */
        font-size: 1.3rem;
        margin-right: 20px; /* Space between icons and hamburger */
    }
    
    /* Better touch targets */
    .nav-icon, .cart-icon-wrapper {
        padding: 5px; 
        display: flex;
        align-items: center;
    }

    .mobile-menu-toggle { 
        order: 3; 
        margin-right: 0; 
        font-size: 1.4rem;
        padding: 5px; /* Touch target */
    }
}

/* --- AI CHAT WIDGET --- */
#chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    font-family: var(--font-sans);
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background-color: var(--color-black);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background-color: #007AFF;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 122, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: var(--color-white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: scale(1);
}

.chat-window.hidden {
    display: flex !important;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    visibility: hidden;
}

.chat-header {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-chat {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s;
}

.close-chat:hover {
    transform: scale(1.1);
}

.chat-ai-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--color-white);
    color: var(--color-black);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.ai-info {
    display: flex;
    flex-direction: column;
}

.ai-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.ai-status {
    font-size: 0.75rem;
    color: #4cd964;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    animation: slideUp 0.3s ease-out;
}

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

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.bot-message .message-content {
    background-color: var(--color-white);
    border-bottom-left-radius: 4px;
    color: var(--color-text);
}

.user-message .message-content {
    background-color: var(--color-black);
    color: var(--color-white);
    border-bottom-right-radius: 4px;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
    margin-left: 5px;
}

.user-message .message-time {
    text-align: right;
    margin-right: 5px;
}

.chat-input-area {
    padding: 15px;
    background-color: var(--color-white);
    border-top: 1px solid #eee;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-option-btn {
    padding: 8px 15px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    color: var(--color-text);
}

.chat-option-btn:hover {
    background-color: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

@media (max-width: 768px) {
    .chat-window {
        position: fixed;
        width: 100%;
        height: 85vh;
        bottom: 0;
        right: 0;
        left: 0;
        margin: 0;
        border-radius: 25px 25px 0 0;
        transform-origin: bottom center;
        box-shadow: 0 -5px 40px rgba(0,0,0,0.2);
        z-index: 2010;
        transform: translateY(0);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0s;
    }
    
    .chat-window.hidden {
        display: flex !important;
        transform: translateY(100%);
        opacity: 1;
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.4s;
    }

    #chat-widget-container {
        right: 20px;
        bottom: 20px;
        z-index: 2005; /* Ensure above mobile menu/cart */
    }

    .chat-toggle-btn {
        width: 55px;
        height: 55px;
    }
}

/* --- DISCOUNT BADGE --- */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff3b30;
    color: var(--color-white);
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 3px;
    z-index: 2;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

.sale-price {
    color: #ff3b30;
    font-weight: bold;
}

/* --- POPUP MODAL --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}
.popup-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.popup-content {
    background: var(--color-white);
    padding: 40px;
    border-radius: 5px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.popup-overlay.open .popup-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* --- TOAST NOTIFICATION --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    z-index: var(--z-popup);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}
.close-popup:hover {
    color: var(--color-black);
}
.popup-icon {
    font-size: 3rem;
    color: var(--color-black);
    margin-bottom: 20px;
}
.discount-code {
    background-color: var(--color-gray);
    padding: 10px;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 20px 0;
    border: 1px dashed var(--color-black);
}
