* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray: #2c2c2c;
    --color-gray-light: #f5f5f5;
    --color-gray-medium: #e5e5e5;
    --color-success: #4caf50;
    --color-error: #f44336;
    --font-primary: 'Inter', 'Helvetica Neue', sans-serif;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

body {
    font-family: var(--font-primary);
    background: var(--color-white);
    color: var(--color-black);
    line-height: 1.5;
    overflow-x: hidden;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.7rem 1.2rem;
    background: var(--color-black);
    color: white;
    border-radius: 50px;
    font-size: 0.75rem;
    z-index: 9999;
    white-space: nowrap;
}
.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-error); }

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: center; /* En móviles el logo se centra */
    align-items: center;
    padding: 0.7rem 5%;
    background: white;
    border-bottom: 1px solid var(--color-gray-medium);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.logo-image {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 10px;
}
.logo-text h1 {
    font-size: 0.9rem;
    font-weight: 800;
}
.logo-text .tagline {
    font-size: 0.55rem;
    color: var(--color-gray);
}

/* Estilos de los Enlaces Superiores (Ocultos en móvil por defecto) */
.nav-links {
    display: none;
}
.nav-link-item {
    color: var(--color-black);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}
.nav-link-item:hover {
    color: var(--color-gray);
    transform: translateY(-1px);
}

/* BOTTOM NAVIGATION - BARRA DE BOTONES */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid var(--color-gray-medium);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0.5rem;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
    color: var(--color-gray);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    transition: all 0.2s;
}
.bottom-nav-item .nav-icon { font-size: 1.3rem; }
.bottom-nav-item.active {
    color: var(--color-black);
    background: var(--color-gray-light);
}
.bottom-nav-item:active {
    transform: scale(0.95);
}

/* HERO */
.hero {
    margin-top: 60px;
    margin-bottom: 60px;
    background: var(--color-black);
    color: white;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('imagenes/sanagusfondo.jpeg') center/cover;
    opacity: 0.3;
}
.hero-content {
    position: relative;
    padding: 2rem 1rem;
}
.hero-content h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 1rem; }
.hero-content p { font-size: 0.85rem; margin-bottom: 1.5rem; padding: 0 1rem; }
.hero-buttons { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: white; color: black; }
.btn-secondary { background: transparent; color: white; border: 2px solid white; }

/* COLECCIÓN HERO */
.coleccion-hero {
    margin-top: 60px;
    margin-bottom: 60px;
    background: black;
    color: white;
    padding: 3rem 1rem;
    text-align: center;
}
.coleccion-hero-content h2 { font-size: 1.8rem; }
.coleccion-hero-content p { font-size: 0.8rem; opacity: 0.8; }

/* SECCIÓN PERSONALIZADA */
.custom-section {
    padding: 2rem 4%;
    background: var(--color-gray-light);
    margin-bottom: 60px;
}
.custom-header { text-align: center; margin-bottom: 1.5rem; }
.custom-header h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.custom-header p { font-size: 0.8rem; color: var(--color-gray); }
.custom-grid { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2rem; }
.custom-info-card, .custom-carousel-card {
    background: white;
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--color-gray-medium);
}
.custom-info-card h3 { font-size: 1.1rem; margin-bottom: 0.8rem; }
.custom-features li { list-style: none; margin-bottom: 0.5rem; font-size: 0.8rem; }
.btn-whatsapp {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: #25D366;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* FORMATO CARRUSEL MÓVIL */
.carousel-slides-container {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}
.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s;
}
.carousel-slide.active { opacity: 1; }
.carousel-image { width: 100%; height: 100%; object-fit: cover; }
.carousel-caption { text-align: center; padding: 0.5rem; font-size: 0.65rem; background: black; color: white; border-radius: 0 0 12px 12px; }
.carousel-dots { display: flex; justify-content: center; gap: 0.5rem; padding: 0.8rem; }
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-gray-medium);
    cursor: pointer;
}
.dot.active { background: black; width: 16px; border-radius: 4px; }

.steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.step-card {
    background: white;
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
    border: 1px solid var(--color-gray-medium);
}
.step-number {
    width: 32px;
    height: 32px;
    background: black;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 800;
}
.step-card h4 { font-size: 0.8rem; }
.step-card p { font-size: 0.65rem; color: var(--color-gray); }

/* PRODUCTOS */
.products-section {
    padding: 2rem 4%;
    margin-bottom: 60px;
}
.products-header h2 { text-align: center; font-size: 1.3rem; margin-bottom: 0.3rem; }
.section-subtitle { text-align: center; font-size: 0.75rem; color: var(--color-gray); margin-bottom: 1.5rem; }
.products-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.product-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--color-gray-medium);
    overflow: hidden;
}
.product-image { width: 100%; height: 260px; object-fit: cover; }
.product-info { padding: 1rem; }
.product-title { font-size: 0.9rem; font-weight: 700; }
.product-price { font-weight: 700; font-size: 1rem; margin: 0.2rem 0; }
.product-description { font-size: 0.7rem; color: var(--color-gray); margin: 0.3rem 0; }
.product-meta { display: flex; gap: 0.8rem; font-size: 0.65rem; margin-top: 0.3rem; }
.unique-badge { background: black; color: white; padding: 0.15rem 0.4rem; border-radius: 20px; font-size: 0.6rem; }
.talla-selector { margin: 0.8rem 0; }
.talla-selector label { font-size: 0.65rem; font-weight: 600; }
.talla-select {
    width: 100%;
    padding: 0.5rem;
    background: var(--color-gray-light);
    border: 1px solid var(--color-gray-medium);
    border-radius: 10px;
    font-size: 0.75rem;
}
.buy-btn {
    width: 100%;
    padding: 0.7rem;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
}

