/* ===== CSS VARIABLES & DESIGN SYSTEM (MODISTA INSPIRED) ===== */
:root {
    /* Main Brand Colors */
    --clr-brand-purple: #4B2E83;
    --clr-brand-purple-light: #6240a5;
    --clr-accent-orange: #E05A3D; /* For Sales, Low Stock, Prices */
    
    /* Backgrounds & Surfaces */
    --clr-bg: #F3F4F6; /* Slightly softer gray */
    --clr-surface: #FFFFFF;
    --clr-border: #E5E7EB;
    
    /* Text */
    --clr-text-main: #1F2937; /* Softer, premium black */
    --clr-text-muted: #6B7280;
    --clr-text-white: #FFFFFF;
    
    /* Typography */
    --font-main: 'Inter', sans-serif;
    
    /* Spacing & Borders */
    --container-max: 100%;
    --radius-sm: 8px; /* Rounder */
    --radius-md: 16px; /* Rounder */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.animate-fade-up {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: var(--clr-bg); color: var(--clr-text-main); line-height: 1.5; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== TOP BAR ===== */
.announcement-bar {
    background-color: var(--clr-brand-purple);
    color: var(--clr-text-white);
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== HEADER ===== */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--clr-brand-purple);
    letter-spacing: -1px;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
    display: flex;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: #F9FAFB;
}

.search-bar input:focus {
    border-color: var(--clr-brand-purple);
    background: var(--clr-surface);
    box-shadow: 0 0 0 3px rgba(75, 46, 131, 0.1);
}

.search-btn {
    background: var(--clr-brand-purple);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-left: -2px;
    cursor: pointer;
}

.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-icon-wrapper {
    position: relative;
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--clr-accent-orange);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ===== MAIN CONTENT LAYOUT ===== */
.shop-layout {
    max-width: var(--container-max);
    margin: 2rem auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 3rem;
}

/* ===== SIDEBAR FILTERS ===== */
.sidebar h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--clr-brand-purple);
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h4 {
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: #333;
}

.filter-list li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: 5px;
}

.filter-list li:hover {
    color: var(--clr-brand-purple);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
}

/* ===== PRODUCT CARD (ELEGANT STYLE) ===== */
.product-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow-sm);
}

.product-image-container {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--clr-accent-orange);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.add-to-cart-overlay {
    position: absolute;
    bottom: -60px;
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    color: var(--clr-brand-purple);
    text-align: center;
    padding: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(75, 46, 131, 0.1);
}

.add-to-cart-overlay:hover {
    background: var(--clr-brand-purple);
    color: white;
}

.product-card:hover .add-to-cart-overlay {
    bottom: 10px;
}

.product-info {
    padding: 15px;
    text-align: left;
}

.product-vendor {
    font-size: 0.7rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
    height: 2.8rem;
    overflow: hidden;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-old {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    text-decoration: line-through;
}

.price-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--clr-accent-orange);
}

.stock-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 10px;
}

.stock-in { color: var(--clr-brand-purple); }
.stock-low { color: var(--clr-accent-orange); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-align: center;
    transition: var(--transition);
}

.btn-primary {
    background: var(--clr-brand-purple);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--clr-brand-purple-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== FOOTER (REDISEÑADO) ===== */
.main-footer {
    background: #ffffff;
    border-top: 1px solid var(--clr-border);
    padding: 0;
    margin-top: 5rem;
}

.footer-newsletter {
    background: #f3f0ff; /* Light purple background */
    padding: 3rem 20px;
    text-align: center;
    border-bottom: 1px solid var(--clr-border);
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h3 {
    font-size: 1.5rem;
    color: var(--clr-brand-purple);
    margin-bottom: 0.5rem;
}

.newsletter-content p {
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    outline: none;
}

.footer-main-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 4rem 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: var(--clr-text-main);
}

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

.footer-col ul li a {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: var(--clr-brand-purple);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 1.5rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-brand-purple);
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--clr-brand-purple);
    color: white;
    transform: translateY(-3px);
}

.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.payment-methods img {
    height: 24px;
    opacity: 0.9;
    transition: var(--transition);
}

.payment-methods img:hover {
    opacity: 1;
    transform: scale(1.05);
}

.footer-bottom {
    border-top: 1px solid var(--clr-border);
    padding: 1.5rem 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--clr-text-muted);
}

@media (max-width: 900px) {
    .footer-main-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 500px) {
    .footer-main-content {
        grid-template-columns: 1fr;
    }
    .newsletter-form {
        flex-direction: column;
    }
}

/* ===== WHATSAPP BUTTON ===== */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 999;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .shop-layout { 
        grid-template-columns: 1fr; 
        gap: 1rem;
    }
    .sidebar { display: none; } /* Ocultar sidebar en tablets/móvil para limpiar UI */
    
    .hero-banner h1 { font-size: 1.8rem !important; }
    .hero-banner img { height: 60px !important; }
}

@media (max-width: 768px) {
    .header-container { 
        flex-direction: column; 
        gap: 1rem; 
        padding: 10px;
    }
    .search-bar { 
        max-width: 100%; 
        order: 3; 
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
        font-size: 0.8rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil es estándar y cómodo */
        gap: 10px;
    }
    
    .product-card .product-title {
        font-size: 0.85rem;
        height: 2.4rem;
    }
    
    .price-current {
        font-size: 0.95rem;
    }
    
    .add-to-cart-overlay {
        padding: 8px;
        font-size: 0.75rem;
        bottom: 5px !important; /* Siempre visible o muy accesible en móvil */
        left: 5px;
        right: 5px;
    }
}

/* ===== UTILITIES ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mt-4 { margin-top: 4rem; }

/* ===== STOCK STATUS & BADGES ===== */
.soldout-badge { position: absolute; top: 10px; right: 10px; background: #4B5563; color: white; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; box-shadow: var(--shadow-sm); z-index: 10; }
.product-card.out-of-stock { opacity: 0.8; }
.product-card.out-of-stock .product-image-container img { filter: grayscale(60%); }
.stock-status.stock-out { color: #ef4444; }
.add-to-cart-overlay.disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; border-color: #e5e7eb; }
.add-to-cart-overlay.disabled:hover { background: #f3f4f6; color: #9ca3af; }
