/* =================================================================
   TOUR SEARCH — Styles
   Matches tour-styles.css conventions: --cc-* variables, rounded
   corners, soft shadows, blue primary (#0066a1).
   ================================================================= */

.tour-search-bar,
.tour-search-suggest,
.tour-search-lightbox {
    --tsx-primary: var(--cc-primary, #0066a1);
    --tsx-secondary: var(--cc-secondary, #00a896);
    --tsx-accent: var(--cc-accent, #f77f00);
    --tsx-dark: var(--cc-dark, #1a1a2e);
    --tsx-light: var(--cc-light, #f8f9fa);
    --tsx-text: var(--cc-text, #333);
    --tsx-text-light: var(--cc-text-light, #666);
    --tsx-border: #e5e7eb;
    --tsx-radius: 12px;
    --tsx-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --tsx-shadow-lg: 0 12px 40px rgba(0,0,0,0.18);
}

/* =================================================================
   INPUT WRAPPER (shared)
   ================================================================= */

.tour-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--tsx-border);
    border-radius: var(--tsx-radius);
    padding: 0 14px;
    transition: border-color .15s, box-shadow .15s;
}

.tour-search-input-wrap:focus-within {
    border-color: var(--tsx-primary);
    box-shadow: 0 0 0 3px rgba(0,102,161,0.12);
}

.tour-search-icon {
    flex: 0 0 auto;
    color: var(--tsx-text-light);
    margin-right: 10px;
}

.tour-search-input {
    flex: 1 1 auto;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 12px 0;
    font-size: 15px;
    color: var(--tsx-text);
    font-family: inherit;
    min-width: 0;
}

.tour-search-input:focus,
.tour-search-input:active {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tour-search-input::placeholder {
    color: var(--tsx-text-light);
}

.tour-search-clear {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--tsx-text-light);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    line-height: 0;
    transition: background .15s, color .15s;
}

.tour-search-clear:hover {
    background: var(--tsx-light);
    color: var(--tsx-text);
}

/* =================================================================
   INLINE BAR
   ================================================================= */

.tour-search-bar {
    position: relative;
    width: 100%;
    max-width: 560px;
}

.tour-search-bar--inline .tour-search-input-wrap {
    box-shadow: var(--tsx-shadow);
}

/* =================================================================
   SUGGEST DROPDOWN
   ================================================================= */

.tour-search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--tsx-radius);
    box-shadow: var(--tsx-shadow-lg);
    max-height: 480px;
    overflow-y: auto;
    z-index: 9000;
    padding: 6px;
}

.tour-search-suggest[hidden] {
    display: none;
}

.tsx-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--tsx-text);
    transition: background .12s;
}

.tsx-row:hover,
.tsx-row-active {
    background: var(--tsx-light);
}

.tsx-row-thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--tsx-light);
}

.tsx-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tsx-row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.tsx-row-title {
    font-weight: 600;
    color: var(--tsx-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tsx-row-sub {
    font-size: 13px;
    color: var(--tsx-text-light);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tsx-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
}

.tsx-row-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--tsx-text-light);
}

.tsx-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--tsx-text);
}

.tsx-rating-star {
    color: #f5a623;
    font-size: 14px;
    line-height: 1;
}

.tsx-rating-count {
    color: var(--tsx-text-light);
    font-weight: 400;
}

.tsx-price-now {
    font-weight: 700;
    color: var(--tsx-primary);
}

.tsx-price-was {
    color: var(--tsx-text-light);
    text-decoration: line-through;
    font-size: 12px;
}

.tsx-no-results {
    padding: 20px;
    text-align: center;
    color: var(--tsx-text-light);
    font-size: 14px;
}

.tsx-suggest-more {
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    background: var(--tsx-primary);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    font-size: 14px;
    font-family: inherit;
}

.tsx-suggest-more:hover {
    background: #005288;
}

/* =================================================================
   LIGHTBOX
   ================================================================= */

.tour-search-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: flex-start;
    justify-content: center;
}

