/* =========================================
   REGLAS GLOBALES Y BODY
   ========================================= */

/* 1. Le decimos a TODOS los elementos que el padding se calcule hacia adentro */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 2. Bloqueamos el HTML para evitar scroll lateral */
html {
    overflow-x: hidden;
    width: 100%;
}

/* 3. Tu Body (Fusionado con Flexbox y Anti-scroll) */
body { 
    margin: 0; 
    background: #1a2831; 
    font-family: sans-serif; 
    padding-top: 100px; /* Mantenemos tu espacio para el Navbar */
    
    /* Bloqueo estricto anti-scroll fantasma */
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    
    /* Convertimos el body en una columna flexible (Para el footer abajo) */
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

/* --- NAVEGACIÓN PC --- */
.navbar { position: fixed; top: 0; left: 0; width: 100%; background-color: #0f141a; display: flex; justify-content: center; padding: 15px 0; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: all 0.3s ease; }
.nav-container { width: 95vw; max-width: 1400px; display: flex; justify-content: space-between; align-items: center; }
.logo-img { height: 40px; width: auto; display: block; transition: transform 0.3s ease; cursor: pointer; }
.logo-img:hover { transform: scale(1.1); }
.nav-links { list-style: none; display: flex; gap: 20px; align-items: center; margin: 0; padding: 0; }
/* --- LÍNEA AZUL PARA EL NAVBAR --- */
.navbar { 
    /* ... tus estilos actuales ... */
    border-bottom: 3px solid #007aff; /* Misma línea que el footer */
}

/* =====================
   BARRA DE NAVEGACIÓN
   ===================== */
.nav-links a,
.nav-links .search-btn {
    text-decoration: none;
    color: #FFF;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.3s;
}

/* EFECTO DE COLOR AZUL AL PASAR EL RATÓN PARA ENLACES Y BOTONES */
.nav-links a:hover,
.nav-links .search-btn:hover { color: #007aff; }

/* DEFINICIÓN DE LA LÍNEA AZUL DE SUBRAYADO */
.nav-links a::after,
.nav-links .search-btn::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0; /* Inicialmente ancho 0 */
    height: 2px;
    background-color: #007aff;
    transition: width 0.3s ease;
}

/* EFECTO DE ANIMACIÓN DE SUBRAYADO AL PASAR EL RATÓN */
.nav-links a:hover::after,
.nav-links .search-btn:hover::after { width: 100%; }

/* ESTILOS PARA LOS ICONOS SVG - BARRA DE NAVEGACION */
/* ICONOS (Formas: BUSCADOR, NOTIFICACION, CARRITO, USUARIO) */
.icon {
    width: 24px;
    height: 24px;
    stroke: #FFF;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease; /* Transición suave original */
}

/* Efecto Hover para iconos de líneas */
.nav-links a:hover .icon,
.nav-links .search-btn:hover .icon { 
    stroke: #007aff; 
}

/* ICONOS (Formas: Inicio, Productos, Pedidos) */
.nav-icon {
    width: 22px !important;
    height: 22px !important;
    display: none !important; /* Ocultos en PC por defecto */
    color: #FFF !important;   /* Usamos 'color' para heredar el blanco */
    transition: all 0.3s ease;
}

/* Obligamos al SVG a rellenarse con el color indicado arriba */
.nav-icon path, 
.nav-icon g, 
.nav-icon circle {
    fill: currentColor !important;
    stroke: none !important; /* Aseguramos que no tengan bordes raros */
}


/* =========================================
   3. ADAPTACIÓN PARA MÓVILES (Menú Inferior)
   ========================================= */
@media (max-width: 768px) {
    /* Ocultamos los textos "Inicio", "Productos", etc. */
    .nav-text {
        display: none !important;
    }

    /* Mostramos los nuevos iconos centrados */
    .nav-icon {
        display: block !important;
        margin: 0 auto;
    }

    /* Efecto Hover/Touch para los nuevos iconos (mismo azul #007aff) */
    .nav-links a:hover .nav-icon,
    .nav-links a:active .nav-icon {
        color: #007aff !important; 
        transform: scale(1.1); /* Pequeño salto al tocar */
    }
}

/* --- BUSCADOR --- */
.search-container { display: flex; align-items: center; }
#search-input { width: 0; opacity: 0; border: none; background: #233b47; color: #FFF; border-radius: 20px; padding: 0; height: 30px; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); outline: none; }

/* --- NAVEGACIÓN MÓVIL: AJUSTE DE PRECISIÓN --- */
@media (max-width: 768px) {
    .navbar {
        width: 95% !important; 
        padding: 10px 12px !important; /* Reducimos padding para ganar espacio */
        box-sizing: border-box !important;
    }

    /* VITAL: Esto mantiene tus iconos alineados de lado a lado */
    .nav-links {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 2px !important; /* Espacio mínimo entre elementos */
    }

    /* Evita que un icono o el buscador rompa la barra */
    .nav-links li {
        flex: 0 1 auto !important; 
        min-width: 0 !important;
    }

    /* --- LÓGICA DEL BUSCADOR (Intacta) --- */
    .search-container {
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
    }

    #search-input {
        width: 0 !important;
        opacity: 0 !important;
        transition: all 0.3s ease !important;
    }

    /* El límite perfecto para que el buscador no empuje el icono de Usuario */
    .navbar.search-expanded #search-input {
        width: 70px !important; 
        opacity: 1 !important;
        padding: 0 8px !important;
        background: #233b47 !important;
        border-radius: 15px !important;
    }
}

