/* =========================================
   1. FUENTES PERSONALIZADAS (PANTON)
   ========================================= */
@font-face {
    font-family: 'Panton-BlackCaps';
    src: url('../../fonts/Panton-BlackCaps.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Panton-LightCaps';
    src: url('../../fonts/Panton-LightCaps.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* =========================================
   2. VARIABLES DE COLOR Y DISEÑO
   ========================================= */
:root {
    --bg-principal: #0a0a0a; 
    --bg-secundario: #141414; 
    --color-primario: #f0ae3c;
    --color-primario-glow: #f0ae3c69;
    --color-primario-t: #12A19AFF;
    --color-primario-glow-t: rgba(60, 240, 216, 0.412);
    --text-claro: #f8fafc;
    --text-gris: #94a3b8;
    --borde-sutil: rgba(255, 255, 255, 0.08);
    --borde-activo: rgba(231, 179, 5, 0.4);
    --radio-curva: 18px; 
    
    --font-titulos: 'Panton-BlackCaps', sans-serif;
    --font-textos: 'Panton-LightCaps', sans-serif;
}

/* =========================================
   3. RESET Y BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-principal);
    color: var(--text-claro);
    font-family: var(--font-textos);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .logo-text, .titulo-seccion, .tarjeta-titulo, .btn-android {
    font-family: var(--font-titulos);
    font-weight: normal;
    letter-spacing: 0.5px;
}

/* Bloqueo del scroll de fondo cuando un modal está activo */
body.modal-abierto {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none; 
}

.bg-secundario { background-color: var(--bg-secundario); }

.borde-sutil { border-color: var(--borde-sutil); }

 /* Toast notification */
        .toast-android {
            background-color: #333; color: white; padding: 12px 24px; border-radius: 24px;
            font-size: 14px; opacity: 0; transition: opacity 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.5);
        }
        .toast-android.show { opacity: 1; }

/* =========================================
   4. ANIMACIONES
   ========================================= */
@keyframes smoothAppear {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* =========================================
   5. HEADER FLOATING GLASS
   ========================================= */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--borde-sutil);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 2px 8px var(--color-primario-glow));
}

.logo-text {
    font-size: 1.1rem;
    color: var(--text-claro);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-gris);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    color: var(--color-primario);
    text-shadow: 0 0 12px var(--color-primario-glow);
}

/* =========================================
   6. CONTENEDORES Y BUSCADOR
   ========================================= */
.contenedor {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

.titulo-seccion {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-claro);
}

.titulo-seccion span {
    color: var(--color-primario);
    text-shadow: 0 0 20px var(--color-primario-glow);
}

.buscador-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-secundario);
    border: 1px solid var(--borde-sutil);
    border-radius: 20px;
    padding: 6px 8px 6px 20px;
    margin-bottom: 2.5rem;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.buscador-wrapper:focus-within {
    border-color: var(--color-primario);
    box-shadow: 0 0 20px var(--color-primario-glow), 0 8px 25px rgba(0,0,0,0.6);
}

.input-buscador {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-claro);
    font-family: var(--font-textos);
    font-size: 1.05rem;
    outline: none;
}

.input-buscador::placeholder {
    color: #525252;
}

.btn-icono {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--borde-sutil);
    color: var(--text-claro);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icono svg {
    width: 20px;
    height: 20px;
}

.btn-icono:hover, .btn-icono:active {
    background-color: var(--color-primario);
    color: #000;
    border-color: var(--color-primario);
    transform: scale(0.96);
}

/* =========================================
   7. MODALES Y FILTROS
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: var(--bg-secundario);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    width: 92%;
    max-width: 420px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--borde-sutil);
    padding-bottom: 14px;
}

.modal-header h3 {
    font-size: 1.2rem;
}

.btn-cerrar-X {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-gris);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
}

.opcion-orden {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 0.95rem;
    color: var(--text-gris);
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    margin-top: 10px;
}

.opcion-orden.activa {
    background: rgba(231, 179, 5, 0.08);
    color: var(--color-primario);
    border-color: var(--borde-activo);
    font-family: var(--font-titulos);
}

/* CHIPS */
.contenedor-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.chip-filtro {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--borde-sutil);
    color: var(--text-gris);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-filtro.activo {
    background: var(--color-primario);
    border-color: var(--color-primario);
    color: #000;
    font-family: var(--font-titulos);
    box-shadow: 0 4px 15px var(--color-primario-glow);
}

