/* --- VARIABLES Y RESET --- */
:root {
    --bg-color: #0a0a0a;
    --surface-color: #141414;
    --surface-hover: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #d4af37;
    --border-color: #333333;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* --- HEADER --- */
header {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000; padding: 1rem 0;
}

.nav-container {
    max-width: 1400px; margin: 0 auto; padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
}

/* En estilos.css */

/* Eliminamos estilos de texto anteriores si ya no los usas */
.logo {
    display: flex;
    align-items: center;
}

/* Reglas nuevas para la IMAGEN del logo */
.logo img {
    height: 100px; /* Altura ideal para este header. Ajusta si lo quieres más grande */
    width: auto;  /* Mantiene la proporción para que no se estire */
    object-fit: contain;
    display: block;
}

/* Opcional: Si quieres que el logo brille un poco al pasar el mouse */
.logo img:hover {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.search-box {
    display: flex; align-items: center; background: transparent;
    border-bottom: 1px solid var(--border-color); width: 40%; transition: var(--transition);
}
.search-box:focus-within { border-bottom-color: var(--accent-color); }
.search-box input {
    background: transparent; border: none; color: white; padding: 0.8rem; width: 100%; outline: none; font-family: var(--font-body);
}
.search-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; }

.nav-icons { display: flex; gap: 1.5rem; }
.icon-wrapper { position: relative; cursor: pointer; font-size: 1.2rem; transition: var(--transition); }
.icon-wrapper:hover { color: var(--accent-color); }
.cart-badge {
    position: absolute; top: -5px; right: -8px; background-color: var(--accent-color);
    color: #000; font-size: 0.7rem; font-weight: 700; width: 18px; height: 18px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
}

/* --- LAYOUT --- */
.main-layout {
    display: grid; grid-template-columns: 250px 1fr; gap: 3rem;
    max-width: 1400px; margin: 3rem auto; padding: 0 2rem;
}

aside h3 {
    font-family: var(--font-heading); color: var(--accent-color);
    margin-bottom: 1.5rem; font-size: 1.2rem; letter-spacing: 1px;
}
.filter-list li { margin-bottom: 1rem; }
.filter-list a, .filter-list li {
    color: var(--text-secondary); font-size: 0.95rem; cursor: pointer; display: flex; justify-content: space-between;
}
.filter-list a:hover { color: var(--text-primary); transform: translateX(5px); }
.separator { height: 1px; background: var(--border-color); margin: 2rem 0; }

.hero-text { margin-bottom: 3rem; }
.section-title { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-secondary); font-size: 1.1rem; }

/* --- PRODUCTOS (Grid y Cards) --- */
/* En estilos.css */

.products-grid {
    display: grid; 
    /* 1. Reducimos el tamaño mínimo de 280px a 210px para que quepan más columnas */
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); 
    gap: 1.5rem; /* Reducimos un poco el espacio entre ellas */

    /* 2. Lógica para el Scroll Interno */
    max-height: 75vh;  /* Ocupará máximo el 75% de la altura de la pantalla */
    overflow-y: auto;  /* Activa la barra de desplazamiento si hay muchos productos */
    padding-right: 10px; /* Espacio para que el scroll no tape el contenido */
    padding-bottom: 20px; /* Espacio abajo para que no se corte feo */
}
.product-card {
    background-color: var(--surface-color); border: 1px solid transparent;
    transition: var(--transition); cursor: pointer; position: relative; overflow: hidden;
}
.product-card:hover {
    transform: translateY(-5px); border-color: var(--border-color);
    background-color: var(--surface-hover); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* IMAGEN DE TARJETA (Fix de Lujo) */
/* En estilos.css */

/* IMAGEN DE TARJETA */
.card-image {
    width: 100%; 
    height: 200px; /* CAMBIO: De 300px a 200px para mantener proporción */
    overflow: hidden; 
    background-color: #1a1a1a;
    display: flex; 
    justify-content: center; 
    align-items: center;
}
/* BUSCA ESTO EN TU CSS Y REEMPLÁZALO: */

.card-image img {
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* <--- CAMBIO CLAVE: Antes era 'cover' */
    display: block;
    transition: transform 0.5s ease;
    mix-blend-mode: normal; /* Asegura que los colores se vean bien */
}
.product-card:hover .card-image img { transform: scale(1.1); }

.card-info { padding: 1.5rem; text-align: center; }
.product-card h4 { font-weight: 400; margin-bottom: 0.5rem; font-size: 1.1rem; }
.product-card .price { color: var(--accent-color); font-weight: 600; font-size: 1.1rem; }

.btn-text {
    background: none; border: none; color: var(--text-secondary); font-size: 0.8rem;
    margin-top: 1rem; text-transform: uppercase; letter-spacing: 2px;
    border-bottom: 1px solid transparent; cursor: pointer; padding-bottom: 2px;
}
.product-card:hover .btn-text { border-bottom-color: var(--accent-color); color: white; }

/* --- CARRITO SIDEBAR --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 1001; opacity: 0; visibility: hidden;
    transition: var(--transition);
}
.overlay.active { opacity: 1; visibility: visible; }

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh; /* Ocupa toda la altura */
    background: var(--surface-color);
    z-index: 1002;
    transition: right 0.4s ease;
    border-left: 1px solid var(--border-color);

    /* --- CAMBIO CLAVE: --- */
    display: block;       /* Quitamos flex para que fluya hacia abajo */
    overflow-y: auto;     /* ¡Esto activa la barra para deslizar! */
}

