/* ============================================
   TIANTRAVEL — SEARCH PAGE STYLES
   Mobile-first, premium design
   ============================================ */

/* Search Hero */
.search-hero {
    position: relative;
    height: 300px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 40px;
    margin-top: 80px; /* header height */
    overflow: hidden;
}

.search-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1f2421 0%, #2d4a3e 50%, #c5a059 100%);
    z-index: 1;
}

.search-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('assets/images/turkey_resort_1775659383299.png') center/cover;
    opacity: 0.2;
}

.search-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 2;
}

.search-hero-content {
    position: relative;
    z-index: 3;
    color: white;
}

.search-hero-content h1 {
    font-size: clamp(32px, 5vw, 56px);
    color: white;
    margin-bottom: 8px;
}

.search-hero-content p {
    font-size: 18px;
    opacity: 0.85;
}

/* Header nav */
.header-nav {
    display: flex;
    gap: 24px;
}

.header-nav a {
    text-decoration: none;
    color: var(--color-text-mut);
    font-size: 15px;
    transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--color-gold);
    font-weight: 600;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form-section {
    background: white;
    padding: 0 0 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* Форма поиска + панель фильтров справа */
.search-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 28px;
    align-items: start;
}

.search-form {
    background: white;
    border-radius: 20px;
    padding: 36px;
    margin-top: -40px;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.search-inline-filters {
    margin-top: -40px;
    position: sticky;
    top: 96px;
    z-index: 9;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.search-inline-filters .filters-hint {
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-mut);
    margin: 0 0 12px;
    padding-top: 4px;
    border-top: 1px solid #eee;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-mut);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="date"],
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
    padding: 13px 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-dark);
    transition: border-color 0.25s;
    background: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-gold);
    background: white;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--color-text-mut);
    font-size: 14px;
}

.select-wrapper select {
    width: 100%;
    padding: 13px 16px;
    padding-right: 36px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    background: #fafafa;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.25s;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--color-gold);
}

/* Night slider */
.range-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-group input[type="range"] {
    flex: 1;
    height: 4px;
    accent-color: var(--color-gold);
    cursor: pointer;
}

/* Counter */
.counter-group {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}

.counter-btn {
    background: none;
    border: none;
    width: 44px;
    height: 46px;
    font-size: 22px;
    color: var(--color-gold);
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
    border-radius: 0;
}

.counter-btn:hover {
    background: #f5f0e8;
}

.counter-group input[type="number"] {
    flex: 1;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--color-dark);
    padding: 0;
    width: 50px;
    pointer-events: none;
}

/* Children ages */
.children-ages {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.child-age-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 80px;
}

.child-age-input label {
    font-size: 12px;
    color: var(--color-text-mut);
}

.child-age-input select {
    padding: 10px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
}

/* Search Button */
.btn-search {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--color-gold) 0%, #a68444 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(197, 160, 89, 0.3);
    margin-top: 10px;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(197, 160, 89, 0.4);
}

.btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
    padding: 40px 0 80px;
    background: #f5f5f5;
    /* scrollIntoView aligns top to viewport; fixed header (~80px) would cover content without offset */
    scroll-margin-top: 96px;
}

/* Loading Bar */
.loading-bar-wrap {
    text-align: center;
    padding: 40px 20px;
}

