/* ============================================================
   CATALOGO.CSS - VERSIÓN DEFINITIVA Y LIMPIA
   ============================================================ */

/* ============================================================
   1. RESET Y ESTILOS GENERALES
   ============================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    padding: 20px;
    background: #0a0e17;
    color: #e0e8f0;
    margin: 0;
    min-height: 100vh;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    color: #00c8ff;
    text-shadow: 0 0 30px rgba(0, 200, 255, 0.15);
}

h2 {
    color: #7a9bb5;
    font-weight: normal;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================================
   2. BARRA SUPERIOR - HORIZONTAL SIEMPRE
   ============================================================ */
.barra {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 20px;
    max-width: 800px;
    margin: 0 auto 25px auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    border: 2px solid #3498db;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
}

.barra a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 42px;
    flex-shrink: 0;
}

.barra a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.barra a img {
    height: 24px;
    width: auto;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    object-fit: contain;
}

.barra a:not(:last-child)::after {
    content: "|";
    margin-left: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: normal;
}

/* ============================================================
   3. HEADER
   ============================================================ */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
    color: #00c8ff;
}

.header h2 {
    font-size: 1.1em;
    color: #7a9bb5;
    font-weight: 300;
}

/* ============================================================
   4. VOLVER AL GRUPO
   ============================================================ */
.volver-grupo {
    max-width: 800px;
    margin: 0 auto 20px auto;
}

.volver-grupo a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #ffeaea;
    color: #c0392b;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.volver-grupo a:hover {
    background: #e74c3c;
    color: #ffffff;
}

/* ============================================================
   5. TARJETAS - ESTILO ÚNICO Y CONSISTENTE
   ============================================================ */
.tarjeta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 12px auto;
    padding: 14px 20px;
    background: #ffffff;
    border: 2px solid #3498db;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
    box-sizing: border-box;
}

.tarjeta:hover {
    background: #3498db;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.tarjeta:hover .titulo a {
    color: #ffffff;
}

.tarjeta-link {
    display: block;
    max-width: 800px;
    margin: 0 auto 12px auto;
    color: inherit;
    text-decoration: none;
}

.tarjeta-link .tarjeta {
    max-width: 100%;
    margin: 0;
    cursor: pointer;
}

.tarjeta-link:hover,
.tarjeta-link:visited,
.tarjeta-link:active {
    color: inherit;
    text-decoration: none;
}

.tarjeta-link:focus-visible {
    outline: 3px solid #00c8ff;
    outline-offset: 4px;
    border-radius: 8px;
}

/* Tarjeta especial para grupos */
.tarjeta.grupo {
    background: #e8f5e8;
    border-color: #27ae60;
}

.tarjeta.grupo:hover {
    background: #27ae60;
}

.tarjeta.grupo:hover .titulo a {
    color: #ffffff;
}

/* ============================================================
   6. TÍTULO Y BANDERA
   ============================================================ */
.titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.1em;
    color: #212529;
    flex-grow: 1;
    overflow-wrap: anywhere;
}

.titulo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

.bandera {
    width: 28px;
    height: 20px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* ============================================================
   7. SECCIÓN EXTRA - CARPETAS EN RAÍZ
   ============================================================ */
.seccion-extra {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #1a2f44;
    clear: both;
}

.separador-catalogo {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #3498db, transparent);
    margin: 20px auto;
    max-width: 400px;
}

.seccion-extra-titulo {
    color: #7a9bb5;
    font-size: 1.3em;
    margin-bottom: 20px;
    font-weight: normal;
}

.carpetas-raiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
}

.carpetas-raiz-grid .tarjeta {
    max-width: 100%;
    margin: 0;
}

/* ============================================================
   8. ELEMENTOS ADICIONALES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.bandera-texto {
    display: inline-block;
}

.md-icon-extra {
    font-size: 0.7em;
    color: #5a8aaa;
    margin-left: 4px;
}

.meta-extra {
    font-size: 0.75em;
    color: #5a7a95;
    margin-top: 6px;
    display: inline-block;
    background: #1a334a;
    padding: 2px 12px;
    border-radius: 12px;
    border: 1px solid #1a3a55;
}

.traducciones-disponibles {
    font-size: 0.75em;
    color: #5a8aaa;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(0, 200, 255, 0.05);
    border: 1px dashed #1a3a55;
    display: inline-block;
}

/* ============================================================
   9. RESPONSIVE
   ============================================================ */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .barra {
        padding: 10px 12px;
        justify-content: flex-start;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .barra a {
        padding: 6px 12px;
        font-size: 0.8em;
        height: 34px;
        flex-shrink: 0;
    }

    .barra a img {
        height: 18px;
    }

    .barra a:not(:last-child)::after {
        margin-left: 6px;
        margin-right: 0;
        font-size: 0.8em;
    }

    .tarjeta {
        padding: 12px 15px;
        gap: 12px;
        margin-left: 0;
        margin-right: 0;
    }

    .titulo {
        font-size: 0.95em;
    }

    .bandera {
        width: 24px;
        height: 17px;
    }

    .carpetas-raiz-grid {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2em;
    }
}

@media screen and (max-width: 480px) {
    .barra a {
        font-size: 0.7em;
        padding: 4px 10px;
        height: 30px;
        gap: 4px;
    }

    .barra a img {
        height: 14px;
    }

    .titulo {
        font-size: 0.85em;
        gap: 6px;
    }

    .bandera {
        width: 20px;
        height: 14px;
    }

    .header h1 {
        font-size: 1.6em;
    }
}

.tarjeta-link,
.tarjeta-link:link,
.tarjeta-link:visited,
.tarjeta-link:hover,
.tarjeta-link:active,
.tarjeta-link:focus,
.tarjeta-link *,
.tarjeta-link:hover * {
    text-decoration: none !important;
}