:root {
    --primary: #8DA399;
    --primary-dark: #6D8278;
    --secondary: #F4E8D1;
    --accent: #D18C7E;
    --bg-light: #FAF9F6;
    --text-main: #3D4A45;
    --text-muted: #6D8278;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.2);
    --container-width: 1200px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .brand {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* NAVBAR */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

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

#three-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 4rem;
    max-width: 700px;
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 30px rgba(141, 163, 153, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(141, 163, 153, 0.4);
}

.btn-secondary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(141, 163, 153, 0.1);
    transform: translateY(-5px);
}

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

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

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* STORE CARDS */
.store-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    border: 1px solid #EDEDED;
    text-align: left;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.store-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
}

.card-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--secondary);
    color: var(--text-main);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    letter-spacing: 1px;
}

.store-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.store-card .desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    height: 65px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
}

.current-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.card-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.btn-product-switch, .btn-add-cart {
    flex: 1;
    padding: 0.8rem 0;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-product-switch {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    text-decoration: none;
}

.btn-product-switch:hover {
    background: var(--primary);
    color: white;
}

.btn-add-cart {
    background: var(--text-main);
    color: white;
}

.btn-add-cart:hover {
    background: #1a221f;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.bg-soft { background: var(--secondary); opacity: 0.8; }

/* REVEAL ON SCROLL */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: revealAnim 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-delay {
    opacity: 0;
    transform: translateY(30px);
    animation: revealAnim 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.reveal-delay-2 {
    opacity: 0;
    transform: translateY(30px);
    animation: revealAnim 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

@keyframes revealAnim {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MEDIA QUERIES */
@media (max-width: 768px) {
    #hero { align-items: flex-start; padding-top: 90px; }
    h1 { font-size: 2rem; text-align: center; margin-bottom: 0.5rem; }
    .hero-content { padding: 0 1rem; display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 auto; z-index: 10; width: 100%; }
    .hero-content p { text-align: center; font-size: 1rem; margin-bottom: 1.5rem; line-height: 1.4; }
    .cta-group { flex-direction: column; align-items: center; gap: 1rem; width: 100%; }
    .cta-group .btn { width: 100%; text-align: center; }
    .grid-two { grid-template-columns: 1fr; gap: 2rem; }
    .nav-links { display: none; }
    .section { padding: 60px 0; }
    .section-title { font-size: 2rem; margin-bottom: 2rem; }
    .category-grid { grid-template-columns: 1fr; }
}

/* CART SIDEBAR */
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1999; display: none;
    backdrop-filter: blur(2px);
}
.cart-sidebar {
    position: fixed; top: 0; right: 0; width: 400px; height: 100vh;
    background: white; z-index: 2000; padding: 2rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
}
.cart-sidebar.open { transform: translateX(0); }
.cart-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 1rem; margin-bottom: 1rem; }
.cart-header h2 { font-size: 1.5rem; margin: 0; }
#close-cart-btn { background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--text-muted); }
.cart-items { flex: 1; overflow-y: auto; }
.cart-item { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f8f8f8; }
.cart-item img { width: 60px; height: 60px; object-fit: contain; background: #fafafa; border-radius: 8px; }
.cart-item-details h4 { font-size: 0.95rem; margin-bottom: 0.2rem; color: var(--text-main); }
.cart-item-details p { font-size: 0.85rem; color: var(--text-muted); margin: 0; font-weight:600; }
.remove-item { background: none; border: none; color: #e74c3c; font-size: 1.5rem; font-weight: bold; cursor: pointer; margin-left: auto; transition: 0.2s; }
.remove-item:hover { color: #c0392b; transform: scale(1.1); }
.cart-footer { padding-top: 1.5rem; border-top: 2px solid #eee; margin-top:auto; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; color:var(--text-main); }
.empty-cart-msg { text-align: center; color: var(--text-muted); margin-top: 2rem; font-style: italic; }

/* SUCCESS MODAL */
.success-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 3000; display: none;
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.success-modal-content {
    background: white; padding: 3rem; border-radius: 20px;
    text-align: center; max-width: 500px; animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.success-icon {
    width: 80px; height: 80px; background: var(--primary); color: white;
    font-size: 40px; line-height: 80px; border-radius: 50%;
    margin: 0 auto 1.5rem; font-weight: bold;
}
.success-modal-content h2 { margin-bottom: 1rem; color: var(--text-main); }
.success-modal-content p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; }
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(141,163,153,0.2);
}

@media (max-width: 500px) {
    .cart-sidebar { width: 100%; }
    .success-modal-content.checkout-content { padding: 1.5rem; margin: 1rem; }
}

/* RESPONSIVE FORM LAYOUT */
.form-row {
    display: flex;
    gap: 1rem;
}
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}

html {
    scroll-behavior: smooth;
}

.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 3D PRODUCT INFO BUBBLE */
.product-info-bubble {
    position: absolute;
    bottom: 10%; right: 5%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem; border-radius: 20px; border: 1px solid rgba(255,255,255,0.6);
    max-width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    opacity: 0; transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    pointer-events: none;
}
.product-info-bubble.show { opacity: 1; transform: translateY(0); }
#bubble-title { color: var(--primary-dark); margin-bottom: 0.5rem; font-size: 1.2rem; font-weight: 700; font-family: 'Playfair Display', serif; }
#bubble-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.bubble-price { font-weight: bold; font-size: 1.3rem; color: var(--text-main); }
@media (max-width: 768px) {
    .product-info-bubble { bottom: 2%; left: 5%; right: 5%; max-width: none; padding: 1rem; }
    #bubble-desc { margin-bottom: 0.5rem; font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