.loading-bar-inner {
    height: 4px;
    background: linear-gradient(90deg, var(--color-gold) 0%, #f0d58c 50%, var(--color-gold) 100%);
    border-radius: 4px;
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    max-width: 600px;
    margin: 0 auto 20px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-text {
    color: var(--color-text-mut);
    font-size: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h2 {
    font-size: 22px;
}

.results-header h2 span {
    color: var(--color-gold);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-mut);
}

.sort-controls select {
    padding: 8px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
}

/* Выдача: сетка на всю ширину (фильтры — в блоке над результатами) */
.results-layout {
    display: block;
    width: 100%;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters-header h3 {
    font-size: 18px;
}

.clear-filters {
    background: none;
    border: none;
    color: var(--color-gold);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

/* Apply Filters Button */
.btn-apply-filters {
    width: 100%;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--color-gold) 0%, #a68444 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(197, 160, 89, 0.3);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.4);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-mut);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 10px;
}

.stars-filter,
.meal-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stars-filter label,
.meal-filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 400;
    color: var(--color-dark);
    text-transform: none;
    letter-spacing: 0;
}

.filter-group input[type="range"] {
    width: 100%;
    accent-color: var(--color-gold);
    margin: 6px 0;
}

.filter-group span {
    font-size: 14px;
    color: var(--color-gold);
    font-weight: 600;
}

/* Tours Grid */
.tours-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Tour Card */
.tour-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    display: grid;
    grid-template-columns: 280px 1fr;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tour-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.tour-card-img {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    background: #ddd;
}

.tour-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tour-card:hover .tour-card-img img {
    transform: scale(1.05);
}

.tour-card-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e0d4, #c5a059);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.stars-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.6);
    color: #f9c74f;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.tour-card-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tour-card-header h3 {
    font-size: 22px;
    margin-bottom: 6px;
    color: var(--color-dark);
}

.tour-resort {
    font-size: 14px;
    color: var(--color-text-mut);
    margin-bottom: 16px;
}

.tour-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tour-tag {
    background: #f5f0e8;
    color: #7a6340;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tour-tag.highlight {
    background: #e8f5e9;
    color: #2e7d32;
}

.tour-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.tour-price-block .price-usd {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-dark);
    font-family: var(--font-heading);
}

.tour-price-block .price-local {
    font-size: 14px;
    color: var(--color-text-mut);
}

.btn-want-tour {
    background: var(--color-gold);
    color: white;
    border: none;
    padding: 13px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-want-tour:hover {
    background: var(--color-gold-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(197,160,89,0.35);
}

/* Fallback block */
.fallback-block {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    margin-top: 40px;
}

.fallback-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.fallback-block h3 {
    font-size: 26px;
    margin-bottom: 10px;
}

.fallback-block p {
    color: var(--color-text-mut);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Filters Button */
.mobile-filters-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-dark);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.filters-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    z-index: 201;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.filters-drawer.active {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.drawer-header h3 {
    font-size: 20px;
}

#closeDrawer {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-text-mut);
    cursor: pointer;
    line-height: 1;
}

/* Lead Modal */
.modal-overlay .modal-content h3 {
    font-size: 26px;
    margin-bottom: 6px;
}

.selected-tour-summary {
    background: #f9f5ee;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-text-mut);
    border-left: 3px solid var(--color-gold);
}

.selected-tour-summary strong {
    color: var(--color-dark);
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.phone-input-group {
    display: flex;
    gap: 0;
}

.phone-prefix {
    padding: 13px 12px;
    border: 1.5px solid #e8e8e8;
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-family: var(--font-body);
    font-size: 14px;
    background: #fafafa;
    cursor: pointer;
    min-width: 110px;
}

.phone-input-group input {
    flex: 1;
    border-radius: 0 10px 10px 0 !important;
    border-left: none !important;
}

.wa-same-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-mut);
    cursor: pointer;
    font-weight: 400;
}

.full-width {
    width: 100%;
}

.lead-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.lead-success h4 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #2e7d32;
}

.lead-success p {
    color: var(--color-text-mut);
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 900px) {
    .search-form-layout {
        grid-template-columns: 1fr;
    }

    .search-inline-filters {
        position: static;
        max-height: none;
        margin-top: 0;
    }

    /* Скрываем только сайдбар в выдаче (если появится); панель у формы остаётся */
    .filters-sidebar:not(.search-inline-filters) {
        display: none !important;
    }

    .mobile-filters-btn {
        display: block;
    }

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

    .tour-card-img {
        min-height: 200px;
    }
}

@media (max-width: 650px) {
    .search-form {
        padding: 24px 18px;
        margin-top: -20px;
        border-radius: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .search-hero-content h1 {
        font-size: 30px;
    }

    .header-nav {
        display: none;
    }

    .tour-card-body {
        padding: 18px;
    }

    .tour-price-block .price-usd {
        font-size: 22px;
    }
}
