/**
 * GP Paquetes - Estilos Frontend v2
 *
 * Diseño mejorado con filtros interactivos, cards pulidas,
 * animaciones suaves y responsive mobile-first.
 * Prefijo .gp- para evitar conflictos con Elementor.
 *
 * Breakpoints:
 * - Mobile: < 768px (base)
 * - Tablet: >= 768px
 * - Desktop: >= 992px
 * - Wide: >= 1200px
 */

/* === Variables CSS - OneWayTravelss Brand === */
:root {
    --gp-primary: #121f41;
    --gp-primary-hover: #0d1628;
    --gp-primary-light: #e8eaf0;
    --gp-primary-soft: #d4d9e8;
    --gp-accent: #FF5400;
    --gp-accent-hover: #e64a00;
    --gp-accent-light: #fff3ed;
    --gp-text: #111827;
    --gp-text-secondary: #4b5563;
    --gp-text-muted: #9ca3af;
    --gp-bg: #f9fafb;
    --gp-white: #ffffff;
    --gp-border: #e5e7eb;
    --gp-border-light: #f3f4f6;
    --gp-shadow-sm: 0 2px 4px rgba(18, 31, 65, 0.06);
    --gp-shadow: 0 4px 8px rgba(18, 31, 65, 0.08), 0 2px 4px rgba(18, 31, 65, 0.04);
    --gp-shadow-md: 0 8px 16px rgba(18, 31, 65, 0.1), 0 4px 8px rgba(18, 31, 65, 0.06);
    --gp-shadow-lg: 0 16px 32px rgba(18, 31, 65, 0.12), 0 8px 16px rgba(18, 31, 65, 0.08);
    --gp-shadow-xl: 0 24px 48px rgba(18, 31, 65, 0.15), 0 12px 24px rgba(18, 31, 65, 0.1);
    --gp-radius: 30px;
    --gp-radius-md: 20px;
    --gp-radius-sm: 12px;
    --gp-radius-xs: 8px;
    --gp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gp-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gp-transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset scoped === */
.gp-archive-wrapper *,
.gp-archive-wrapper *::before,
.gp-archive-wrapper *::after {
    box-sizing: border-box;
}

/* === Container === */
.gp-archive-wrapper {
    background-color: var(--gp-bg);
    padding: 32px 0 64px;
    font-family: var(--gp-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* =========================
   HEADER
   ========================= */
.gp-archive-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px 0 8px;
}

.gp-archive-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--gp-primary);
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.gp-archive-subtitle {
    font-size: 15px;
    color: var(--gp-text-secondary);
    margin: 0 auto;
    max-width: 500px;
    line-height: 1.5;
}

/* =========================
   FILTROS
   ========================= */
.gp-filters {
    background: var(--gp-white);
    border: 2px solid var(--gp-border);
    border-radius: var(--gp-radius-md);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--gp-shadow);
}

.gp-filters-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gp-text-muted);
}