/* ==========
   SLIDER 3D
   ========== */
#slider-wrapper { position: relative; width: 95vw; max-width: 1030px; margin: 20px auto; display: flex; flex-direction: column; align-items: center; }
#slider { position: relative; width: 100%; aspect-ratio: 2.5 / 1; perspective: 2000px; transform-style: preserve-3d; }
input[type=radio] { display: none; }
#slider label { position: absolute; width: 100%; height: 100%; border-radius: 12px; cursor: pointer; transition: transform .5s cubic-bezier(0.2, 0.8, 0.2, 1), filter .5s, box-shadow .5s; background-size: cover; background-position: center; overflow: hidden; }

#s1:checked ~ #slide1, #s2:checked ~ #slide2, #s3:checked ~ #slide3, #s4:checked ~ #slide4, #s5:checked ~ #slide5 { transform: translate3d(0,0,0) scale(1); z-index: 10; filter: brightness(1) grayscale(0%); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
#s1:checked ~ #slide2, #s2:checked ~ #slide3, #s3:checked ~ #slide4, #s4:checked ~ #slide5, #s5:checked ~ #slide1 { transform: translate3d(25%,0,-200px); z-index: 9; filter: brightness(1) grayscale(100%); }
#s1:checked ~ #slide3, #s2:checked ~ #slide4, #s3:checked ~ #slide5, #s4:checked ~ #slide1, #s5:checked ~ #slide2 { transform: translate3d(45%,0,-400px); z-index: 8; filter: brightness(1) grayscale(100%); }
#s1:checked ~ #slide5, #s2:checked ~ #slide1, #s3:checked ~ #slide2, #s4:checked ~ #slide3, #s5:checked ~ #slide4 { transform: translate3d(-25%,0,-200px); z-index: 9; filter: brightness(1) grayscale(100%); }
#s1:checked ~ #slide4, #s2:checked ~ #slide5, #s3:checked ~ #slide1, #s4:checked ~ #slide2, #s5:checked ~ #slide3 { transform: translate3d(-45%,0,-400px); z-index: 8; filter: brightness(1) grayscale(100%); }

