/* NARAN-HO Talonario Solidario - Versión 1.1.2 */
/* Tipografía actualizada: Fuentes del sistema, sin Open Sans */
/* Incluye botón flotante "Volver arriba" */

.naranho-directorio {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    position: relative;
}

/* Buscador OCULTO por ahora */
.naranho-buscador {
    display: none !important;
}

/* Filtros */
.naranho-filtros {
    margin-bottom: 30px;
}

.naranho-filtro-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.naranho-filtro-btn {
    padding: 8px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.naranho-filtro-btn:hover {
    border-color: #17458f;
    color: #17458f;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(23, 69, 143, 0.15);
}

.naranho-filtro-btn.active {
    background: #17458f;
    color: white;
    border-color: #17458f;
    box-shadow: 0 4px 8px rgba(23, 69, 143, 0.2);
}

.naranho-filtro-btn:focus {
    outline: 2px solid #f7a81b;
    outline-offset: 2px;
}

/* Navegación alfabética */
.naranho-alfabeto {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 3px;
}

.naranho-letra-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    text-decoration: none;
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 50%;
    color: #17458f;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.naranho-letra-link:hover {
    background: #17458f;
    color: white;
    border-color: #17458f;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 12px rgba(23, 69, 143, 0.2);
}

.naranho-letra-link:focus {
    outline: 2px solid #f7a81b;
    outline-offset: 2px;
}

.naranho-letra-link.sin-empresas {
    opacity: 0.3 !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Contador */
.naranho-contador {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f0f5ff;
    border-radius: 1px;
    font-size: 14px;
    color: #333;
    text-align: center;
}

.naranho-contador-texto {
    font-weight: 600;
    font-size: 14px;
    color: #17458f;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Letras - Se ocultan cuando no hay empresas en esa letra */
.naranho-letra-grupo.sin-empresas {
    display: none !important;
}

.naranho-letra-titulo {
    padding: 18px 25px!important;
    background: linear-gradient(135deg, #17458f 0%, #0d2c5f 100%);
    color: white!important;
    border-radius: 4px;
    margin-bottom: 20px!important;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 6px 15px rgba(23, 69, 143, 0.2);
    position: relative;
    overflow: hidden;
}

.naranho-letra-titulo::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
}

/* Grid de empresas */
.naranho-empresas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Tarjeta de empresa */
.naranho-empresa {
    border: 1px solid #e8edf3;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    position: relative;
}

.naranho-empresa::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #17458f, #f7a81b);
    opacity: 0;
    transition: opacity 0.3s;
}

.naranho-empresa:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(23, 69, 143, 0.15);
    border-color: #17458f;
}

.naranho-empresa:hover::before {
    opacity: 1;
}

/* Logo */
.naranho-empresa-logo {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f5ff 100%);
    border-bottom: 1px solid #e8edf3;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.naranho-empresa:hover .naranho-empresa-logo {
    background: linear-gradient(135deg, #f0f5ff 0%, #e8f0ff 100%);
}