.gp-filter-select {
    width: 100%;
    height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    background-color: var(--gp-white);
    font-size: 14px;
    color: var(--gp-text);
    cursor: pointer;
    transition: border-color var(--gp-transition), box-shadow var(--gp-transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.gp-filter-select:focus {
    outline: none;
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px var(--gp-primary-light);
}

.gp-filter-group-precio {
    min-width: 0;
}

.gp-filter-precio-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gp-filter-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    font-size: 14px;
    color: var(--gp-text);
    transition: border-color var(--gp-transition), box-shadow var(--gp-transition);
    -moz-appearance: textfield;
}

.gp-filter-input::-webkit-outer-spin-button,
.gp-filter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gp-filter-input:focus {
    outline: none;
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px var(--gp-primary-light);
}

.gp-filter-input::placeholder {
    color: var(--gp-text-muted);
}

.gp-filter-separator {
    color: var(--gp-text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

/* Acciones de filtro */
.gp-filter-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

.gp-btn-filter {
    flex: 1;
    gap: 6px;
    height: 42px;
    padding: 0 20px;
    font-size: 14px;
}

.gp-btn-clear {
    height: 42px;
    padding: 0 16px;
    background: transparent;
    color: var(--gp-text-secondary);
    border: 1px solid var(--gp-border);
    font-size: 13px;
}

.gp-btn-clear:hover {
    background: var(--gp-bg);
    color: var(--gp-text);
    border-color: var(--gp-text-muted);
    transform: none;
}

/* Contador de resultados */
.gp-results-count {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gp-border-light);
    font-size: 13px;
    color: var(--gp-text-secondary);
}

#gp-count-number {
    font-weight: 700;
    color: var(--gp-primary);
}

/* =========================
   LOADING
   ========================= */
.gp-loading {
    text-align: center;
    padding: 48px 16px;
}

.gp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gp-border);
    border-top-color: var(--gp-primary);
    border-radius: 50%;
    animation: gp-rotate 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes gp-rotate {
    to { transform: rotate(360deg); }
}

.gp-loading p {
    font-size: 14px;
    color: var(--gp-text-muted);
    margin: 0;
}

.gp-grid-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* =========================
   GRID DE PAQUETES
   ========================= */
.gp-paquetes-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.2s ease;
}

/* =========================
   CARD DEL PAQUETE
   ========================= */
.gp-paquete-card {
    display: flex;
    flex-direction: column;
    background: var(--gp-white);
    border-radius: var(--gp-radius);
    overflow: hidden;
    border: 2px solid var(--gp-border);
    transition: all var(--gp-transition);
    box-shadow: var(--gp-shadow-sm);
}

.gp-paquete-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--gp-shadow-xl);
    border-color: var(--gp-accent);
}

/* === Imagen === */
.gp-paquete-imagen {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gp-bg);
}

.gp-paquete-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--gp-transition-slow);
}

.gp-paquete-card:hover .gp-paquete-img {
    transform: scale(1.06);
}

.gp-paquete-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--gp-primary);
    opacity: 0.5;
}

/* Badge de días sobre la imagen */
.gp-badge-dias {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

/* === Contenido === */
.gp-paquete-contenido {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.gp-paquete-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Destino */
.gp-destino {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gp-accent);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gp-destino svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Título */
.gp-titulo {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-text);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.gp-titulo a {
    color: inherit;
    text-decoration: none;
    transition: color var(--gp-transition);
}

.gp-titulo a:hover {
    color: var(--gp-primary);
}

/* Resumen */
.gp-resumen {
    font-size: 13px;
    color: var(--gp-text-secondary);
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Detalles (chips) === */
.gp-detalles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
}

.gp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gp-text-secondary);
    background: var(--gp-bg);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.gp-chip svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* === Footer (precio + botón) === */
.gp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--gp-border-light);
    margin-top: auto;
}

.gp-precio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gp-precio-label {
    font-size: 11px;
    color: var(--gp-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gp-precio {
    font-size: 24px;
    font-weight: 800;
    color: var(--gp-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* === Botón reservar === */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background-color: var(--gp-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--gp-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--gp-transition);
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(255, 84, 0, 0.2);
}

.gp-btn:hover {
    background-color: var(--gp-accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 84, 0, 0.35);
}

.gp-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.gp-btn svg {
    flex-shrink: 0;
    transition: transform var(--gp-transition);
}

.gp-btn:hover svg {
    transform: translateX(3px);
}

/* Variantes de botón */
.gp-btn-reset {
    margin-top: 16px;
    background: transparent;
    color: var(--gp-primary);
    border: 2px solid var(--gp-primary);
}

.gp-btn-reset:hover {
    background: var(--gp-primary);
    color: #fff;
}

/* =========================
   NO RESULTS
   ========================= */
.gp-no-results {
    text-align: center;
    padding: 64px 24px;
    background: var(--gp-white);
    border-radius: var(--gp-radius);
    border: 1px solid var(--gp-border);
}

.gp-no-results .gp-no-results-icon {
    color: var(--gp-border);
    margin-bottom: 16px;
    display: inline-block;
}

.gp-no-results h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gp-text);
    margin: 0 0 8px;
}

.gp-no-results p {
    font-size: 14px;
    color: var(--gp-text-muted);
    margin: 0;
}

/* =========================
   PAGINACIÓN
   ========================= */
.gp-pagination-wrapper {
    margin-top: 32px;
    text-align: center;
}

.gp-pagination-wrapper .nav-links,
.gp-pagination-wrapper ul {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.gp-pagination-wrapper .page-numbers,
.gp-pagination-wrapper li a,
.gp-pagination-wrapper li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    background: var(--gp-white);
    color: var(--gp-text-secondary);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--gp-transition);
}