.tour-search-lightbox.tsx-open {
    display: flex;
}

.tour-search-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.tour-search-lightbox-shell {
    position: relative;
    width: calc(100% - 60px);
    max-height: calc(100vh - 60px);
    margin: 30px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: tsx-fade-in .2s ease-out;
}

@keyframes tsx-fade-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.tour-search-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: white;
    border: 1px solid var(--tsx-border);
    color: var(--tsx-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .15s, color .15s;
}

.tour-search-lightbox-close:hover {
    background: var(--tsx-text);
    color: white;
    border-color: var(--tsx-text);
}

/* Lightbox header */
.tour-search-lightbox-header {
    padding: 20px 24px 14px;
    padding-right: 64px; /* room for close button */
    border-bottom: 1px solid var(--tsx-border);
    flex: 0 0 auto;
}

.tour-search-lightbox-header .tour-search-input-wrap {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--tsx-border);
    border-radius: 0;
    box-shadow: none;
    padding: 0 4px;
    transition: border-color .15s;
}

.tour-search-lightbox-header .tour-search-input-wrap:focus-within {
    box-shadow: none;
    border-bottom-color: var(--tsx-primary);
}

.tour-search-lightbox-header .tour-search-input {
    font-size: 17px;
    padding: 14px 0;
}

.tour-search-meta {
    margin-top: 10px;
    font-size: 13px;
    color: var(--tsx-text-light);
}

/* Lightbox body */
.tour-search-lightbox-body {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.tour-search-filters {
    flex: 0 0 320px;
    background: var(--tsx-light);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--tsx-border);
}

.tsx-filter-group {
    border: none;
    padding: 0;
    margin: 0 0 18px 0;
}

.tsx-filter-group legend {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tsx-text);
    margin-bottom: 8px;
    padding: 0;
}

.tsx-filter-cat {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    color: var(--tsx-text);
    cursor: pointer;
}

.tsx-filter-cat input {
    margin-right: 8px;
    accent-color: var(--tsx-primary);
}

.tsx-bucket-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tsx-bucket-row label {
    flex: 0 0 auto;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--tsx-border);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.tsx-bucket-row label:has(input:checked) {
    border-color: var(--tsx-primary);
    background: rgba(0,102,161,0.08);
    font-weight: 600;
}

.tsx-bucket-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tsx-filter-reset {
    width: 100%;
    margin-top: 8px;
    padding: 9px;
    background: white;
    border: 1px solid var(--tsx-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--tsx-text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, color .15s;
}

.tsx-filter-reset:hover {
    border-color: var(--tour-btn, #d01824);
    color: var(--tour-btn, #d01824);
}

/* Results */
.tour-search-results {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.tsx-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.tsx-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--tsx-radius);
    overflow: hidden;
    text-decoration: none !important;
    color: var(--tsx-text);
    box-shadow: var(--tsx-shadow);
    transition: transform .15s, box-shadow .15s;
    position: relative;
}

.tsx-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.tsx-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--tsx-light);
    overflow: hidden;
}

.tsx-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tsx-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}

.tsx-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--tsx-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tsx-card-sub {
    font-size: 13px;
    color: var(--tsx-text-light);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tsx-card-meta {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}

.tsx-card-price {
    font-weight: 700;
    color: var(--tsx-primary);
    font-size: 15px;
}

.tsx-card-price .tsx-price-was {
    font-size: 12px;
    margin-right: 4px;
}

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

@media (max-width: 768px) {
    .tour-search-lightbox-shell {
        width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .tour-search-lightbox-body {
        flex-direction: column;
    }

    .tour-search-filters {
        flex: 0 0 auto;
        max-height: 38vh;
        border-right: none;
        border-bottom: 1px solid var(--tsx-border);
    }

    .tour-search-lightbox-header {
        padding: 16px 18px 12px;
        padding-right: 56px;
    }

    .tsx-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .tsx-card-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tour-search-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .tsx-card-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tour-search-suggest {
        max-height: 60vh;
    }
}
