/* =================================================================
   MAIN STYLE SHEET - CHIKY SPORT (PRO V5 - FINAL FIXES)
   ================================================================= */

/* --- Variables y Estilo Global --- */
:root {
    --primary-color: #007bff; --secondary-color: #343a40; --accent-color: #28a745;
    --background-color: #f8f9fa; --text-color: #212529; --light-gray: #6c757d;
    --white-color: #ffffff; --border-color: #e9ecef; --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-strong: 0 8px 25px rgba(0, 0, 0, 0.1); --border-radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', sans-serif; background-color: var(--background-color); color: var(--text-color); line-height: 1.6; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* --- Header y Logo --- */
.site-header { background-color: var(--white-color); padding: 1rem 0; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo img { max-height: 45px; width: auto; }
.cart-fab { position: relative; cursor: pointer; font-size: 1.5rem; color: var(--secondary-color); }
.cart-count { position: absolute; top: -8px; right: -8px; background-color: var(--primary-color); color: var(--white-color); border-radius: 50%; width: 20px; height: 20px; font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--white-color); }

/* --- Catálogo y Tarjetas de Producto --- */
.catalogo > h2 { text-align: center; font-size: 2rem; font-weight: 600; margin: 2rem 0; }
.productos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.producto-card { background-color: var(--white-color); border-radius: var(--border-radius); box-shadow: var(--shadow-subtle); display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.producto-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-strong); }
.producto-imagen-wrapper { position: relative; overflow: hidden; aspect-ratio: 1 / 1; cursor: pointer; }
.image-slider { display: flex; height: 100%; transition: transform 0.4s ease-in-out; }
.slide-image { width: 100%; height: 100%; flex-shrink: 0; object-fit: cover; }

/* --- Colores y Nombres --- */
.color-selector { display: flex; gap: 0.75rem; padding: 1rem 1.5rem 0.5rem; justify-content: center; }
.color-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid var(--border-color); transition: all 0.2s; background-size: cover; background-position: center; }
.color-swatch.active { border-color: var(--primary-color); transform: scale(1.15); }
.color-name-display { text-align: center; font-size: 0.85rem; color: var(--light-gray); height: 20px; /* Evita que el layout salte */ }

/* --- Info y Formulario --- */
.producto-info { padding: 0 1.5rem 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.producto-nombre { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; text-align: center; }
.opciones-form { margin-top: auto; }
.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-group { flex: 1; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--light-gray); }
.select-talla, .select-cantidad { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--white-color); }
.precio-display { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; text-align: center; color: var(--text-color); }

/* --- Botón "Realiza Pedido" Animado --- */
.btn-realizar-pedido {
    width: 100%; padding: 0.9rem; border: none; font-size: 1rem; font-weight: 700;
    border-radius: 8px; cursor: pointer; color: var(--white-color);
    background: linear-gradient(45deg, #fd7e14, #ff5722); /* Gradiente llamativo */
    box-shadow: 0 4px 15px rgba(253, 126, 20, 0.4);
    transition: all 0.3s ease;
    animation: pulse-animation 2s infinite; /* Animación infinita */
}
.btn-realizar-pedido:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(253, 126, 20, 0.6); }

@keyframes pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* --- Modal de Zoom --- */
.image-zoom-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.85);
    animation: fadeIn 0.3s;
}
.zoom-content { margin: auto; display: block; max-width: 90%; max-height: 90%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.zoom-close-btn {
    position: absolute; top: 15px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.zoom-close-btn:hover { color: #bbb; }
@keyframes fadeIn { from {opacity: 0} to {opacity: 1} }

/* El resto del CSS (modal del carrito, footer, etc.) se mantiene */
.modal-overlay, .cart-modal, .site-footer { /* ... estilos previos ... */ }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1500; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.cart-modal { position: fixed; top: 0; right: 0; width: 100%; max-width: 380px; height: 100%; background-color: var(--white-color); box-shadow: -5px 0 15px rgba(0,0,0,0.2); z-index: 2000; transform: translateX(100%); transition: transform 0.4s ease-in-out; display: flex; flex-direction: column; }
.cart-modal.open { transform: translateX(0); }
.cart-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 { font-size: 1.2rem; font-weight: 600; }
.close-cart-btn { border: none; background: none; font-size: 1.5rem; cursor: pointer; color: var(--light-gray); }
.cart-body { flex-grow: 1; overflow-y: auto; padding: 1.5rem; }
.cart-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.cart-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--border-radius); }
.cart-item-info { flex-grow: 1; display: flex; flex-direction: column; }
.cart-item-info h4 { font-size: 0.95rem; font-weight: 600; }
.cart-item-info p { font-size: 0.85rem; color: var(--light-gray); margin-bottom: auto; }
.cart-item-info strong { color: var(--text-color); }
.remove-item-btn { background: none; border: none; color: var(--primary-color); cursor: pointer; font-size: 0.8rem; text-decoration: underline; padding: 0; align-self: flex-start; }
.cart-footer { padding: 1.5rem; border-top: 1px solid var(--border-color); background: var(--background-color); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.btn-checkout { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 1rem; background-color: var(--accent-color); color: var(--white-color); text-align: center; text-decoration: none; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-checkout:disabled { background-color: #aaa; cursor: not-allowed; }
.cart-empty-msg { text-align: center; padding: 3rem 1rem; color: var(--light-gray); }
.site-footer { background-color: #e9ecef; color: var(--light-gray); text-align: center; padding: 2rem 0; margin-top: 3rem; font-size: 0.9rem; }
/* --- 8. Estilos para el Mensaje de Ahorro --- */
.ahorro-display {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color); /* Verde para indicar ahorro */
    background-color: #e9f7ef; /* Un fondo verde muy claro */
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    margin: -0.5rem auto 1rem; /* Margen negativo para acercarlo al precio */
    max-width: 90%;
    
    /* Efectos de transición para aparecer suavemente */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
}

.ahorro-display.visible {
    opacity: 1;
    transform: translateY(0);
    height: auto; /* La altura se ajusta al contenido */
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.ahorro-display i {
    margin-right: 5px;
}
.cart-savings {
    text-align: center; font-weight: 600; color: var(--accent-color);
    background-color: #e9f7ef; padding: 10px; border-radius: 8px; margin-bottom: 1rem;
}