.controls { display: flex; justify-content: center; gap: 15px; margin-top: 30px; }
.dot { width: 12px; height: 12px; background-color: #5d7a87; border-radius: 50%; cursor: pointer; }
.dot.active { background-color: #007aff; }

/* --- SECCIONES --- */
.ofertas-titulo-section { width: 95vw; max-width: 1400px; margin: 40px auto 20px auto; color: #FFF; }
.ofertas-titulo-section h2 { margin: 0; font-size: 24px; letter-spacing: 0.5px; }
.ofertas-titulo-section p { margin: 5px 0 0 0; font-size: 14px; color: #007aff; }
.ofertas-grid { width: 95vw; max-width: 1400px; margin: 0 auto 40px auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.oferta-card { background: #0f141a; border: 1px solid #233b47; border-radius: 7px; overflow: visible; display: flex; flex-direction: column; transition: transform 0.2s; margin-top: 25px; }
.oferta-card:hover { transform: translateY(-5px); border-color: #007aff; }
.card-top { background: linear-gradient(90deg, #1e5799 0%, #2989d8 100%); padding: 12px; display: flex; align-items: flex-start; gap: 12px; color: white; border-radius: 7px 7px 0 0; }
.card-top img { width: 50px; height: 50px; border-radius: 7px; background: #eee; margin-top: -25px; border: 1px solid #0f141a; }
.card-text strong { display: block; font-size: 13px; }
.card-text span { font-size: 11px; opacity: 0.9; }
.card-bottom { padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; }
.promocion-tag { background: #ffb400; color: #000; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: bold; }
.descuento-text { color: white; font-size: 13px; font-weight: bold; }

.recientes-grid { width: 95vw; max-width: 1400px; margin: 0 auto 40px auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 15px; }
.reciente-card { width: 100%; height: 260px; background: #0f141a; border-radius: 12px; overflow: hidden; transition: transform 0.2s; border: 1px solid #233b47; display: flex; flex-direction: column; }
.reciente-card:hover { transform: translateY(-5px); border-color: #007aff; }
.reciente-img { width: 100%; height: 140px; background-size: cover; background-position: center; background-color: #233b47; }
.reciente-info { padding: 10px; color: #fff; flex-grow: 1; display: flex; flex-direction: column; }
.reciente-info h3 { margin: 0 0 5px 0; font-size: 14px; }
.reciente-info p { margin: 0 0 10px 0; font-size: 11px; opacity: 0.7; }

/* =======================================
   TAGS DE PRODUCTOS - CATEGORIA Y REGION
   ======================================= */
/* --- FILA DE TAGS OPTIMIZADA --- */
.tags-row {
    display: flex;
    justify-content: space-between; 
    gap: 0; 
    margin-top: auto;
    width: 100%;
}

/* --- ESTILO BASE PARA LOS TAGS --- */
.tag { 
    font-size: 9px; 
    padding: 3px 6px; 
    border-radius: 4px; 
    color: #fff; 
    font-weight: bold; 
}

/* --- COLORES ESPECÍFICOS PARA TAGS --- */
.tag-tipo {
    background-color: #f39c12; /* Naranja Code Store */
}

.tag-region {
    background-color: #007aff; /* Azul Code Store */
}

/* --- RESPONSIVO --- */
@media (max-width: 992px) { .ofertas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    body { padding-top: 10px; padding-bottom: 90px; }
    .navbar { position: fixed; bottom: 15px; top: auto; left: 50%; transform: translateX(-50%); width: 92%; border-radius: 30px; padding: 12px 15px; background-color: #0f141a; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
    .logo-img { display: none; }
    .nav-links { width: 100%; justify-content: space-between; }
    .nav-links a { font-size: 9px; font-weight: bold; flex-direction: column; align-items: center; gap: 4px; color: #FFF; }
    #slider label { transform: translate3d(0,0,0) scale(1) !important; z-index: 1; filter: brightness(1) grayscale(0%) !important; box-shadow: 0 5px 10px rgba(0,0,0,0.15) !important; }
    .ofertas-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .recientes-grid { justify-content: center; grid-template-columns: repeat(2, 1fr); }
}

/* =======================
   FOOTER - PIE DE PAGINA
   ======================= */
/* --- FOOTER GENERAL --- */
.footer { background: #000; color: #fff; padding: 60px 20px 20px; margin-top: 50px; border-top: 3px solid #007aff;
        /* NUEVO: Esto empuja el footer hacia el fondo usando todo el espacio vacío disponible */
        margin-top: auto;
        }
.footer-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width: 1400px; margin: 0 auto; }
.footer-col h3 { font-size: 18px; margin-bottom: 20px; color: #007aff; }
.footer-col p, .footer-col ul { color: #ccc; font-size: 14px; list-style: none; padding: 0; line-height: 1.6; }
.footer-col li { margin-bottom: 8px; cursor: pointer; transition: color 0.3s; }
.footer-col li:hover { color: #007aff; }
.footer-bottom { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid #333; font-size: 12px; color: #666; }

/* --- ESTILO REDES SOCIALES --- */
.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px 10px;
    margin-top: 15px;
    justify-items: center;
}

.social-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #ccc;
    font-size: 11px;
    text-align: center;
    transition: transform 0.2s, color 0.3s;
}

.social-grid a:hover {
    transform: translateY(-3px);
    color: #007aff;
}

.social-grid a img {
    width: 32px;
    height: 32px;
    margin-bottom: 6px;
    transition: transform 0.3s;
}

.social-grid a:hover img {
    transform: scale(1.15);
}

/* --- RESPONSIVO --- */
@media (max-width: 992px) { .footer-container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { 
    .footer-container { grid-template-columns: 1fr; } 
    .social-grid { gap: 20px; }
}

/* ====================================
   ESTILOS DE LA VENTANA MODAL (LOGIN)
   ==================================== */
.modal {
    display: none; /* Se activa con JS */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1a2632;
    width: 90%;
    max-width: 420px;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #2d3d4d;
    position: relative;
    text-align: center;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- BOTÓN DE CIERRE PERSONALIZADO (SVG) --- */
.close-button {
    position: absolute;
    top: 22px;        /* Un poco más abajo para el Samsung */
    right: 25px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;    /* Área táctil extra grande para móviles */
    margin: -12px;    /* Compensa el padding para no mover la posición visual */
}

.close-icon-svg {
    width: 22px;      /* Tamaño equilibrado */
    height: 22px;
    color: #64748b;   /* Mismo color que tus otros iconos */
    transition: all 0.3s ease;
}

/* --- EFECTOS INTERACTIVOS --- */
.close-button:hover .close-icon-svg {
    color: #e8031b;   /* Rojo suave al pasar el mouse */
    transform: rotate(90deg) scale(1.1); /* Efecto de giro y zoom */
}

.close-button:active .close-icon-svg {
    color: #e8031b;   /* Rojo más intenso al presionar con el dedo */
    transform: scale(0.9); /* Efecto de "pulsado" en móvil */
}

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    color: #a0aab4;
    font-size: 14px;
    margin-bottom: 30px;
}

.input-container {
    width: 100%;
    margin-bottom: 15px;
}

.input-container input {
    width: 100%;
    padding: 14px 15px;
    background-color: transparent;
    border: 1px solid #3d4d5d;
    border-radius: 8px;
    color: white;
    box-sizing: border-box;
    outline: none;
}

.input-container input:focus {
    border-color: #007aff;
}

.forgot-link {
    display: block;
    text-align: right;
    color: #007aff;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 25px;
}

.password-box {
    position: relative;
    display: flex;
    align-items: center;
}

/* --- CAJA DE CONTRASEÑA Y OJO  --- */
.password-box {
    position: relative !important;
    display: block !important;
}

.password-box input {
    margin-bottom: 0 !important;
    padding-right: 45px !important; 
}

/* --- ICONO DEL OJO (REVISADO) --- */
#signup-modal .eye-icon,
#login-modal .eye-icon,
#forgot-password-modal .eye-icon {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important; /* Centrado vertical exacto */
    cursor: pointer;
    color: #64748b;
    width: 20px;
    height: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

#signup-modal .eye-icon:hover { color: #007aff; }

.eye-icon svg {
    width: 100%;
    height: 100%;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background-color: #0056b3;
}

.register-text {
    font-size: 14px;
    margin-top: 20px;
    color: #fff;
}

.register-text a {
    color: #007aff;
    text-decoration: none;
}

/* Divisor con líneas */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #888;
    font-size: 13px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #3d4d5d;
}

.divider span {
    padding: 0 10px;
}

/* Botón Google */
.btn-google {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    border: 1px solid #3d4d5d;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-google:hover {
    background-color: #233b47;
}

.btn-google img {
    width: 20px;
}

/* ====================================
   ESTILOS DE LA VENTANA MODAL (REGISTRO)
   ==================================== */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1a2632;
    width: 95%;
    max-width: 420px;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #2d3d4d;
    position: relative;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

/* --- INPUTS Y CAMPOS DE TEXTO --- */
.input-container input, 
.input-container-row input {
    width: 100%;
    padding: 12px;
    background-color: #0d161f !important;
    border: 1px solid #3d4d5d;
    border-radius: 8px;
    color: white !important;
    outline: none;
    margin-bottom: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Contenedor para poner dos inputs en una fila */
.row-inputs {
    display: flex;
    gap: 10px;       /* Espacio entre Nombre y Apellidos */
    width: 100%;
    margin-bottom: 12px; /* Espacio con el siguiente campo (Celular) */
}

/* Ajustamos para que cada uno ocupe el 50% */
.row-inputs .input-container {
    flex: 1;         /* Esto hace que ambos midan lo mismo */
    margin-bottom: 0 !important; /* Quitamos el margen inferior individual para que no se desfase */
}

/* Ajuste opcional para los inputs dentro de la fila */
.row-inputs input {
    width: 100%;
    box-sizing: border-box;
}

.input-container input:focus,
.input-container-row input:focus { 
    border-color: #007aff; 
}

/* --- FILAS ESPECIALES (TELÉFONO Y VERIFICACIÓN) --- */
.input-container-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 10px; 
    align-items: center;
}

/* CORRECCIÓN PARA QUE NO SE DEFORME LA VERIFICACIÓN */
.verification-row {
    display: flex;
    flex-wrap: wrap; /* Permite que el texto baje */
    gap: 10px;
    align-items: center;
}

.verification-row input {
    flex: 1; /* El input toma el espacio restante */
    margin-bottom: 0 !important; /* Alineado con el botón */
}

/* Texto informativo debajo de la caja de verificación */
.small-info {
    width: 100%;
    /* Limitamos el ancho para que coincida con el recuadro de arriba */
    max-width: 207px; 
    
    font-size: 12px;
    color: #a0aab4;
    text-align: left;
    margin-top: -5px;
    margin-bottom: 10px;
    
    /* Esto mejora el salto de línea */
    line-height: 1.3;
    display: block;
}

.country-prefix {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #0d161f;
    border: 1px solid #3d4d5d;
    border-radius: 8px;
    padding: 0 10px;
    height: 45px;
    color: white;
    font-size: 14px;
}

/* --- ICONO DEL OJO --- */
.eye-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-80%);
    cursor: pointer;
    color: #64748b;
    width: 20px;
    transition: color 0.3s;
}

.eye-icon:hover { color: #007aff; }

/* --- BOTONES AZULES UNIFICADOS --- */
.btn-login, 
.btn-signup, 
.btn-secondary {
    background-color: #007aff !important; 
    color: #fff !important;
    border: none !important;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease !important;
    box-shadow: none !important; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary {
    padding: 0 15px;
    font-size: 13px;
    height: 45px;
    white-space: nowrap;
}

.btn-signup, .btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
}

.btn-login:hover, 
.btn-signup:hover, 
.btn-secondary:hover {
    background-color: #0056b3 !important; 
}

/* --- ENLACES --- */
.forgot-link, 
.register-text a, 
.login-text a, 
.checkbox-container a {
    color: #007aff !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 13px;
    transition: color 0.3s ease;
}

.forgot-link {
    width: 100%;
    text-align: right;
    margin-bottom: 15px;
}

.forgot-link:hover, 
.register-text a:hover, 
.login-text a:hover, 
.checkbox-container a:hover {
    text-decoration: underline !important;
}

/* --- CHECKBOX --- */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 15px 0;
}

.checkbox-container input {
    margin-top: 3px;
}

.checkbox-container label {
    font-size: 12px;
    line-height: 1.4;
    color: #a0aab4;
}

/* Ajuste optimizado para el modal de recuperar contraseña */
#forgot-password-modal .btn-login {
    margin-top: 15px; /* Reducido de 25px para que sea consistente */
    font-size: 16px;  /* Igualamos a los otros botones principales */
}

#forgot-password-modal .subtitle {
    margin-bottom: 20px;
    font-size: 14px;
    color: #a0aab4;
}

/* --- AJUSTES PARA EL SELECTOR INTERNACIONAL DE TELÉFONO (MODO OSCURO) --- */
/* --- SELECTOR INTERNACIONAL: SOLUCIÓN FINAL --- */
.iti { 
    width: 100%; 
    display: block; 
}

/* Estilos de la lista (Colores y scroll) */
.iti__country-list {
    background-color: #1a2632 !important;
    border: 1px solid #3d4d5d !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    padding: 0 !important;
}

.iti__country-name, .iti__dial-code { color: #ffffff !important; }
.iti__country:hover { background-color: #007aff !important; }

/* --- AJUSTE DE PRECISIÓN DEFINITIVO --- */
@media (min-width: 769px) {
    .iti--container {
        z-index: 999999 !important;
        position: fixed !important;
        top: 36% !important; 
        /* El valor ganador para tu resolución de pantalla */
        left: 48.9% !important; 
        transform: translate(-50%, 82px) !important; 
        width: 300px !important;
    }
}

/* --- POSICIONAMIENTO UNIFICADO PARA LA LISTA DE PAÍSES --- */
@media (max-width: 768px) {
    /* Forzamos que la lista se pegue al input, ignorando cálculos variables del navegador */
    .iti--container {
        z-index: 999999 !important;
        position: fixed !important;
        /* En lugar de usar porcentajes variables, usamos un ajuste más natural */
        top: 37.5% !important; 
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 78% !important; 
        max-width: 320px !important;
        /* Subimos un poco la lista para que el 'gap' sea constante */
        margin-top: -2px !important; 
    }
}

/* Forzar que el modal no estorbe */
#signup-modal { z-index: 2000 !important; }

/* --- SCROLL TIPO MÓVIL (MINIMALISTA) PARA LA LISTA --- */
/* 1. Hacemos la barra mucho más delgada (4px) */
.iti__country-list::-webkit-scrollbar {
    width: 4px !important;
    background-color: transparent;
}

/* 2. La "manija" será una barrita gris sutil, redondeada como en el celular */
.iti__country-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2) !important; /* Blanco con transparencia */
    border-radius: 10px !important;
}

/* 3. Al pasar el mouse, se nota un poco más (como cuando haces scroll en el celular) */
.iti__country-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4) !important;
}

/* Ajuste para que la lista no se vea apretada con la barrita */
.iti__country-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding-right: 2px !important; /* Espacio para que el scroll no toque el texto */
}

/* --- ESTILO PARA EL INPUT DE FECHA Y EL NUEVO ICONO SVG --- */
input[type="date"] {
    position: relative !important;
    z-index: 1 !important;
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
    
    /* Color de fondo y borde idéntico a los otros inputs */
    background-color: #0d161f !important; 
    border: 1px solid #3d4d5d !important;
    border-radius: 8px !important;
    padding: 12px !important;
    color: white !important;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;

    /* Icono SVG Azul (Siempre visible, no solo en focus) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='%23007aff'%3E%3Crect height='6' rx='2' width='4' x='11' y='3'%3E%3C/rect%3E%3Crect height='6' rx='2' width='4' x='33' y='3'%3E%3C/rect%3E%3Cpath d='m4 18v23c0 2.209 1.791 4 4 4h32c2.209 0 4-1.791 4-4v-23zm12 20c0 1.105-.895 2-2 2h-2c-1.105 0-2-.895-2-2v-2c0-1.105.895-2 2-2h2c1.105 0 2 .895 2 2zm0-11c0 1.105-.895 2-2 2h-2c-1.105 0-2-.895-2-2v-2c0-1.105.895-2 2-2h2c1.105 0 2 .895 2 2zm11 11c0 1.105-.895 2-2 2h-2c-1.105 0-2-.895-2-2v-2c0-1.105.895-2 2-2h2c1.105 0 2 .895 2 2zm0-11c0 1.105-.895 2-2 2h-2c-1.105 0-2-.895-2-2v-2c0-1.105.895-2 2-2h2c1.105 0 2 .895 2 2zm11 11c0 1.105-.895 2-2 2h-2c-1.105 0-2-.895-2-2v-2c0-1.105.895-2 2-2h2c1.105 0 2 .895 2 2zm0-11c0 1.105-.895 2-2 2h-2c-1.105 0-2-.895-2-2v-2c0-1.105.895-2 2-2h2c1.105 0 2 .895 2 2z'%3E%3C/path%3E%3Cpath d='m44 16v-6c0-2.209-1.791-4-4-4h-1v1c0 2.206-1.794 4-4 4s-4-1.794-4-4v-1h-14v1c0 2.206-1.794 4-4 4s-4-1.794-4-4v-1h-1c-2.209 0-4 1.791-4 4v6z'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 20px !important;
    padding-right: 40px !important;
}

/* Color del texto dd/mm/aaaa tenue */
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: rgba(255, 255, 255, 0.5);
}

/* Cambio de borde al hacer clic */
input[type="date"]:focus {
    border-color: #007aff !important;
}

/* Área de clic para abrir el calendario */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: none;
    color: transparent;
    cursor: pointer;
    width: 40px !important; 
    height: 100% !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    z-index: 2 !important; 
}

/* --- ESTADO DESACTIVADO PARA VALIDACIÓN --- */
.btn-signup:disabled {
    background-color: #3d4d5d !important; /* Gris oscuro cuando no se puede clicar */
    opacity: 0.6;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Efecto cuando el botón está ACTIVO */
.btn-signup:not(:disabled):hover {
    background-color: #0056b3 !important;
    transform: translateY(-2px);
}

#registro-fecha {
    width: 100% !important;
    box-sizing: border-box;
}

/* Resaltar el campo de código cuando está vacío pero el resto está lleno */
input[placeholder="Código de Verificación"]:focus {
    border-color: #007aff;
    box-shadow: 0 0 5px rgba(0, 122, 255, 0.5);
}

/* --- OCULTAR OJO NATIVO DE MICROSOFT EDGE/IE --- */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* --- FORZAR DISTANCIA SIMÉTRICA EN EL MODAL DE REGISTRO --- */
/* 1. Todos los contenedores principales a 12px exactos */
#signup-modal .input-container,
#signup-modal .row-inputs,
#signup-modal .input-container-row,
#signup-modal .verification-row,
#signup-modal .checkbox-container {
    margin-bottom: 12px !important;
}

/* 2. Limpieza de los inputs internos para evitar márgenes duplicados */
#signup-modal input {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* 3. Ajuste vital para el plugin de teléfono (.iti) */
#signup-modal .iti {
    margin-bottom: 12px !important;
}

#signup-modal .iti.iti--allow-dropdown {
    display: block !important;
}

/* --- CORRECCIÓN DEL MARGEN DOBLE EN NOMBRE Y APELLIDOS --- */
#signup-modal .row-inputs .input-container {
    margin-bottom: 0 !important;
}

/* ======================
   BOTÓN DE INSTALAR PWA
   ====================== */
.btn-instalar {
    background-color: #233b47; /* Un fondo sutil */
    color: #fff;
    border: 1px solid #007aff; /* Borde azul Code Store */
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-instalar:hover {
    background-color: #007aff;
    color: white;
}

/* --- BANNER FLOTANTE PWA (ESTILO NOTIFICACIÓN) --- */
.pwa-install-banner {
    position: fixed; 
    top: 10px;       
    left: 50%;       
    transform: translateX(-50%); 
    width: 90%;      
    max-width: 400px; 
    background-color: #1a2632; 
    color: white;
    padding: 12px 18px;
    border-radius: 15px; 
    border: 1px solid #2d3d4d; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    z-index: 99999; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Segoe UI', Roboto, sans-serif;
    animation: slideDownPWA 0.5s ease-out;
}

@keyframes slideDownPWA {
    from { transform: translate(-50%, -100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-content-left { display: flex; align-items: center; gap: 12px; }
.pwa-app-icon { font-size: 24px; }
.pwa-text-container { display: flex; flex-direction: column; }
.pwa-title { font-size: 14px; font-weight: bold; }
.pwa-subtitle { font-size: 12px; color: #94a3b8; }

.pwa-content-right { display: flex; align-items: center; gap: 12px; }
.pwa-btn-install {
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
.pwa-btn-install:hover { background-color: #005bb5; }

.pwa-close-btn {
    font-size: 22px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}
.pwa-close-btn:hover { color: #ff4d4d; }



/* =========================================
   ESTILOS PARA EL CATÁLOGO COMPLETO
   ========================================= */
/* =========================================
   ESTILOS PARA EL CATÁLOGO COMPLETO (Base Limpia)
   ========================================= */

/* Clase utilitaria para ocultar secciones (Vital para la navegación) */
.hidden {
    display: none !important;
}

/* Contenedor principal de la ventana de productos */
/* Contenedor principal de la ventana de productos */
#productos-catalogo {
    padding: 20px 0;
    margin: 20px auto 0 auto; /* Margen superior 20px, y automático a los lados para centrar */
    max-width: 1400px; /* Límite de ancho para que no se estire al infinito */
    width: 100%;
    box-sizing: border-box; /* Evita que el padding rompa el tamaño */
}

/* Contenedor del Grid (La cuadrícula invisible lista para usar) */
.products-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* 2 columnas en móvil */
    gap: 20px;
    padding: 0;
}

/* Media Query para el Grid en PC */
@media (min-width: 1024px) {
    .products-container.grid-view {
        grid-template-columns: repeat(6, 1fr); /* 4 columnas fijas en PC */
    }
}

/* =========================================
   ANTI-GLITCH (Evita el parpadeo al recargar)
   ========================================= */
html.cargar-productos-directo .slider,
html.cargar-productos-directo section:not(#productos-catalogo) {
    display: none !important;
}

html.cargar-productos-directo #productos-catalogo {
    display: block !important;
}

/* =========================================
   LAYOUT DEL CATÁLOGO (Sidebar Izquierda + Productos Derecha)
   ========================================= */

.catalog-layout {
    display: flex;
    gap: 30px; /* Espacio entre el menú y los productos */
    align-items: flex-start;
}

/* --- ESTILOS DEL SIDEBAR (Menú Izquierdo) --- */
.sidebar-categorias {
    width: 260px; /* Ancho fijo para el menú */
    background-color: #0f141a; /* Color de fondo estilo caja */
    border-radius: 12px;
    padding: 20px;
    flex-shrink: 0; /* Evita que el menú se aplaste */
}

.sidebar-title {
    color: #FFF;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* La línea tenue debajo de "CATEGORÍA" */
}

.categoria-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacio entre opciones */
}

.cat-btn {
    background: transparent;
    border: none;
    color: #a0b2c6; /* Texto grisáceo por defecto */
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 5px 0;
    transition: all 0.3s ease;
}

/* Tamaño de los iconos SVG del menú */
.cat-icon {
    width: 22px;
    height: 22px;
}

/* Efecto al pasar el mouse o al estar activo */
.cat-btn:hover, .cat-btn.active {
    color: #ffffff;
}

/* --- ESTILOS DEL ÁREA DE PRODUCTOS (Derecha) --- */
.products-main-area {
    flex-grow: 1; /* Ocupa todo el resto del espacio disponible */
    width: 100%;
}

/* --- MODO MÓVIL --- */
@media (max-width: 768px) {
    .catalog-layout {
        flex-direction: column; /* En celular, el menú se pone arriba de los productos */
        gap: 20px;
    }
    
    .sidebar-categorias {
        width: 100%; /* Ocupa todo el ancho en celular */
        padding: 15px;
    }
    
    /* En celular, ponemos los botones de lado a lado para ahorrar espacio */
    .categoria-list {
        flex-direction: row; 
        flex-wrap: wrap;
    }
}