.gp-pagination-wrapper .page-numbers:hover,
.gp-pagination-wrapper li a:hover {
    background: var(--gp-primary);
    color: #fff;
    border-color: var(--gp-primary);
}

.gp-pagination-wrapper .page-numbers.current,
.gp-pagination-wrapper li .current {
    background: var(--gp-primary);
    color: #fff;
    border-color: var(--gp-primary);
    font-weight: 700;
}

/* ============================
   TABLET (>= 768px)
   ============================ */
@media (min-width: 768px) {
    .gp-archive-wrapper {
        padding: 32px 0 56px;
    }

    .gp-container {
        padding: 0 24px;
    }

    .gp-archive-title {
        font-size: 34px;
    }

    .gp-archive-subtitle {
        font-size: 16px;
    }

    /* Filtros en fila */
    .gp-filters {
        padding: 20px 24px;
    }

    .gp-filters-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 12px;
    }

    .gp-filter-group {
        flex: 1;
        min-width: 140px;
    }

    .gp-filter-group-precio {
        min-width: 180px;
    }

    .gp-filter-actions {
        padding-top: 0;
        align-self: flex-end;
        flex-shrink: 0;
    }

    .gp-btn-filter {
        flex: none;
    }

    /* Card horizontal */
    .gp-paquete-card {
        flex-direction: row;
    }

    .gp-paquete-imagen {
        width: 260px;
        height: auto;
        min-height: 220px;
    }

    .gp-paquete-contenido {
        padding: 20px 24px;
        gap: 6px;
    }

    .gp-titulo {
        font-size: 20px;
    }

    .gp-resumen {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }

    .gp-precio {
        font-size: 24px;
    }

    .gp-paquetes-grid {
        gap: 16px;
    }
}

/* ============================
   DESKTOP (>= 992px)
   ============================ */
@media (min-width: 992px) {
    .gp-archive-wrapper {
        padding: 40px 0 64px;
    }

    .gp-container {
        padding: 0 32px;
    }

    .gp-archive-header {
        margin-bottom: 28px;
        padding: 24px 0 12px;
    }

    .gp-archive-title {
        font-size: 40px;
    }

    /* Filtros compactos */
    .gp-filters-row {
        flex-wrap: nowrap;
        gap: 14px;
    }

    .gp-filter-group {
        min-width: 0;
    }

    /* Card más grande */
    .gp-paquete-imagen {
        width: 320px;
        min-height: 250px;
    }

    .gp-paquete-contenido {
        padding: 24px 28px;
        gap: 8px;
    }

    .gp-titulo {
        font-size: 22px;
    }

    .gp-resumen {
        font-size: 14px;
    }

    .gp-precio {
        font-size: 26px;
    }

    .gp-btn {
        padding: 11px 24px;
        font-size: 14px;
    }

    .gp-paquetes-grid {
        gap: 20px;
    }
}

/* ============================
   WIDE (>= 1200px)
   ============================ */
@media (min-width: 1200px) {
    .gp-paquete-imagen {
        width: 360px;
    }
}