.naranho-empresa-logo img {
    max-width: 200px;
    max-height: 140px;
    object-fit: contain;
    transition: transform 0.4s;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.naranho-empresa:hover .naranho-empresa-logo img {
    transform: scale(1.08);
}

/* Contenido */
.naranho-empresa-contenido {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Nombre */
.naranho-empresa-nombre {
    margin: 0 0 20px 0!important;
    color: #17458f!important;
    font-size: 20px!important;
    line-height: 1.2!important;
    font-weight: 600!important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.naranho-empresa-nombre code {
    all: unset;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Descripción */
.naranho-empresa-descripcion {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.7;
    flex-grow: 1;
    position: relative;
    font-size: 15px;
}

.naranho-desc-corta {
    margin-bottom: 8px;
}

.naranho-desc-larga {
    display: none;
}

/* Botón "seguir leyendo" */
.naranho-leer-mas {
    background: none;
    border: none;
    color: #f7a81b;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 0;
    margin-top: 12px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    text-align: left;
    position: relative;
    display: inline-block;
}

.naranho-leer-mas:hover {
    color: #17458f;
}

.naranho-leer-mas::after {
    content: "›";
    margin-left: 5px;
    transition: transform 0.2s;
    display: inline-block;
}

.naranho-leer-mas:hover::after {
    transform: translateX(4px);
}

.naranho-leer-mas:focus {
    outline: 2px solid #f7a81b;
    outline-offset: 4px;
    border-radius: 3px;
}

/* Etiquetas de categorías */
.naranho-empresa-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.naranho-etiqueta {
    display: inline-block;
    padding: 6px 15px;
    background: #e8f0ff;
    color: #17458f;
    border-radius: 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #c5d8ff;
    transition: all 0.3s;
}

.naranho-empresa:hover .naranho-etiqueta {
    background: #17458f;
    color: white;
    border-color: #17458f;
    transform: translateY(-2px);
}

/* Enlaces y ofertas */
.naranho-empresa-enlaces {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 25px;
    border-top: 2px solid #f0f5ff;
    margin-top: auto;
}

.naranho-empresa-web {
    color: #17458f;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.naranho-empresa-web:hover {
    color: #f7a81b;
    gap: 12px;
}

.naranho-empresa-web::after {
    content: "→";
    font-size: 18px;
    transition: transform 0.2s;
}

.naranho-empresa-web:hover::after {
    transform: translateX(5px);
}

.naranho-empresa-oferta {
    background: linear-gradient(135deg, #f7a81b 0%, #e6950e 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-family: "Arial Narrow", "Franklin Gothic Medium", "Arial Condensed", sans-serif;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(247, 168, 27, 0.3);
    border: 2px solid #f7a81b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sin resultados */
.naranho-sin-resultados {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #e8edf3 100%);
    border-radius: 15px;
    color: #666;
    border: 3px dashed #d1dbe8;
    margin-top: 50px;
}

.naranho-sin-resultados p {
    font-family: "Arial Narrow", "Franklin Gothic Medium", "Arial Condensed", sans-serif;
    font-size: 22px;
    margin: 0;
    font-weight: 700;
    color: #17458f;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =====================================================
   BOTÓN FLOTANTE "VOLVER ARRIBA"
===================================================== */
.naranho-volver-arriba {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #17458f 0%, #0d2c5f 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(23, 69, 143, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
    padding: 0;
}

.naranho-volver-arriba.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.naranho-volver-arriba:hover {
    background: linear-gradient(135deg, #f7a81b 0%, #e6950e 100%);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(247, 168, 27, 0.4);
}

.naranho-volver-arriba:focus {
    outline: 2px solid #f7a81b;
    outline-offset: 3px;
}

.naranho-volver-arriba svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Efecto de pulso al aparecer */
@keyframes naranhoPulse {
    0% {
        box-shadow: 0 6px 20px rgba(23, 69, 143, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px 10px rgba(23, 69, 143, 0.2);
    }
    100% {
        box-shadow: 0 6px 20px rgba(23, 69, 143, 0.3);
    }
}

.naranho-volver-arriba.visible {
    animation: naranhoPulse 2s infinite;
}

/* Responsive para botón volver arriba */
@media (max-width: 768px) {
    .naranho-volver-arriba {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    
    .naranho-volver-arriba svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .naranho-volver-arriba {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
}

/* =====================================================
   ESTILOS RESPONSIVE GENERALES
===================================================== */
@media (max-width: 1200px) {
    .naranho-directorio {
        padding: 15px;
    }
}

@media (max-width: 992px) {
    .naranho-empresas-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .naranho-letra-titulo {
        font-size: 24px;
        padding: 15px 20px;
    }
}

@media (max-width: 768px) {
    .naranho-empresas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .naranho-filtro-categorias {
        justify-content: center;
        gap: 8px;
    }
    
    .naranho-filtro-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .naranho-alfabeto {
        gap: 6px;
        padding: 15px;
    }
    
    .naranho-letra-link {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .naranho-empresa-contenido {
        padding: 25px;
    }
    
    .naranho-empresa-nombre {
        font-size: 22px;
    }
    
    .naranho-empresa-logo {
        padding: 25px;
        min-height: 160px;
    }
    
    .naranho-empresa-logo img {
        max-width: 180px;
        max-height: 120px;
    }
}

@media (max-width: 576px) {
    .naranho-filtro-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .naranho-letra-link {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .naranho-contador {
        padding: 12px 15px;
    }
    
    .naranho-contador-texto {
        font-size: 16px;
    }
    
    .naranho-empresa-enlaces {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .naranho-empresa-oferta {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .naranho-empresas-grid {
        gap: 15px;
    }
    
    .naranho-empresa-contenido {
        padding: 20px;
    }
    
    .naranho-empresa-nombre {
        font-size: 20px;
    }
    
    .naranho-empresa-logo {
        padding: 20px;
        min-height: 140px;
    }
    
    .naranho-empresa-logo img {
        max-width: 160px;
        max-height: 100px;
    }
}

/* Animación para expandir texto */
@keyframes naranhoExpandir {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

.naranho-desc-larga {
    animation: naranhoExpandir 0.4s ease-out;
}

/* Clase para mostrar el texto completo */
.naranho-texto-completo .naranho-desc-corta {
    display: none;
}

.naranho-texto-completo .naranho-desc-larga {
    display: block;
}

/* Contador en metabox */
#naranho-contador-palabras {
    font-family: "Arial Narrow", "Franklin Gothic Medium", "Arial Condensed", sans-serif;
    font-weight: 700;
    font-size: 14px;
    margin-top: 8px;
}

/* Estilo para letras sin empresas (se ocultan) */
.naranho-letra-grupo.oculto {
    display: none !important;
}

/* Estilo para el mensaje cuando no hay empresas en ninguna categoría */
.naranho-sin-empresas-categoria {
    text-align: center;
    padding: 60px 30px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e8edf3;
    margin: 30px 0;
}

.naranho-sin-empresas-categoria p {
    font-family: "Arial Narrow", "Franklin Gothic Medium", "Arial Condensed", sans-serif;
    font-size: 20px;
    color: #17458f;
    font-weight: 700;
    margin: 0;
}