.cart-sidebar.open {
    right: 0;
}
.cart-header {
    /* --- CAMBIO CLAVE: --- */
    position: sticky;     /* Esto hace que el título se quede "pegado" arriba */
    top: 0;               /* Al llegar al tope */
    background: var(--surface-color); /* Fondo para que no se trasluzca lo de atrás */
    z-index: 20;          /* Para que esté por encima de los productos al bajar */
    
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.close-cart { cursor: pointer; font-size: 1.5rem; }
.cart-items {
    padding: 2rem;
    /* --- CAMBIO CLAVE: --- */
    overflow-y: visible;  /* Quitamos el scroll interno viejo */
    height: auto;         /* Que crezca según los productos */
}
.cart-footer { padding: 2rem; background: #111; border-top: 1px solid var(--border-color); }
.cart-total {
    display: flex; justify-content: space-between; font-size: 1.2rem; margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

/* Estilos de los ITEMS del carrito (Faltaban) */
.cart-item {
    display: flex; gap: 15px; margin-bottom: 20px;
    border-bottom: 1px solid #222; padding-bottom: 15px;
}
.cart-item img {
    width: 70px; height: 70px; object-fit: cover; border-radius: 4px;
}
.cart-item-details { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cart-item-title { font-size: 0.9rem; font-weight: 600; color: #fff; }
.cart-item-price { color: var(--accent-color); font-size: 0.9rem; margin: 4px 0; }
.btn-remove {
    background: none; border: none; color: #666; font-size: 0.75rem;
    text-align: left; cursor: pointer; text-decoration: underline;
}
.btn-remove:hover { color: #ff4444; }

/* --- MODAL --- */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85); justify-content: center; align-items: center;
}
/* --- CORRECCIÓN DE TAMAÑO Y SCROLL DEL MODAL --- */
.modal-content {
    background-color: var(--surface-color);
    width: 95%; /* Un poco más ancho en móviles */
    max-width: 1000px;
    /* ESTO ES LO NUEVO PARA QUE DESLICE: */
    max-height: 90vh; /* Que no pase del 90% de la altura de la pantalla */
    overflow-y: auto; /* Activa la barra de desplazamiento si no cabe */
    
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Un pequeño borde redondeado se ve mejor */
}

/* --- ESTILOS PARA EL ZOOM (NUEVO) --- */
.zoom-modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 3000; /* Encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95); /* Fondo negro casi total */
    justify-content: center;
    align-items: center;
    cursor: zoom-out; /* Icono de alejar */
}

.zoom-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomAnimation 0.3s ease;
}

/* Animación suave al abrir */
@keyframes zoomAnimation {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Cambiar cursor en la imagen del producto para indicar que se puede abrir */
#modal-img {
    cursor: zoom-in;
    transition: transform 0.3s;
}
#modal-img:hover {
    opacity: 0.9;
}
.close-btn {
    position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; z-index: 10;
}
.modal-body { display: flex; flex-wrap: wrap; }
.modal-img-container {
    flex: 1; min-width: 300px; min-height: 400px; background: #0f0f0f;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#modal-img {
    width: 100%; height: 100%; object-fit: cover; display: none;
}
.placeholder-stone-large {
    width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7z' fill='%23333' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.modal-details { flex: 1; padding: 3rem; min-width: 300px; }
.product-header h1 { font-family: var(--font-heading); font-size: 2.2rem; margin: 0.5rem 0; }
.main-price { font-size: 2rem; font-weight: 300; }
.unit { font-size: 1rem; color: var(--text-secondary); }
.actions { display: flex; gap: 1rem; margin-bottom: 1.5rem; margin-top: 2rem;}

/* --- BOTONES --- */
.btn-primary, .btn-secondary {
    padding: 1rem 2rem; text-transform: uppercase; font-size: 0.8rem;
    letter-spacing: 2px; cursor: pointer; font-weight: 600; transition: var(--transition); border: none;
}
.btn-primary { background-color: var(--text-primary); color: #000; width: 100%; }
.btn-primary:hover { background-color: var(--accent-color); color: #fff; }
.btn-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--text-primary); }
/*BOTON PARA MOVILES*/
/* BOTÓN DE MENÚ MÓVIL (Por defecto oculto en PC) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
    cursor: pointer;
}

.sidebar-header-mobile {
    display: none; /* Oculto en PC */
}

/* --- ESTILOS RESPONSIVE (MÓVIL) --- */
@media (max-width: 768px) {
    
    /* Mostrar el botón de hamburguesa */
    .mobile-menu-btn { display: block; }
    
    /* Ocultar el buscador si estorba (opcional) */
    .search-box { display: none; } 
    
    .main-layout { grid-template-columns: 1fr; }

    /* TRANSFORMACIÓN DEL ASIDE EN MENÚ DESLIZANTE */
    aside.sidebar-menu {
        display: block; /* ¡Ya no usamos display: none! */
        position: fixed;
        top: 0;
        left: -100%; /* Escondido a la izquierda */
        width: 280px;
        height: 100vh;
        background-color: var(--surface-color);
        z-index: 2000; /* Encima de todo */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        padding: 20px;
        overflow-y: auto;
        border-right: 1px solid var(--border-color);
    }

    /* Clase para cuando está abierto */
    aside.sidebar-menu.active {
        left: 0; /* Aparece */
    }

    /* Cabecera del menú móvil (Botón cerrar) */
    .sidebar-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .close-menu-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }

    /* Ajuste para que el grid de productos ocupe todo */
    main { width: 100%; }
}