/* ============================
   MODAL DE DETALLES
   ============================ */

/* Overlay (fondo oscuro) */
.gp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

/* Contenedor del modal */
.gp-modal-container {
    background: var(--gp-white);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del modal */
.gp-modal-header {
    position: sticky;
    top: 0;
    background: var(--gp-white);
    border-bottom: 1px solid var(--gp-border);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 10;
}

.gp-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gp-text);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.gp-modal-close {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gp-text-light);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gp-modal-close:hover {
    background-color: var(--gp-bg);
    color: var(--gp-text);
}

.gp-modal-close svg {
    display: block;
}

/* Loading state */
.gp-modal-loading {
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: var(--gp-text-light);
}

.gp-modal-loading p {
    margin: 0;
    font-size: 15px;
}

/* Body del modal */
.gp-modal-body {
    padding: 24px;
}

/* Imagen del modal */
.gp-modal-image {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.gp-modal-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 400px;
}

.gp-modal-img-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--gp-bg) 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gp-text-light);
}

.gp-modal-img-placeholder svg {
    opacity: 0.4;
}

/* Chips de meta información */
.gp-modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.gp-chip-destino {
    background-color: var(--gp-primary);
    color: white;
}

/* Secciones del modal */
.gp-modal-section {
    margin-bottom: 28px;
}

.gp-modal-section:last-child {
    margin-bottom: 0;
}

.gp-modal-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-text);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.gp-modal-text {
    color: var(--gp-text-light);
    line-height: 1.7;
    font-size: 15px;
}

.gp-modal-text p {
    margin: 0 0 16px 0;
}

.gp-modal-text p:last-child {
    margin-bottom: 0;
}

/* Lista de detalles */
.gp-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.gp-modal-list li {
    display: flex;
    align-items: flex-start;
    color: var(--gp-text-light);
    font-size: 15px;
    line-height: 1.5;
}

.gp-modal-list li strong {
    color: var(--gp-text);
    font-weight: 600;
    min-width: 140px;
    flex-shrink: 0;
}

/* Footer del modal */
.gp-modal-footer {
    padding-top: 24px;
    border-top: 1px solid var(--gp-border);
}

.gp-modal-precio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gp-modal-precio-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gp-modal-precio-label {
    font-size: 13px;
    color: var(--gp-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gp-modal-precio {
    font-size: 32px;
    font-weight: 700;
    color: var(--gp-primary);
    line-height: 1;
}

/* Botón grande del modal */
.gp-btn-large {
    width: 100%;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 600;
    justify-content: center;
}

/* Estado de error en modal */
.gp-modal-error {
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    color: var(--gp-text-light);
}

.gp-modal-error svg {
    color: #ef4444;
    opacity: 0.6;
}

.gp-modal-error p {
    margin: 0;
    font-size: 15px;
    max-width: 400px;
}

/* Botón secundario en footer de cards */
.gp-footer-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.gp-btn-secondary {
    background: var(--gp-white);
    color: var(--gp-primary);
    border: 2px solid var(--gp-primary);
    flex: 1;
    box-shadow: none;
}

.gp-btn-secondary:hover {
    background: var(--gp-primary);
    color: var(--gp-white);
    box-shadow: 0 4px 12px rgba(18, 31, 65, 0.25);
}

.gp-btn-primary {
    flex: 1;
}

/* ============================
   MODAL RESPONSIVE
   ============================ */

@media (min-width: 768px) {
    .gp-modal-overlay {
        padding: 40px;
    }

    .gp-modal-header {
        padding: 28px 32px;
    }

    .gp-modal-title {
        font-size: 24px;
    }

    .gp-modal-body {
        padding: 32px;
    }

    .gp-modal-section h3 {
        font-size: 20px;
    }

    .gp-modal-precio-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .gp-btn-large {
        width: auto;
        min-width: 220px;
    }

    .gp-modal-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