/* Scroll estilizado para Filtros */
#contenedor-categorias, #contenedor-tipos {
    scrollbar-width: thin; 
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent; 
}
#contenedor-categorias::-webkit-scrollbar, #contenedor-tipos::-webkit-scrollbar { width: 4px; }
#contenedor-categorias::-webkit-scrollbar-track, #contenedor-tipos::-webkit-scrollbar-track { background: transparent; }
#contenedor-categorias::-webkit-scrollbar-thumb, #contenedor-tipos::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 10px;
    transition: background 0.2s;
}
#contenedor-categorias::-webkit-scrollbar-thumb:hover, #contenedor-tipos::-webkit-scrollbar-thumb:hover { background: var(--borde-activo); }

/* =========================================
   8. CATÁLOGO DE MATERIALES (TARJETAS)
   ========================================= */
.grid-catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 1.25rem;
}

.tarjeta-curso {
    background: linear-gradient(180deg, var(--bg-secundario) 0%, rgba(20,20,20,0.4) 100%);
    border: 1px solid var(--borde-sutil);
    border-radius: var(--radio-curva);
    padding: 1.2rem; 
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: smoothAppear 0.5s ease-out backwards;
    position: relative;
    max-width: 100%; 
    overflow: hidden; 
}

.tarjeta-curso::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: all 0.3s ease;
}

.tarjeta-curso:hover {
    transform: translateY(-6px);
    border-color: var(--borde-activo);
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.9), 0 0 25px -5px var(--color-primario-glow);
}

.tarjeta-curso:hover::before {
    background: linear-gradient(90deg, transparent, var(--color-primario), transparent);
}

.tarjeta-titulo {
    font-size: 1.25rem;
    color: var(--text-claro);
    line-height: 1.3;
    margin-bottom: 10px;
}

