/* =====================================================================
   Country Tours — Grid Layout & Filters
   ===================================================================== */

/* ── Section ─────────────────────────────────────────────────────── */
.cp-tours {
    background: transparent;
    padding: 72px 0 80px;
}

.cp-tours__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 80px);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── Title row ───────────────────────────────────────────────────── */
.cp-tours__title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.cp-tours__h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: #111214;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.cp-tours__h3 {
    font-size: 0.875rem;
    color: rgba(17, 18, 20, 0.5);
    margin: 6px 0 0;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ── Filter bar ──────────────────────────────────────────────────── */
.cp-tours__filters {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: visible;
    position: relative;
    width: fit-content;
    margin: 0 auto;
}

/* Single filter cell */
.cpt-filter {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    min-width: 180px;
    cursor: pointer;
}

.cpt-filter--date {
    min-width: 210px;
}

.cpt-filter__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(17, 18, 20, 0.45);
    margin-bottom: 4px;
    user-select: none;
}

.cpt-filter__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.cpt-filter__val {
    font-size: 13px;
    font-weight: 500;
    color: #111214;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.cpt-filter__val--input {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #111214;
    width: 180px;
}

.cpt-filter__val--input::placeholder {
    color: rgba(17, 18, 20, 0.38);
}

/* Flatpickr overrides */
.flatpickr-calendar {
    font-family: inherit;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.09);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #FF6A00;
    border-color: #FF6A00;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #e05d00;
    border-color: #e05d00;
}

.flatpickr-day.inRange {
    background: rgba(255, 106, 0, 0.12);
    border-color: transparent;
    box-shadow: -5px 0 0 rgba(255, 106, 0, 0.12), 5px 0 0 rgba(255, 106, 0, 0.12);
}

.flatpickr-day.today {
    border-color: #FF6A00;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #FF6A00;
}

.cpt-filter__clear {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: rgba(17, 18, 20, 0.6);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s;
}

.cpt-filter__clear:hover {
    background: rgba(0, 0, 0, 0.15);
}

.cpt-filter__chevron {
    flex-shrink: 0;
    color: rgba(17, 18, 20, 0.35);
    transition: transform 0.2s;
}

.cpt-filter--open .cpt-filter__chevron {
    transform: rotate(180deg);
}

/* Separator */
.cpt-filter__sep {
    width: 1px;
    height: 36px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    align-self: center;
}

/* Note */
.cpt-filter__note {
    font-size: 11px;
    color: rgba(17, 18, 20, 0.4);
    padding: 0 16px;
    white-space: nowrap;
    align-self: center;
}

/* ── Country dropdown panel ──────────────────────────────────────── */
.cpt-filter__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    z-index: 200;
    overflow: hidden;
}

.cpt-filter__search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.cpt-filter__search {
    width: 100%;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 13px;
    color: #111214;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.cpt-filter__search::placeholder {
    color: rgba(17, 18, 20, 0.35);
}

.cpt-filter__search:focus {
    border-color: rgba(255, 106, 0, 0.5);
}

.cpt-filter__list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.cpt-filter__list::-webkit-scrollbar {
    width: 4px;
}
.cpt-filter__list::-webkit-scrollbar-track {
    background: transparent;
}
.cpt-filter__list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

/* Country option rows */
.cpt-country-opt {
    padding: 9px 16px;
    font-size: 13px;
    color: rgba(17, 18, 20, 0.75);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.cpt-country-opt:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #111214;
}

.cpt-country-opt.is-selected {
    color: #FF6A00;
    font-weight: 600;
}

.cpt-country-opt--all {
    color: rgba(17, 18, 20, 0.4);
    font-size: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 4px;
    padding-bottom: 10px;
}

/* ── Grid wrapper ────────────────────────────────────────────────── */
.cp-tours__grid-wrap {
    position: relative;
}

.cp-tours__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    transition: opacity 0.2s;
}

/* ── Tour card ───────────────────────────────────────────────────── */
.cp-tour-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 300px;
    opacity: 0;
    animation: cpTourFadeIn 0.5s ease forwards;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.cp-tour-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

@keyframes cpTourFadeIn {
    to { opacity: 1; }
}

/* Image — fills full card height */
.cp-tour-card__img {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
}

.cp-tour-card__img-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.45s ease;
}

.cp-tour-card:hover .cp-tour-card__img-bg {
    transform: scale(1.05);
}

