/**
 * Tours Gallery - Estilos Frontend
 * 
 * Diseño exacto basado en la imagen de referencia de Cali
 * 100% responsive y optimizado para móvil como una app
 * Tamaño mínimo: 396px x 263px con textos responsive
 * 
 * @package ToursGallery
 * @since 1.0.0
 */

/* ========================================
   VARIABLES CSS RESPONSIVE
======================================== */
:root {
    --card-width: 396px;
    --card-height: 263px;
    --outer-radius: 12px;
    --inner-radius: 10px;
    --blur-intensity-bg: 5px;
    --blur-intensity-card: 25px;
    --tag-bg: #e0f7ff; 
    --tag-color: #0077c9;
    --text-color: #000;
    --light-text-color: rgba(0, 0, 0, 0.7);
    
    /* Variables responsive para textos - Aumentados 25% */
    --city-font-size: 1.75em;
    --tag-font-size: 0.9375em;
    --detail-font-size: 1.125em;
    --price-font-size: 1.5625em;
    --tag-padding: 4px 8px;
    --section-padding: 11px;
}

/* Variables para móvil */
@media (max-width: 768px) {
    :root {
        --card-width: 90vw; /* 90% del ancho de la ventana */
    }
}
}

/* ========================================
   RESET Y BASE
======================================== */
* {
    box-sizing: border-box;
}

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */
.tours-gallery-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px; /* más espacio lateral en desktop */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ========================================
   GRID DE TOURS
======================================== */
.tours-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
    column-gap: 120px; /* +40px más espacio horizontal en tablet/desktop */
    row-gap: 30px;    /* mantiene separación vertical cómoda */
    margin: 0;
    padding: 0;
    justify-items: center;
}

/* Ajuste para móvil - grid de una columna */
@media (max-width: 768px) {
    .tours-gallery-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
}

/* ========================================
   TARJETA DE TOUR - DISEÑO EXACTO
======================================== */
.tour-card {
    width: var(--card-width);
    height: var(--card-height);
    background: #ffffff;
    border-radius: var(--outer-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 12px; /* margen horizontal extra (no-móvil) */
}

/* Ajuste para móvil - 90% del ancho y centrado */
@media (max-width: 768px) {
    .tour-card {
        width: 90% !important;
        margin: 0 auto !important;
    }
}

.tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   ENLACE DE LA TARJETA
======================================== */
.tour-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tour-card-link:hover,
.tour-card-link:focus {
    text-decoration: none;
    color: inherit;
    outline: none;
}

/* ========================================
   IMAGEN DE LA TARJETA
======================================== */
.tour-card-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tour-image {
    width: 100%;
    height: 100% !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: block; /* evita espacios/gaps debajo del img */
    transition: transform 0.3s ease;
}

.tour-card:hover .tour-image {
    transform: scale(1.05);
}

.tour-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* ========================================
   ETIQUETAS SUPERPUESTAS
======================================== */
.tour-tags-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
}

.tour-tag {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   CONTENIDO DE LA TARJETA
======================================== */
.tour-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    background: #ffffff;
}

/* ========================================
   INFORMACIÓN DEL TOUR
======================================== */
.tour-info {
    margin-bottom: 12px;
}

.tour-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tour-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* ========================================
   PRECIO - DISEÑO EXACTO COMO LA IMAGEN
======================================== */
.tour-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: auto;
}

.price-currency {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
}

.price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