.tarjeta-info-precios {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.precio-usd { color: var(--text-claro); font-size: 1.15rem; font-weight: bold; }
.precio-bs { color: var(--color-primario); font-size: 1.05rem; }
.separador { color: #333; }

.categoria-texto {
    color: var(--text-gris);
    font-size: 0.8rem;
    background: rgba(255,255,255,0.03);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--borde-sutil);
}

.contenedor-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.etiqueta-tipo {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-family: var(--font-titulos);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tarjeta-desc {
    color: var(--text-gris);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   9. BOTONES DEL SISTEMA
   ========================================= */
.btn-android {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: var(--font-titulos);
    font-size: 0.95rem;
    border-radius: 14px;
    padding: 12px 24px;
    min-height: 48px; 
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    gap: 8px;
    width: 100%;
}

.btn-dorado {
    background: var(--color-primario);
    color: #000000;
    font-weight: bold;
    box-shadow: 0 4px 20px -2px var(--color-primario-glow);
}

.btn-dorado:hover {
    box-shadow: 0 8px 25px 2px rgba(231, 179, 5, 0.4);
    filter: brightness(1.1);
}

.btn-turquesa {
    background: var(--color-primario-t);
    color: #000000;
    font-weight: bold;
    box-shadow: 0 4px 20px -2px var(--color-primario-glow-t);
}

.btn-turquesa:hover {
    box-shadow: 0 8px 25px 2px rgba(5, 231, 220, 0.4);
    filter: brightness(1.1);
}

.btn-dorado:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px transparent;
}

.btn-oscuro {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--borde-sutil);
    color: var(--text-claro);
    backdrop-filter: blur(8px);
}

.btn-oscuro:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-oscuro:active {
    transform: scale(0.97);
}

/* =========================================
   10. MEDIA QUERIES (COMPUTADORAS)
   ========================================= */
@media (min-width: 768px) {
    .contenedor { padding: 3.5rem 2rem; }
    .titulo-seccion { font-size: 2.8rem; }
    
    .grid-catalogo {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
        gap: 2rem;
    }
    
    .tarjeta-curso { padding: 1.5rem; }
}

/* =========================================
   11. PROTECCIÓN DE CABECERA (TELÉFONOS)
   ========================================= */
@media (max-width: 480px) {
    .header {
        padding: 0.8rem 1rem !important;
        flex-wrap: nowrap !important; 
        justify-content: space-between !important;
    }
    .logo-text { display: none !important; } 
    .logo-container img { height: 28px !important; }
    .nav-links {
        display: flex !important;
        gap: 15px !important;
        flex-shrink: 0 !important; 
    }
    .nav-links a { font-size: 0.95rem !important; display: inline-block !important; }
    .grid-catalogo { grid-template-columns: 1fr; }
    .buscador-wrapper { padding-left: 14px; }
}


/* =========================================
   ESTILOS DE LA PÁGINA DE DETALLE (Limpiados)
   ========================================= */
.tarjeta-detalle {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
  
    background-color: transparent; 
}

.detalle-layout-grid {
    display: grid;
    gap: 2rem;
}

.contenedor-portada-adaptativa {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1; 
}

.imagen-real { width: 100%; height: 100%; object-fit: cover; display: block; }
.imagen-placeholder { width: 60%; height: auto; object-fit: contain; opacity: 0.3; filter: grayscale(100%); }

.columna-info-detalles { display: flex; flex-direction: column; }
.btn-comprar-wrapper a { display: inline-block; padding: 14px 28px; width: 100%; max-width: 320px; font-size: 1.05rem; font-weight: bold; text-decoration: none; }

.titulo-desc { font-size: 0.85rem; color: #888; text-transform: uppercase; margin-bottom: 0.8rem; letter-spacing: 0.5px; }
.detalle-descripcion { line-height: 1.7; font-size: 0.95rem; color: #ccc; margin: 0; white-space: pre-wrap; }

/* =========================================
   BLINDAJE DE CABECERA Y VISTA MÓVIL
   ========================================= */
@media (max-width: 767px) {
    /* Fuerza al Header a no ocultar sus botones en celular */
    .header { flex-wrap: nowrap !important; display: flex !important; width: 100% !important; }
    .nav-links { display: flex !important; flex-shrink: 0 !important; }
    
    .detalle-layout-grid { grid-template-columns: 1fr; gap: 1rem; }
    .contenedor-portada-adaptativa { max-width: 300px; margin: 0 auto 1rem auto; }
    
    .detalle-titulo { font-size: 1.2rem !important; text-align: center; }
    .tarjeta-info-precios { justify-content: center !important; flex-wrap: wrap; font-size: 0.8rem !important; }
    .contenedor-etiquetas { justify-content: center !important; margin-bottom: 1rem !important; }
    .btn-comprar-wrapper { text-align: center; margin-bottom: 1.5rem; }
    
    .info-descripcion-container {
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 1.5rem;
        padding-bottom: 2.5rem; 
    }
    #txt-categoria, #txt-precio-bs, #txt-precio-usd {font-size: 0.9rem;}
}

/* =========================================
   VISTA PC / TABLET
   ========================================= */
@media (min-width: 768px) {
    .detalle-layout-grid { grid-template-columns: 350px 1fr; align-items: start; }
    .columna-imagen-fija { position: sticky; top: 2rem; }
    .detalle-titulo { font-size: 2.2rem !important; }
    .tarjeta-info-precios { justify-content: flex-start !important; }
    .contenedor-etiquetas { justify-content: flex-start !important; margin-bottom: 2rem !important; }
    .btn-comprar-wrapper { text-align: left; margin-bottom: 2rem; }
}


/* =========================================
   EFECTO GLOW PARA IMÁGENES DE TÍTULO
   ========================================= */

.img-titulo-premium {
    width: 100%;
    max-width: 550px; /* Tamaño máximo en PC para que no se vea gigante */
    height: auto;
    object-fit: contain;
    display: block;
    cursor: default;
    /* Un ligero brillo sutil por defecto para que resalte en el fondo oscuro */
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 10px rgba(231, 179, 5, 0.15));
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s ease;
}

/* Cuando el usuario pasa el mouse, el contorno transparente de las letras se ilumina en dorado */
.img-titulo-premium:hover {
    transform: scale(1.02); /* Un leve impulso de tamaño muy sutil */
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 25px var(--color-primario));
}

/* Optimización para pantallas de teléfonos móviles */
@media (max-width: 480px) {
    .img-titulo-premium {
        max-width: 85%; /* Se encoge proporcionalmente para que no toque los bordes de la pantalla */
    }
}