* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #171717;
    --color-primary-light: #262626;
    --color-text: #262626;
    --color-text-light: #525252;
    --color-text-lighter: #737373;
    --color-border: #e5e5e5;
    --color-background: #fafaf9;
    --color-white: #ffffff;
    --color-whatsapp: #25D366;
    --color-danger: #dc2626;
    --transition-speed: 0.3s;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

/* ==========================================
    HEADER
   ========================================== */
header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--color-text);
    cursor: pointer;
    border: none;
    background: none;
    transition: color var(--transition-speed);
}

.logo:hover {
    color: var(--color-text-light);
}

nav {
    display: none;
    gap: 2rem;
}

nav button {
    font-size: 0.875rem;
    color: var(--color-text-light);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-speed);
    font-weight: 400;
}

nav button:hover {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    position: relative;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #404040;
    transition: color var(--transition-speed);
}

.cart-btn:hover {
    color: var(--color-primary);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
}

.menu-btn {
    display: block;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    border-top: 1px solid var(--color-border);
    background: var(--color-white);
    padding: 1rem;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0;
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    transition: color var(--transition-speed);
    font-size: 0.875rem;
}

.mobile-menu button:hover {
    color: var(--color-primary);
}

/* ==========================================
    CART SIDEBAR
   ========================================== */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
    backdrop-filter: blur(2px);
}

.cart-overlay.active {
    display: block;
}

.cart-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    height: 100%;
    width: 100%;
    max-width: 420px;
    background: var(--color-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-speed) ease;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 1.25rem;
    font-weight: 400;
}

.close-cart {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    transition: background var(--transition-speed);
    border-radius: 4px;
}

.close-cart:hover {
    background: #f5f5f5;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    text-align: center;
    color: var(--color-text-lighter);
    margin-top: 3rem;
    font-size: 0.9rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.cart-item-price {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    padding: 0.25rem;
    background: none;
    border: 1px solid var(--color-border);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-speed);
    color: var(--color-text-light);
}

.qty-btn:hover {
    background: #f5f5f5;
    border-color: var(--color-text-light);
}

.cart-item-qty {
    font-size: 0.875rem;
    width: 32px;
    text-align: center;
    font-weight: 500;
}

.remove-btn {
    margin-left: auto;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    transition: background var(--transition-speed);
    border-radius: 4px;
}

.remove-btn:hover {
    background: #fee2e2;
}

.cart-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem;
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

/* Pie del carrito integrado al sidebar */
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #fdfcfb;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.checkout-btn-wa {
    width: 100%;
    padding: 1rem;
    background: var(--color-whatsapp);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.checkout-btn-wa:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}


/* ==========================================
    WHATSAPP FLOATING BUTTON
   ========================================== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--color-whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-whatsapp);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 30;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.whatsapp-float:hover {
    background: #22c55e;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* ==========================================
    MAIN CONTENT
   ========================================== */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1rem;
    min-height: calc(100vh - 200px);
}

/* Home Section */
.home-hero {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 4rem;
    padding: 3rem 0;
}

.home-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.025em;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.home-hero p {
    color: var(--color-text-light);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.75;
}

.home-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.category-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: none;
    padding: 0;
    width: 100%;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    transition: background var(--transition-speed);
}

.category-card:hover .category-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.category-overlay h2 {
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.025em;
}

/* Products Section */
.section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 300;
    color: var(--color-text);
    margin-bottom: 2.5rem;
    letter-spacing: 0.025em;
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.product-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid #f5f5f5;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.25rem;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.product-desc {
    font-size: 0.8rem;
    color: var(--color-text-lighter);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.product-price {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
}

.add-to-cart-btn:hover {
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

/* ==========================================
    FOOTER
   ========================================== */
footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    margin-top: 6rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.75rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.footer-domain {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--color-text-lighter);
    margin-bottom: 1.5rem;
}

.footer-contact {
    margin-top: 1.5rem;
}

.footer-contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-whatsapp);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.footer-contact a:hover {
    color: #22c55e;
}

/* ==========================================
    UTILITIES
   ========================================== */
.hidden {
    display: none !important;
}

/* ==========================================
    RESPONSIVE
   ========================================== */
@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .whatsapp-float {
        width: 64px;
        height: 64px;
    }
}

@media (min-width: 768px) {
    nav {
        display: flex;
    }

    .menu-btn {
        display: none;
    }

    .home-categories {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .cart-sidebar {
        max-width: 420px;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .products-grid.classes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    main {
        padding: 4rem 2rem;
    }
}
/* ESTILOS PARA PRODUCTOS AGOTADOS */

/* Badge de agotado sobre la imagen */
.sold-out-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
    z-index: 10;
}

/* Estilo para tarjetas de productos agotados */
.product-card.sold-out {
    opacity: 0.7;
    position: relative;
}

.product-card.sold-out .product-image {
    position: relative;
    filter: grayscale(50%);
}

.product-card.sold-out .product-image img {
    opacity: 0.6;
}

/* Botón deshabilitado */
.add-to-cart-btn.disabled {
    background-color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.add-to-cart-btn.disabled:hover {
    background-color: #999 !important;
    transform: none !important;
}