/* Gradient overlay — subtle by default, stronger on hover */
.cp-tour-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 25%,
        rgba(0,0,0,0.55) 60%,
        rgba(0,0,0,0.82) 100%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.45;
    transition: opacity 0.3s ease;
}

.cp-tour-card:hover::after {
    opacity: 1;
}

/* Body — overlaid at bottom, no background */
.cp-tour-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
}

/* Crumb */
.cp-tour-card__crumb {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.7);
    flex-wrap: wrap;
}

.cp-tour-card__crumb-cat {
    color: #FF6A00;
    font-weight: 700;
}

/* Title */
.cp-tour-card__title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-tour-card__title a {
    color: inherit;
    text-decoration: none;
}

/* Dates — hidden by default, slide in on hover */
.cp-tour-card__dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.cp-tour-card:hover .cp-tour-card__dates {
    max-height: 320px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cp-tour-card__dates span {
    font-size: 12px;
    color: #FF6A00;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.cp-tour-card__dates span i {
    font-size: 10px;
    margin-right: 3px;
    opacity: 0.85;
}

.cp-tour-card__date--extra {
    display: none;
}

.cp-tour-card__dates.is-expanded .cp-tour-card__date--extra {
    display: block;
}

.cp-tour-card__dates-more {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 0 0;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.cp-tour-card__dates-more:hover {
    color: #fff;
}

/* Meta */
.cp-tour-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.cp-tour-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.cp-tour-card__meta-item i {
    font-size: 11px;
    opacity: 0.65;
}

/* Footer */
.cp-tour-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 6px;
}

/* Rating */
.cp-tour-card__rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.cp-tour-card__stars {
    color: #FF6A00;
    font-size: 10px;
    letter-spacing: -1px;
}

/* Price */
.cp-tour-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cp-tour-card__price-label {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cp-tour-card__price-value {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── Loading overlay ─────────────────────────────────────────────── */
.cpt-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 18, 20, 0.6);
    z-index: 10;
    border-radius: 8px;
}

.cpt-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #FF6A00;
    border-radius: 50%;
    animation: cptSpin 0.75s linear infinite;
}

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

/* ── Empty state ─────────────────────────────────────────────────── */
.cpt-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 64px 20px;
    color: rgba(17, 18, 20, 0.35);
    text-align: center;
}

.cpt-empty i {
    font-size: 36px;
    opacity: 0.35;
}

.cpt-empty p {
    font-size: 14px;
    margin: 0;
}

/* ── Section footer ──────────────────────────────────────────────── */
.cp-tours__footer {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.cp-tours__more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: #FF6A00;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.18s, transform 0.15s;
}

.cp-tours__more-btn:hover {
    background: #e05d00;
    transform: translateY(-1px);
}

/* ── Pagination ──────────────────────────────────────────────────── */
.cpt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-top: 8px;
}

.cpt-pagination__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(17, 18, 20, 0.18);
    border-radius: 4px;
    color: rgba(17, 18, 20, 0.65);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}

.cpt-pagination__btn:hover:not(:disabled) {
    border-color: #FF6A00;
    color: #FF6A00;
    background: rgba(255, 106, 0, 0.06);
}

.cpt-pagination__btn--next {
    background: #FF6A00;
    border-color: #FF6A00;
    color: #fff;
}

.cpt-pagination__btn--next:hover:not(:disabled) {
    background: #e05d00;
    border-color: #e05d00;
    color: #fff;
}

.cpt-pagination__btn:disabled {
    opacity: 0.28;
    cursor: default;
}

.cpt-pagination__info {
    font-size: 13px;
    color: rgba(17, 18, 20, 0.5);
    min-width: 80px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cp-tours__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cp-tours__filters {
        width: 100%;
        flex-wrap: wrap;
    }

    .cpt-filter {
        min-width: 0;
        flex: 1;
    }

    .cpt-filter__note {
        padding: 8px 16px;
    }
}

@media (max-width: 600px) {
    .cp-tours {
        padding: 48px 0 60px;
    }

    .cp-tours__grid {
        grid-template-columns: 1fr;
    }

    .cp-tour-card {
        height: 260px;
    }

    .cp-tours__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .cpt-filter {
        min-width: 0;
        width: 100%;
    }

    .cpt-filter__sep {
        width: 100%;
        height: 1px;
    }
}