/* ========================================
   MENSAJE SIN TOURS
======================================== */
.tours-gallery-no-tours {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

/* ========================================
   RESPONSIVE DESIGN - MÓVIL COMO APP
======================================== */

/* Tablets */
@media (max-width: 768px) {
    .tours-gallery-container {
        padding: 12px;
    }
    
    .tours-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        column-gap: 88px; /* +40px más margen horizontal en tablet */
        row-gap: 20px;    /* separación vertical moderada */
    }
    
    .tour-card-image {
        height: 160px;
    }
    
    .tour-card-content {
        padding: 14px;
    }
    
    .tour-title {
        font-size: 15px;
    }
    
    .price-amount {
        font-size: 17px;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .tours-gallery-container {
        padding: 0; /* sin espacio lateral en móvil */
        max-width: 100%;
    }
    
    .tours-gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tour-card {
        border-radius: 12px;
        margin: 0; /* quitar todo el margen horizontal en móvil */
        max-width: none;
        width: 100%;
    }
    
    .tour-card-image {
        height: 140px;
    }
    
    .tour-card-content {
        padding: 12px;
    }
    
    .tour-title {
        font-size: 14px;
        font-weight: 600;
    }
    
    .tour-subtitle {
        font-size: 11px;
    }
    
    .price-currency {
        font-size: 11px;
    }
    
    .price-amount {
        font-size: 16px;
        font-weight: 700;
    }
    
    .tour-tag {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .tour-tags-overlay {
        top: 8px;
        left: 8px;
        gap: 4px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 320px) {
    .tours-gallery-container {
        padding: 8px;
    }
    
    .tour-card {
        max-width: 100%;
    }
    
    .tour-card-image {
        height: 120px;
    }
    
    .tour-card-content {
        padding: 10px;
    }
    
    .tour-title {
        font-size: 13px;
    }
    
    .price-amount {
        font-size: 15px;
    }
}

/* ========================================
   CONFIGURACIONES ESPECÍFICAS DE COLUMNAS
======================================== */
.tours-gallery-container[data-columns="1"] .tours-gallery-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
}

.tours-gallery-container[data-columns="2"] .tours-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tours-gallery-container[data-columns="3"] .tours-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tours-gallery-container[data-columns="4"] .tours-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ========================================
   ANIMACIONES Y TRANSICIONES
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-card {
    animation: fadeInUp 0.6s ease-out;
    opacity: 1 !important; /* Forzar visibilidad */
    display: block !important; /* Asegurar que siempre se muestre */
    visibility: visible !important; /* Garantizar visibilidad */
}

.tour-card:nth-child(2) {
    animation-delay: 0.1s;
}

.tour-card:nth-child(3) {
    animation-delay: 0.2s;
}

.tour-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* ========================================
   ACCESIBILIDAD
======================================== */
.tour-card:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .tour-card,
    .tour-image {
        transition: none;
        animation: none;
    }
    
    .tour-card:hover {
        transform: none;
    }
    
    .tour-card:hover .tour-image {
        transform: none;
    }
}

/* ========================================
   MODO OSCURO
======================================== */
@media (prefers-color-scheme: dark) {
    .tour-card {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }
    
    .tour-card-content {
        background: #1a1a1a;
    }
    
    .tour-title {
        color: #ffffff;
    }
    
    .tour-subtitle {
        color: #aaa;
    }
    
    .price-currency {
        color: #aaa;
    }
    
    .price-amount {
        color: #ffffff;
    }
    
    .tour-tag {
        background: rgba(0, 0, 0, 0.8);
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .tours-gallery-no-tours {
        background: #2a2a2a;
        color: #aaa;
        border-color: #444;
    }
}

/* ========================================
   MEDIA QUERIES RESPONSIVE PARA TEXTOS
======================================== */

/* Cards más grandes (500px+) */
@media (min-width: 500px) {
    :root {
        --city-font-size: 2em;
        --tag-font-size: 1em;
        --detail-font-size: 1.25em;
        --price-font-size: 1.75em;
        --tag-padding: 5px 10px;
        --section-padding: 14px;
    }
}

/* Cards muy grandes (600px+) */
@media (min-width: 600px) {
    :root {
        --city-font-size: 2.25em;
        --tag-font-size: 1.0625em;
        --detail-font-size: 1.375em;
        --price-font-size: 2em;
        --tag-padding: 6px 12px;
        --section-padding: 16px;
    }
}

/* Responsive para móvil - 100% adaptativo como una app */
@media (max-width: 768px) {
    :root {
        --card-width: 320px;
        --card-height: 220px;
        --city-font-size: 1.625em;
        --tag-font-size: 0.9em;
        --detail-font-size: 1.0625em;
        --price-font-size: 1.4375em;
        --tag-padding: 4px 7px;
        --section-padding: 10px;
    }
    
    .tours-gallery-container {
        padding: 15px;
    }
    
    .tours-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --card-width: 100%;
        --card-height: 200px;
        --city-font-size: 1.5em;
        --tag-font-size: 0.875em;
        --detail-font-size: 1em;
        --price-font-size: 1.375em;
        --tag-padding: 3px 6px;
        --section-padding: 8px;
    }
    
    .tours-gallery-container {
        padding: 10px;
    }
    
    .tours-gallery-grid {
        gap: 15px;
    }
    
    .tour-card {
        margin: 0 20px; /* máximo 20px por lado en móvil */
        max-width: none;
        width: calc(100% - 40px);
    }
}

/* Cards pequeñas (menos de 350px) */
@media (max-width: 350px) {
    :root {
        --city-font-size: 1.375em;
        --tag-font-size: 0.8125em;
        --detail-font-size: 0.9375em;
        --price-font-size: 1.25em;
        --tag-padding: 2px 5px;
        --section-padding: 6px;
    }
}