/* ADMIN PANEL */
.admin-panel {
    margin: 1rem 4% 70px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--color-gray-medium);
    overflow: hidden;
}
.admin-header { background: black; padding: 1rem; color: white; }
.admin-header h2 { font-size: 1.1rem; }
.admin-header p { font-size: 0.7rem; opacity: 0.7; }
.admin-tabs { display: flex; border-bottom: 1px solid var(--color-gray-medium); }
.admin-tab-btn {
    flex: 1;
    padding: 0.7rem;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 0.65rem;
    cursor: pointer;
}
.admin-tab-btn.active { border-bottom: 2px solid black; }
.admin-tab-content { display: none; padding: 1rem; }
.admin-tab-content.active { display: block; }
.admin-products-grid { display: flex; flex-direction: column; gap: 1rem; }
.admin-buttons { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.hide-btn, .restore-btn, .delete-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.65rem;
    cursor: pointer;
}
.hide-btn { background: #ff9800; color: white; }
.restore-btn { background: #2196f3; color: white; }
.delete-btn { background: transparent; border: 1px solid var(--color-gray-medium); }

.add-product-form { max-width: 100%; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.7rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.7rem;
    background: var(--color-gray-light);
    border: 1px solid var(--color-gray-medium);
    border-radius: 10px;
    font-size: 0.8rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.btn-upload {
    display: block;
    text-align: center;
    padding: 0.7rem;
    background: var(--color-gray-light);
    border: 1px dashed var(--color-gray);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.7rem;
}
.or-divider { text-align: center; margin: 0.8rem 0; font-size: 0.7rem; color: var(--color-gray); }
.image-preview { margin-top: 0.8rem; }
.image-preview img { max-width: 100%; border-radius: 8px; }
.btn-submit {
    width: 100%;
    padding: 0.8rem;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}
.modal-content {
    background: white;
    margin: 25% auto;
    width: 90%;
    max-width: 340px;
    border-radius: 20px;
    overflow: hidden;
}
.close-modal { float: right; font-size: 24px; cursor: pointer; padding: 0.8rem 1rem 0 0; }
.login-card-modal { padding: 1.5rem; }
.login-card-modal h2 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.login-card-modal p { font-size: 0.75rem; margin-bottom: 1rem; }
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.7rem; }
.input-group input {
    width: 100%;
    padding: 0.7rem;
    background: var(--color-gray-light);
    border: 1px solid var(--color-gray-medium);
    border-radius: 10px;
}
.btn-login-modal {
    width: 100%;
    padding: 0.8rem;
    background: black;
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
}
.error-message { margin-top: 0.8rem; padding: 0.5rem; background: #ffebee; color: #f44336; text-align: center; font-size: 0.7rem; border-radius: 8px; }

/* FOOTER */
footer {
    text-align: center;
    padding: 1.2rem;
    background: black;
    color: white;
    font-size: 0.6rem;
    margin-bottom: 55px;
}
.social-links { margin-top: 0.8rem; display: flex; justify-content: center; gap: 1rem; }
.social-link { color: white; text-decoration: none; font-size: 0.7rem; }

.empty-products, .loading { text-align: center; padding: 2rem; color: var(--color-gray); }

/* ==========================================================================
   DESKTOP (PANTALLAS GRANDES)
   ========================================================================== */
@media (min-width: 769px) {
    /* Navbar distribuye enlaces a la derecha */
    .navbar {
        justify-content: space-between;
    }
    .nav-links {
        display: flex;
        gap: 1.5rem;
        align-items: center;
    }

    .bottom-nav { display: none; }
    .products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
    .admin-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
    .steps-grid { grid-template-columns: repeat(4, 1fr); }
    
    /* ─── INFO RECTANGULAR, CARRUSEL CUADRADO Y CENTRADO EN SU MARCO BLANCO ─── */
    .custom-grid { 
        display: flex; 
        flex-direction: row;
        justify-content: center; 
        align-items: stretch; /* Mantiene la misma altura en ambas tarjetas para no arruinar tu cuadrícula */
        gap: 3rem; 
        max-width: 1000px; 
        margin: 0 auto 2rem; 
    }
    
    .custom-info-card {
        flex: 1.2; 
        display: flex;
        flex-direction: column;
        justify-content: center; 
    }

    .custom-carousel-card {
        flex: 1; 
        width: 100%;
        max-width: 400px; 
        /* NUEVO: Convertimos esta tarjeta blanca en un Flexbox para centrar su contenido verticalmente */
        display: flex;
        flex-direction: column;
        justify-content: center; /* Esto reparte el espacio en blanco equitativamente arriba y abajo */
    }

    .carousel-slides-container {
        height: auto; 
        aspect-ratio: 1 / 1; /* Garantiza que la imagen sea un cuadrado perfecto siempre */
        width: 100%;
    }

    .hero { min-height: 85vh; }
    .hero-content h2 { font-size: 3rem; }
    .toast { bottom: 30px; right: 30px; left: auto; transform: none; }
}