/* --- CORRECCIÓN DEL FORMULARIO DE PAGO (DARK MODE) --- */
.checkout-form {
    background-color: #1a1a1a; /* Fondo oscuro */
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

.checkout-form h4 {
    color: var(--accent-color); /* Títulos en dorado */
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* Estilo de los Inputs (Cajitas de texto) */
.checkout-form .input-field {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: white; /* Texto blanco al escribir */
    padding: 12px;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.checkout-form .input-field:focus {
    border-color: var(--accent-color); /* Borde dorado al seleccionar */
    background-color: #333;
}

.checkout-form .input-field::placeholder {
    color: #888; /* Texto de ayuda en gris */
}

/* Estilo de las opciones de pago (Radio buttons) */
.payment-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white; /* Texto visible */
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.payment-options label:hover {
    background-color: #333;
}

.payment-options input[type="radio"] {
    accent-color: var(--accent-color); /* Bolita del selector en dorado */
    transform: scale(1.2);
}

/* LOGIN */

/* --- MODALES DE CUENTA --- */
.small-modal { max-width: 400px; padding: 2rem; }
.auth-container { text-align: center; }
.auth-container h2 { margin-bottom: 1.5rem; color: var(--accent-color); font-family: var(--font-heading); }
.toggle-text { margin-top: 1rem; font-size: 0.85rem; color: #888; cursor: pointer; }
.toggle-text b { color: var(--text-primary); }

/* LISTA DE PEDIDOS */
.orders-list-container { max-height: 400px; overflow-y: auto; }
.order-card {
    background: #1a1a1a; border: 1px solid #333; padding: 15px;
    margin-bottom: 15px; border-radius: 6px;
}
.order-header { display: flex; justify-content: space-between; border-bottom: 1px solid #333; padding-bottom: 8px; margin-bottom: 8px; }
.order-date { color: #888; font-size: 0.8rem; }
.order-status { color: var(--accent-color); font-weight: bold; font-size: 0.8rem; }
.order-items ul { padding-left: 20px; font-size: 0.9rem; color: #ccc; }
.order-total { text-align: right; font-weight: bold; font-size: 1.1rem; margin-top: 10px; color: white; }

/* ESTILOS AUTH GOOGLE */
.divider {
    display: flex; align-items: center; text-align: center; margin: 15px 0; color: #666; font-size: 0.8rem;
}
.divider::before, .divider::after {
    content: ''; flex: 1; border-bottom: 1px solid #333;
}
.divider span { padding: 0 10px; }

.btn-google {
    background-color: #fff; color: #333; border: 1px solid #ccc;
    padding: 10px; border-radius: 4px; cursor: pointer; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: 0.3s;
}
.btn-google:hover { background-color: #f1f1f1; }
.btn-google i { font-size: 1.2rem; color: #DB4437; }

/* --- PERFIL DE USUARIO --- */
.profile-header {
    text-align: center; margin-bottom: 1.5rem;
}
.avatar-circle {
    width: 60px; height: 60px; background-color: var(--surface-hover);
    border-radius: 50%; margin: 0 auto 10px auto; display: flex;
    justify-content: center; align-items: center; font-size: 1.5rem;
    color: var(--accent-color); border: 1px solid var(--border-color);
}
.separator-light {
    border: 0; border-top: 1px solid #333; margin-bottom: 1.5rem;
}

/* Botones del Menú */
.menu-item-btn {
    width: 100%; background-color: transparent; border: 1px solid #333;
    padding: 15px; margin-bottom: 10px; color: white; text-align: left;
    display: flex; align-items: center; cursor: pointer; border-radius: 6px;
    transition: all 0.3s ease; font-family: var(--font-body);
}
.menu-item-btn i { font-size: 1.2rem; margin-right: 15px; color: #888; }
.menu-item-btn .arrow { margin-left: auto; color: #555; }

.menu-item-btn:hover { background-color: #222; border-color: var(--accent-color); }
.menu-item-btn:hover i { color: var(--accent-color); }

/* Botón Cerrar Sesión */
.menu-item-btn.logout { border-color: #522; color: #faa; margin-top: 10px; }
.menu-item-btn.logout:hover { background-color: #311; border-color: #f55; }
.menu-item-btn.logout i { color: #f55; }

/* Sub-Vistas */
.view-title { 
    color: var(--accent-color); font-family: var(--font-heading); 
    margin-bottom: 1rem; text-align: center; 
}
.label-small {
    display: block; font-size: 0.8rem; color: #888; margin-bottom: 5px; margin-top: 10px;
}
.back-btn { margin-top: 1.5rem; }

/* --- NUEVOS ESTILOS AUTH (Mejora Visual) --- */

.auth-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Grupo de input con icono */
.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    font-size: 1.1rem;
    pointer-events: none; /* Para que el click pase al input */
}

.input-field-icon {
    width: 100%;
    padding: 12px 15px 12px 45px; /* Espacio a la izquierda para el icono */
    background-color: #222;
    border: 1px solid #444;
    border-radius: 6px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.input-field-icon:focus {
    border-color: var(--accent-color);
    background-color: #2a2a2a;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.input-field-icon::placeholder {
    color: #666;
}

/* Animación para mostrar campos de registro suavemente */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mensajes de error */
.error-msg {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    padding: 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 15px;
    display: none;
    text-align: left;
}

.link-highlight {
    color: var(--accent-color);
    cursor: pointer;
    text-decoration: underline;
}

/* Estilo para el estado 'Pendiente de envío' en el historial */
.order-status {
    background-color: rgba(212, 175, 55, 0.15); /* Fondo dorado suave */
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- ESTILOS DE VISTA DE DATOS (PREMIUM) --- */

.profile-details-container {
    animation: fadeIn 0.4s ease;
}

.profile-card {
    background: linear-gradient(145deg, #1a1a1a, #141414);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

/* Avatar Grande */
.profile-avatar-large {
    width: 80px;
    height: 80px;
    background-color: rgba(212, 175, 55, 0.1); /* Dorado muy transparente */
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    color: var(--accent-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.profile-card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: white;
    margin-bottom: 5px;
}

.profile-badge {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

/* Grid de datos */
.profile-grid {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.data-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.readonly-input-wrapper {
    position: relative;
    background-color: #0f0f0f;
    border-radius: 6px;
    border: 1px solid #333;
    transition: border-color 0.3s;
}

.readonly-input-wrapper:hover {
    border-color: #555;
}

.readonly-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.1rem;
}

.readonly-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ccc;
    padding: 12px 12px 12px 40px; /* Espacio para el icono */
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    cursor: default; /* Cursor normal, no de texto */
}

/* --- EN estilos.css (Al final) --- */

/* Animación de deslizamiento suave */
.slide-in {
    animation: slideInRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px); /* Empieza un poco a la derecha */
    }
    to {
        opacity: 1;
        transform: translateX(0); /* Termina en su lugar */
    }
}

/* Ajuste para el botón de volver */
.back-btn {
    margin-top: 20px;
    transition: transform 0.2s ease;
}

.back-btn:active {
    transform: scale(0.98); /* Efecto de click al presionar */
}

/* --- ESTILOS DEL MODAL DE INFORMACIÓN --- */
/* --- ESTILOS DEL MODAL DE INFORMACIÓN --- */
.info-modal-content {
    max-width: 800px; 
    padding: 3rem;
    
    /* AGREGA ESTAS 2 LÍNEAS PARA EL SCROLL: */
    max-height: 90vh; /* Que no supere el 90% de la altura de la pantalla */
    overflow-y: auto; /* Si el contenido es más largo, pon barra de scroll */
}
.text-content {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.8;
    margin-top: 1.5rem;
    text-align: left;
}
.text-content p { margin-bottom: 15px; }
.text-content strong { color: var(--accent-color); }

/* Mapa embebido */
.map-container {
    width: 100%;
    height: 300px;
    background: #333;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

/* --- ESTILOS DEL FOOTER (PIE DE PÁGINA) --- */
.site-footer {
    background-color: #050505; /* Más oscuro que el fondo */
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 2rem 1rem 2rem;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}
.footer-section h4 {
    color: var(--accent-color);
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.footer-section p { color: #888; font-size: 0.9rem; max-width: 300px; }

.social-icons { display: flex; gap: 15px; margin-top: 10px; }
.social-icon {
    font-size: 1.5rem; color: white; transition: 0.3s;
}
.social-icon:hover { color: var(--accent-color); transform: translateY(-3px); }

.footer-bottom {
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 2rem;
    padding-top: 1.5rem;
    font-size: 0.8rem;
    color: #555;
}

/* --- ESTILOS PARA LA MUESTRA DE COLOR EN EL MODAL --- */
.sample-container {
    margin-top: 10px;
    background: #000;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sample-img {
    width: 60px;
    height: 60px;
    border-radius: 50%; /* Circular para que parezca una muestra de material */
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.sample-text small {
    display: block;
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.sample-text span {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Estilo del Scroll para el Catálogo */
.products-grid::-webkit-scrollbar {
    width: 8px;
}

.products-grid::-webkit-scrollbar-track {
    background: #111; /* Fondo del riel */
    border-radius: 4px;
}

.products-grid::-webkit-scrollbar-thumb {
    background: #333; /* Color de la barra */
    border-radius: 4px;
    border: 1px solid #1a1a1a;
}

.products-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color); /* Se pone dorada al pasar el mouse */
}

/* --- MEJORAS DEL CARRITO Y CHECKOUT EN MÓVIL --- */

/* 1. Fila para CP y Ciudad (Para que se acomoden bien) */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* El CP ocupa el 35% y la Ciudad el resto */
.input-cp { flex: 0 0 35%; } 
.input-city { flex: 1; }

/* 2. Ajustes para pantallas pequeñas (Celulares) */
@media (max-width: 480px) {
    
    /* Que el carrito ocupe TODA la pantalla, no solo 400px */
    .cart-sidebar {
        width: 100%; 
        right: -100%; /* Se esconde totalmente a la derecha */
    }
    
    .cart-sidebar.open {
        right: 0;
    }

    /* Hacemos los textos del resumen un poco más pequeños */
    .summary-row { font-size: 0.85rem; }
    .summary-row.total { font-size: 1.1rem; }

    /* Ajuste del formulario */
    .checkout-form {
        padding: 15px; /* Menos relleno para ganar espacio */
        background-color: #1a1a1a; 
    }
    
    .checkout-form input {
        font-size: 16px; /* Evita que el iPhone haga zoom al escribir */
        padding: 12px;
    }
}
/* --- ARREGLO DEL MODAL DE PRODUCTO EN MÓVIL --- */
@media (max-width: 768px) {
    
    /* 1. Hacemos la imagen más bajita para que no estorbe */
    .modal-img-container {
        min-height: 250px; /* Bajamos de 400px a 250px */
        max-height: 300px; /* Tope máximo */
        width: 100%;
    }

    /* 2. Reducimos el relleno (padding) de los textos */
    .modal-details {
        padding: 1.5rem; /* En PC es 3rem, aquí lo reducimos a la mitad */
        min-width: auto;
    }

    /* 3. Ajustamos el título para que no ocupe tanto espacio */
    .product-header h1 {
        font-size: 1.5rem; /* Un poco más pequeño */
        margin-top: 0;
    }

    /* 4. El precio también un poco más chico */
    .main-price {
        font-size: 1.8rem;
    }

    /* 5. Acomodamos los botones de acción para que estén juntos */
    .actions {
        flex-direction: column; /* Uno arriba del otro es más fácil de tocar */
        gap: 10px;
        margin-top: 1rem;
    }
    
    /* 6. Ajuste del contenedor de variantes (Colores y Platos) */
    #modal-variants > div {
        padding: 10px !important; /* Menos espacio interno */
    }
}
/* --- ESTILOS EXTRA FORMULARIO --- */
textarea.input-field {
    font-family: var(--font-body);
    background-color: #2a2a2a; /* Mismo fondo que inputs */
}

/* Para que los inputs se vean bien en la fila dividida */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
/* En móviles, que se apilen si es muy estrecho, opcional pero recomendado */
@media (max-width: 400px) {
    .form-row { flex-direction: column; gap: 0; }
    .form-row input { margin-bottom: 10px; }
}

/* --- ESTILOS ZOOM (Asegurando que funcione) --- */
#modal-img {
    cursor: zoom-in; /* Icono de lupa */
    transition: transform 0.3s ease;
}
#modal-img:hover {
    transform: scale(1.02); /* Pequeño efecto al pasar el mouse */
}

/* Contenedor del zoom */
.zoom-modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 3000; /* Encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    cursor: zoom-out; /* Icono de lupa menos */
}

.zoom-content {
    max-width: 95vw;  /* Máximo ancho de pantalla */
    max-height: 95vh; /* Máxima altura de pantalla */
    object-fit: contain; /* Ajustar sin recortar */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    transition: transform 0.2s ease;
}
/* ========================================= */
/* === FIX ESTÉTICO PERFIL (FONDO OSCURO) === */
/* ========================================= */

/* 1. Forzamos que los inputs sean transparentes para tomar el color del contenedor */
#input-profile-name,
#input-profile-phone {
    background-color: transparent !important;
    color: #fff !important; /* Texto blanco brillante */
    font-weight: 500;
}

/* 2. TRUCO PARA EL AUTOCOMPLETADO (Evita el fondo blanco/azul de Chrome) */
/* Esto "engaña" al navegador pintando una sombra interior del color de tu fondo (#0f0f0f) */
.readonly-input-wrapper input:-webkit-autofill,
.readonly-input-wrapper input:-webkit-autofill:hover, 
.readonly-input-wrapper input:-webkit-autofill:focus, 
.readonly-input-wrapper input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f0f0f inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: white; /* El cursor que parpadea también blanco */
}

/* 3. Estilo cuando haces clic (Focus) */
.readonly-input-wrapper:focus-within {
    border-color: var(--accent-color); /* Borde dorado */
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); /* Resplandor suave */
}