/* ==========================================================================
   Guías: Estilos para el sistema de guías
   Sistema de guías de AAV Utilidades v3.0
   ========================================================================== */

/* ==========================================================================
   Variables específicas para guías
   ========================================================================== */
:root {
    --aav-guide-card-padding: 1.5rem;
    --aav-guide-card-radius: 12px;
}

/* ==========================================================================
   Layout del directorio de guías
   ========================================================================== */
.aav-guides-directorio-wrapper {
    margin: 2rem 0;
}

/* ==========================================================================
   Buscador de guías - MEJORADO
   ========================================================================== */
.aav-guides-search-wrapper {
    margin-bottom: 2rem;
}

.aav-guides-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.aav-guides-search {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 10px !important;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.aav-guides-search:focus {
    outline: none;
    border-color: var(--aav-primary);
    box-shadow: 0 0 0 3px rgba(255, 119, 0, 0.1);
}

/* Botón de limpiar búsqueda - SIN FONDO */
.aav-guides-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #999;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aav-guides-search-container.has-value .aav-guides-search-clear,
.aav-guides-search-clear.active {
    opacity: 1;
}

.aav-guides-search-clear:hover {
    color: #666;
}

.aav-guides-search-clear svg {
    width: 16px;
    height: 16px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Directorio de guías - GRID DE 2 COLUMNAS
   ========================================================================== */
.aav-guides-directorio {
    background: white;
    border-radius: var(--aav-guide-card-radius);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 3rem;
}

/* Categoría individual */
.aav-guides-categoria {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.aav-guides-categoria.hidden {
    display: none;
}

/* Título de categoría con línea gris */
.aav-guides-categoria-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    color: var(--aav-heading);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Lista de guías dentro de categoría */
.aav-guides-lista {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Items con guión visible */
.aav-guide-item {
    padding: 0.4rem 0;
    opacity: 1;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 1.2rem;
}

.aav-guide-item.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
}

/* Guión ANTES del enlace */
.aav-guide-item::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--aav-gray);
    font-weight: 400;
}

.aav-guide-item a {
    color: var(--aav-primary);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s ease;
    display: inline-block;
}

.aav-guide-item a:hover {
    text-decoration: underline;
}

/* Enlaces visitados */
.aav-guide-item a:visited {
    color: #ffb366;
}

/* Resaltado de búsqueda */
.aav-guide-item mark {
    background-color: rgba(255, 119, 0, 0.2);
    color: inherit;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* ==========================================================================
   Guías destacadas (mini-cards) - ESTILO CORRECTO
   ========================================================================== */
.aav-guides-destacadas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Columnas forzadas en desktop */
.aav-guides-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.aav-guides-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.aav-guides-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Mini-card individual */
.aav-guide-destacada {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 120px;
    position: relative;
}

/* Hover: solo cambia el color del borde */
.aav-guide-destacada:hover {
    border-color: var(--aav-primary);
    text-decoration: none;
}

/* Icono de la guía */
.aav-guide-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aav-guide-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Placeholder cuando no hay icono - Solo rectángulo gris */
.aav-guide-icon-placeholder {
    width: 48px;
    height: 48px;
    background: #e8e8e8;
    border-radius: 6px;
}

/* Título de la mini-card */
.aav-guide-destacada h3 {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    color: var(--aav-heading);
    line-height: 1.3;
}

/* ==========================================================================
   Guías recientes/actualizadas
   ========================================================================== */
.aav-guides-card {
    background: white;
    border-radius: var(--aav-guide-card-radius);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.aav-guides-card-title {
    font-size: var(--aav-h3-size);
    margin: 0 0 1.5rem 0;
    color: var(--aav-heading);
}

/* Lista de guías con layout de 2 columnas */
.aav-guide-reciente {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: start;
    position: relative;
}

.aav-guide-reciente:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Dash alineado con el título */
.aav-guide-reciente::before {
    content: "–";
    position: absolute;
    left: 0;
    top: 1rem;
    color: var(--aav-gray);
}

/* Info de la guía - con padding para el dash */
.aav-guide-reciente-info {
    grid-column: 1;
    padding-left: 1.5rem;
}

.aav-guide-reciente-info h4 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
}

.aav-guide-reciente-info h4 a {
    color: var(--aav-primary);
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.aav-guide-reciente-info h4 a:visited {
    color: #ffb366;
}

.aav-guide-reciente-info h4 a:hover {
    text-decoration: underline;
}

/* Fecha/meta */
.aav-guide-fecha {
    display: block;
    font-size: 0.85rem;
    color: var(--aav-gray);
    margin-top: 0.25rem;
}

/* Resumen */
.aav-guide-reciente-resumen {
    grid-column: 2;
}

.aav-guide-reciente-resumen p {
    margin: 0;
    color: var(--aav-gray);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    /* Guías destacadas: 2 columnas en tablet */
    .aav-guides-destacadas {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .aav-guides-cols-3,
    .aav-guides-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Directorio sigue en 2 columnas en tablet */
    .aav-guides-directorio {
        gap: 1.5rem 2rem;
    }
}

@media (max-width: 768px) {
    /* Guías destacadas: 2 columnas en móvil también */
    .aav-guides-destacadas,
    .aav-guides-cols-2,
    .aav-guides-cols-3,
    .aav-guides-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Mini-cards más compactas en móvil */
    .aav-guide-destacada {
        min-height: 100px;
        padding: 1rem;
    }
    
    .aav-guide-icon,
    .aav-guide-icon-placeholder {
        width: 40px;
        height: 40px;
    }
    
    .aav-guide-destacada h3 {
        font-size: 0.9rem;
    }
    
    /* Directorio: 1 columna en móvil */
    .aav-guides-directorio {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .aav-guides-categoria-title {
        font-size: 1.15rem;
    }
    
    /* Guías recientes responsive */
    .aav-guides-card {
        padding: 1.5rem;
    }
    
    .aav-guide-reciente {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .aav-guide-reciente-info,
    .aav-guide-reciente-resumen {
        grid-column: 1;
    }
}

@media (max-width: 480px) {
    /* Búsqueda móvil */
    .aav-guides-search {
        font-size: 16px; /* Evitar zoom en iOS */
    }
    
    /* Mini-cards: 1 columna en móvil pequeño */
    .aav-guides-destacadas,
    .aav-guides-cols-2,
    .aav-guides-cols-3,
    .aav-guides-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .aav-guide-destacada {
        padding: 1rem;
    }
    
    .aav-guide-icon,
    .aav-guide-icon-placeholder {
        width: 36px;
        height: 36px;
    }
    
    .aav-guide-destacada h3 {
        font-size: 0.9rem;
    }
    
    /* Cards más compactas */
    .aav-guides-card {
        padding: 1.25rem;
    }
    
    .aav-guides-card-title {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }
}

/* ==========================================================================
   Estados vacíos y mensajes
   ========================================================================== */
.aav-guides-empty {
    text-align: center;
    padding: 3rem;
    color: var(--aav-gray);
}

.aav-guides-empty p {
    margin: 0;
    font-size: 1.1rem;
}

/* Mensaje de no resultados en búsqueda */
.aav-guides-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--aav-gray);
    display: none;
}

.aav-guides-no-results.show {
    display: block;
}

/* Indicador de carga */
.aav-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: #666;
}

.aav-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff7700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Información de resultados */
.aav-search-results-info {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.aav-search-results-info p {
    margin: 0;
    color: #666;
}

/* ==========================================================================
   Animaciones
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aav-guides-categoria {
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================================================
   Utilidades
   ========================================================================== */
.aav-guides-loading {
    text-align: center;
    padding: 2rem;
    color: var(--aav-gray);
}

.aav-guides-loading::after {
    content: "...";
    animation: loading 1.4s infinite;
}

@keyframes loading {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

/* ==========================================================================
   Sobrescribir estilos de Flatsome si es necesario
   ========================================================================== */
.aav-guides-destacadas a {
    box-shadow: none !important;
}

.aav-guides-lista li {
    margin-bottom: 0 !important;
    margin-left: 0 !important;
}

/* Asegurar que los márgenes de Flatsome no interfieran */
.col-inner .aav-guides-directorio,
.col-inner .aav-guides-destacadas,
.col-inner .aav-guides-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
}