/* ===== VARIABLES ===== */
:root {
    --cream: #F4EAD5;
    --beige: #EADBC8;
    --neutral: #D8C9B6;
    --green: #A3B18A;
    --brown: #6A5E4E;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.08);
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Poppins', sans-serif;
    --transition: all 0.3s cubic-bezier(0.45, 0, 0.55, 1);
    --header-height: 90px;
    --header-shrink: 70px;
}

/* Dark mode variables */
[data-theme="dark"] {
    --cream: #1e1e1e;
    --beige: #2d2d2d;
    --neutral: #3d3d3d;
    --green: #6A8E7A;
    --brown: #EADBC8;
    --white: #121212;
    --shadow: rgba(255, 255, 255, 0.05);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--cream);
    color: var(--brown);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* ===== LOADER ELEGANTE ===== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cream);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loader-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-icon {
    font-size: 3rem;
    animation: float 2s infinite ease-in-out;
}

.loader-text {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--brown);
    letter-spacing: 2px;
}

.loader-progress {
    width: 200px;
    height: 2px;
    background: var(--neutral);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.loader-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--green);
    animation: loading 1.2s infinite;
}

@keyframes loading {
    0% { left: -50%; }
    100% { left: 100%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* ===== HEADER STICKY ===== */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 1000;
    transition: height 0.3s, padding 0.3s, background-color 0.3s;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header.shrink {
    height: var(--header-shrink);
}

.header-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brown);
    text-decoration: none;
}

.logo span {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--green);
    display: block;
}

/* Navigation */
.nav-list {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--brown);
    font-weight: 400;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--brown);
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Cart */
.cart-icon-container {
    position: relative;
}

.cart-btn {
    background: none;
    border: none;
    color: var(--brown);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.cart-btn:hover {
    color: var(--green);
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--green);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CART PANEL ===== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 30px var(--shadow);
    z-index: 2001;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.cart-panel.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.cart-header h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--brown);
}

.cart-close {
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--brown);
    cursor: pointer;
    transition: var(--transition);
}

.cart-close:hover {
    color: var(--green);
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--neutral);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    background: var(--beige);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.cart-item-price {
    color: var(--green);
    font-weight: 500;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--neutral);
    background: none;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.cart-item-remove:hover {
    color: #ff6b6b;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--beige);
    font-size: 1.2rem;
    font-weight: 600;
}

.cart-checkout {
    background: var(--green);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.cart-checkout:hover {
    background: var(--brown);
    transform: translateY(-2px);
}

.empty-cart {
    text-align: center;
    color: var(--neutral);
    margin-top: 3rem;
    font-size: 1.1rem;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--brown);
    overflow: hidden;
}

.hero-parallax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110%;
    background: linear-gradient(135deg, var(--beige) 0%, var(--cream) 100%);
    z-index: -1;
    transform: translateY(-5%);
    transition: transform 0.1s ease-out;
}

.hero-content {
    max-width: 800px;
    padding: 0 1.5rem;
    animation: fadeInUp 1.2s ease;
}

.hero-subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--green);
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(163, 177, 138, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 40px;
    backdrop-filter: blur(5px);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--brown);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--brown);
    opacity: 0.9;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--green);
    color: white;
    box-shadow: 0 8px 20px rgba(163, 177, 138, 0.3);
}

.btn-primary:hover {
    background: var(--brown);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(106, 94, 78, 0.2);
}

/* ===== FILTER & SEARCH ===== */
.filter-section {
    padding: 4rem 0 2rem;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--brown);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--green);
}

.search-wrapper {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--neutral);
    border-radius: 40px;
    font-family: var(--font-sans);
    background: var(--white);
    color: var(--brown);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral);
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.6rem 1.8rem;
    border: 1px solid var(--neutral);
    background: var(--white);
    border-radius: 40px;
    font-family: var(--font-sans);
    color: var(--brown);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--beige);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: var(--transition);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    padding: 1.5rem;
    text-align: center;
}

.product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--brown);
}

.product-price {
    color: var(--green);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.add-to-cart {
    background: none;
    border: 1px solid var(--green);
    color: var(--green);
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.add-to-cart:hover {
    background: var(--green);
    color: white;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--beige) 25%, var(--neutral) 50%, var(--beige) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 20px;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--white);
    border-radius: 20px;
    padding: 1rem;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--beige);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 20px;
    background: var(--beige);
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

.skeleton-line.short {
    width: 60%;
}

/* ===== DARK MODE TOGGLE ===== */
.dark-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 5px 20px var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 999;
}

.dark-toggle:hover {
    transform: scale(1.1);
}

/* ===== FOOTER ===== */
footer {
    background: var(--beige);
    padding: 4rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
    color: var(--brown);
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-links a {
    color: var(--brown);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--green);
    transform: translateY(-3px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--white);
        transition: left 0.3s;
        padding: 2rem;
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .search-wrapper {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .cart-panel {
        max-width: 100%;
    }
    
    .section-title {
        font-size: 2rem;
    }
}