/**
 * Archive Tours V2 - Clean Card Design (Reference Image Style)
 * Card: 360px × 520px
 * Image: 320px height
 * Content: 200px height (centered)
 */

/* ============================================================
   CONTAINER & BACKGROUND
   ============================================================ */
.roamease-tours-archive.v2 {
    background: inherit;
}

.roamease-tours-archive.v2 .container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding-left: clamp(18px, 3.5vw, 60px);
    padding-right: clamp(18px, 3.5vw, 60px);
    box-sizing: border-box;
}

@media (min-width: 1280px) {
    .roamease-tours-archive.v2 .container {
        max-width: 1600px;
    }
}

.roamease-tours-archive.v2 .archive-body .container {
    padding-top: 8px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.roamease-tours-archive.v2 .archive-hero {
    background: transparent;
    padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1rem, 2.5vw, 2rem);
    text-align: center;
}

.roamease-tours-archive.v2 .archive-hero .hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color:#333333;
    margin: 0 0 clamp(0.75rem, 1.5vw, 1rem);
}

.roamease-tours-archive.v2 .archive-hero .hero-text {
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    color: #6b7280;
    margin: 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   ARCHIVE BODY
   ============================================================ */
.roamease-tours-archive.v2 .archive-body {
    background: transparent;
    padding: 12px 0 24px;
}

.roamease-tours-archive.v2 .layout {
    display: grid;
    grid-template-columns: clamp(260px, 20vw, 300px) minmax(0, 1fr);
    gap: clamp(18px, 2.4vw, 32px);
    align-items: start;
}

.roamease-tours-archive.v2 .results {
    flex: 1 1 auto;
    min-width: 0;
}

/* ============================================================
   GRID LAYOUT
   ============================================================ */
.tours-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 20px;
    margin: clamp(1.25rem, 2.4vw, 2rem) 0;
}

/* Desktop: 3 cards */
@media (min-width: 1025px) {
    .tours-grid-v2 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablet: 2 cards */
@media (min-width: 641px) and (max-width: 1024px) {
    .tours-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
        gap: 16px;
    }
}

/* Mobile: 1 card */
@media (max-width: 640px) {
    .tours-grid-v2 {
        grid-template-columns: 1fr;
        justify-content: center;
        gap: 16px;
    }
}

/* ============================================================
   TOUR CARD - MAIN STRUCTURE
   ============================================================ */
.tours-grid-v2 .tour-card,
.tours-grid-v2 .tour-card.card-style-reference {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 400px;
    height: 520px;
    min-height: 520px !important;
    max-height: 520px !important;
    margin: 0 auto;
}

.tours-grid-v2 .tour-card:hover,
.tours-grid-v2 .tour-card.card-style-reference:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   IMAGE SECTION - 220PX HEIGHT
   ============================================================ */
.tours-grid-v2 .tour-card .tour-image {
    width: 100%;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    overflow: hidden;
    flex: 0 0 220px;
    position: relative;
    background: #f5f5f5;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    line-height: 0;
    font-size: 0;
    display: block;
}

.tours-grid-v2 .tour-card .tour-image a,
.tours-grid-v2 .tour-card.card-style-reference .tour-image a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    line-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    overflow: hidden;
}

.tours-grid-v2 .tour-card .tour-image img,
.tours-grid-v2 .tour-card.card-style-reference .tour-image img {
    width: calc(100% + 2px) !important;
    height: calc(100% + 2px) !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    display: block !important;
    position: absolute !important;
    top: -1px !important;
    left: -1px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: top;
    max-width: none !important;
    max-height: none !important;
}

/* Duration Badge - Top Left */
.tours-grid-v2 .tour-card .tour-image .ref-duration,
.tours-grid-v2 .tour-card.card-style-reference .tour-image .ref-duration {
    position: absolute;
    top: 14px;
    left: 14px;
    width: auto;
    min-width: 64px;
    height: auto;
    background: var(--e-global-color-primary, #083321);
    color: var(--e-global-color-secondary, #FEBC11);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    z-index: 2;
}

.tours-grid-v2 .tour-card .tour-image .ref-duration span,
.tours-grid-v2 .tour-card.card-style-reference .tour-image .ref-duration span {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--e-global-typography-secondary-font-family, 'Poppins'), sans-serif;
}

/* Price Badge - Top Right (hidden, using tour-type instead) */
.tours-grid-v2 .tour-card .tour-image .price-badge,
.tours-grid-v2 .tour-card.card-style-reference .tour-image .price-badge {
    display: none;
}

/* Tour Meta Container - Contains Duration (left) and Tour Type (right) */
.tours-grid-v2 .tour-card .tour-meta {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin: 0 !important;
    padding: 14px !important;
    z-index: 3;
    pointer-events: none;
}

/* Duration Badge - Top Left on Image */
.tours-grid-v2 .tour-card .tour-meta .duration {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--e-global-color-primary, #083321);
    color: var(--e-global-color-secondary, #FEBC11);
    border: none;
    border-radius: 8px;
    font-family: var(--e-global-typography-secondary-font-family, 'Poppins'), sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: auto;
}

/* Tour Type pill styling on image - Top Right */
.tours-grid-v2 .tour-card .tour-meta .tour-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--e-global-color-primary, #083321);
    border: none;
    border-radius: 8px;
    font-family: var(--e-global-typography-secondary-font-family, 'Poppins'), sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    margin-left: auto;
    pointer-events: auto;
}

.tours-grid-v2 .tour-card .tour-meta .tour-type:hover {
    background: var(--e-global-color-primary, #083321);
    color: var(--e-global-color-secondary, #FEBC11);
}

/* Hide the "+" more types indicator */
.tours-grid-v2 .tour-card .tour-meta .tour-type-more {
    display: none !important;
}

/* No Image Placeholder */
.tours-grid-v2 .tour-card .tour-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f6f4 0%, #ebe7e3 100%);
    color: var(--e-global-color-text, #666);
    font-family: var(--e-global-typography-text-font-family, 'Poppins'), sans-serif;
    font-size: 14px;
    font-style: italic;
    opacity: 0.7;
}

/* Hide ALL prices on archive v2 cards */
.tours-grid-v2 .tour-card .tour-price,
.tours-grid-v2 .tour-card .tour-price-inline,
.tours-grid-v2 .tour-card.card-style-reference .tour-price {
    display: none !important;
}

/* ============================================================
   CONTENT AREA - 300PX HEIGHT (CENTERED)
   ============================================================ */
.tours-grid-v2 .tour-card .tour-content,
.tours-grid-v2 .tour-card.card-style-reference .tour-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 0 20px 20px 20px !important;
    height: 300px;
    max-height: 300px;
    text-align: center;
}

/* Reference cards (Archive V2): balanced vertical spacing */
.tours-grid-v2 .tour-card.card-style-reference .tour-content {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
}

/* Tour Title - Centered, Uppercase */
.tours-grid-v2 .tour-card .tour-title,
.tours-grid-v2 .tour-card.card-style-reference .tour-title {
    font-family: var(--e-global-typography-primary-font-family, 'Playfair Display'), serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    height: auto;
    max-height: 72px;
    margin: 0 0 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tour Title Link - Primary color, Secondary on hover */
.tours-grid-v2 .tour-card .tour-title a,
.tours-grid-v2 .tour-card.card-style-reference .tour-title a {
    color: var(--e-global-color-primary, #083321);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tours-grid-v2 .tour-card .tour-title a:hover,
.tours-grid-v2 .tour-card.card-style-reference .tour-title a:hover {
    color: var(--e-global-color-secondary, #FEBC11);
}

/* Tour Description - Centered, 3 Lines */
.tours-grid-v2 .tour-card .tour-description,
.tours-grid-v2 .tour-card.card-style-reference .tour-excerpt {
    font-family: var(--e-global-typography-text-font-family, 'Poppins'), sans-serif;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--e-global-color-text, #111212);
    margin: 0 !important;
    height: auto !important;
    max-height: 63px !important;
    min-height: 42px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    text-align: center;
    opacity: 0.85;
}

/* Reference cards footer layout */
.tours-grid-v2 .tour-card.card-style-reference .ref-footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    gap: 12px !important;
}

/* Comfortable separation from description */
.tours-grid-v2 .tour-card.card-style-reference .ref-footer {
    margin-top: 8px !important;
}

/* Reference cards: when start-from block is removed, center the CTA */
.tours-grid-v2 .tour-card.card-style-reference .ref-footer.ref-footer--center {
    justify-content: center !important;
}

/* Price Section Container */
.tours-grid-v2 .tour-card.card-style-reference .ref-footer .start-from {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.tours-grid-v2 .tour-card .tour-meta .starting-from,
.tours-grid-v2 .tour-card.card-style-reference .ref-footer .start-from .label {
    font-size: 13px;
    line-height: 1.3;
    color: #000;
    font-weight: 600;
    margin-bottom: 2px;
    text-align: left;
}

.tours-grid-v2 .tour-card .tour-meta .taxes-info,
.tours-grid-v2 .tour-card.card-style-reference .ref-footer .start-from .sub {
    font-size: 10px;
    line-height: 1.2;
    color: #6b7280;
    text-transform: uppercase;
    text-align: left;
}

/* CTA Button - Centered */
.tours-grid-v2 .tour-card .tour-cta,
.tours-grid-v2 .tour-card.card-style-reference .tour-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.tours-grid-v2 .tour-card.card-style-reference .ref-footer .btn-book-now,
.tours-grid-v2 .tour-card .tour-cta .btn,
.tours-grid-v2 .tour-card.card-style-reference .tour-actions .btn-book-now {
    width: 100%;
    max-width: 280px;
    min-width: 180px;
    height: 48px;
    font-size: 13px;
    border-radius: 8px;
    background: var(--e-global-color-primary, #083321) !important;
    color: var(--e-global-color-secondary, #FEBC11) !important;
    font-family: var(--e-global-typography-secondary-font-family, 'Poppins'), sans-serif;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 24px;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
}

.tours-grid-v2 .tour-card.card-style-reference .ref-footer .btn-book-now:hover,
.tours-grid-v2 .tour-card .tour-cta .btn:hover,
.tours-grid-v2 .tour-card.card-style-reference .tour-actions .btn-book-now:hover {
    background: var(--e-global-color-secondary, #FEBC11) !important;
    color: var(--e-global-color-primary, #083321) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   FILTERS SIDEBAR — A&K-INSPIRED PROFESSIONAL DESIGN
   ============================================================ */
.roamease-tours-archive.v2 .filters-sidebar {
    width: clamp(260px, 22vw, 320px);
    flex-shrink: 0;
    background: transparent !important;
    border: none;
    border-radius: 0;
    padding: 20px 0;
    box-shadow: none;
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
}

.roamease-tours-archive.v2 .filter-block {
    margin-bottom: 0;
    border-bottom: 1px solid #e8ddd6;
}

.roamease-tours-archive.v2 .filter-block:first-child {
    border-top: 1px solid #e8ddd6;
}

/* Filter section headers — clean, professional */
.roamease-tours-archive.v2 .filter-block .block-title {
    width: 100%;
    background: none;
    border: none;
    border-radius: 0 !important;
    position: relative;
    padding: 16px 18px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--e-global-color-primary, #083321);
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
    text-align: left;
}

.roamease-tours-archive.v2 .filter-block .block-title:hover {
    background-color: rgba(199, 147, 117, 0.04);
    color: var(--e-global-color-primary, #C79375);
}

.roamease-tours-archive.v2 .filter-block .block-title .title-text {
    color: inherit;
    flex: 1 1 auto;
    text-transform: uppercase;
    font-size: 13px;
    text-align: left;
}

/* Right arrow indicator — clean triangle like A&K */
.roamease-tours-archive.v2 .filter-block .block-title .caret {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.65;
    transition: transform 0.25s ease, opacity 0.25s ease;
    flex: 0 0 auto;
    margin-left: auto;
}

.roamease-tours-archive.v2 .filter-block.collapsed .block-title .caret {
    transform: rotate(45deg);
    opacity: 0.55;
}

.roamease-tours-archive.v2 .filter-block .block-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.roamease-tours-archive.v2 .filter-block:not(.collapsed) .block-body {
    padding: 14px 18px 22px;
    /* overflow set to visible via JS transitionend so bottom content never clips */
}

.roamease-tours-archive.v2 .pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.roamease-tours-archive.v2 .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: fit-content;
    height: 32px;
    padding: 6px 10px;
    background: transparent;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1.5px solid var(--e-global-color-primary, #C79375);
    color: var(--e-global-color-primary, #C79375);
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Pills now wrap inline - no fixed grid spanning needed */
.roamease-tours-archive.v2 .pill.pill--long {
    white-space: nowrap;
}

.roamease-tours-archive.v2 .pill.pill--xlong {
    white-space: nowrap;
}

/* Tablet: flex layout maintains naturally */
@media (max-width: 1024px) {
    .roamease-tours-archive.v2 .pill-list {
        gap: 7px;
    }
    .roamease-tours-archive.v2 .pill {
        height: 31px;
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Mobile: flex layout wraps naturally */
@media (max-width: 640px) {
    .roamease-tours-archive.v2 .pill-list {
        gap: 6px;
    }
    .roamease-tours-archive.v2 .pill {
        height: 30px;
        font-size: 11px;
        padding: 6px 9px;
    }
}

/* Dimmed: destination not available for selected country */
.roamease-tours-archive.v2 .pill.pill--dimmed {
    opacity: 0.28;
    pointer-events: none;
    cursor: default;
    border-style: dashed;
}

.roamease-tours-archive.v2 .pill:hover {
    border-color: var(--e-global-color-primary, #C79375);
    background: rgba(199, 147, 117, 0.08);
    transform: translateY(-1px);
}

.roamease-tours-archive.v2 input[type="checkbox"]:checked + .pill {
    background: var(--e-global-color-primary, #C79375);
    color: var(--e-global-color-accent, #fff);
    border-color: var(--e-global-color-primary, #C79375);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(199, 147, 117, 0.2);
}

/* Filter pill list “SHOW MORE” toggle (text-style, not a boxed button) */
.roamease-tours-archive.v2 .filter-show-more {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    padding: 10px 0 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--e-global-color-text, #111827);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

.roamease-tours-archive.v2 .filter-show-more:hover {
    color: var(--e-global-color-primary, #C79375);
}

.roamease-tours-archive.v2 .filter-show-more:focus {
    outline: none;
}

.roamease-tours-archive.v2 .filter-show-more:focus-visible {
    outline: 2px solid var(--e-global-color-primary, #C79375);
    outline-offset: 3px;
    border-radius: 6px;
}

.roamease-tours-archive.v2 .filter-show-more .caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.75;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.roamease-tours-archive.v2 .filter-show-more[aria-expanded="true"] .caret {
    transform: rotate(-135deg);
    opacity: 0.85;
}

/* ============================================================
   SEARCH & RESULTS BAR
   ============================================================ */
.roamease-tours-archive.v2 .results-search {
    margin-bottom: 28px;
}

.roamease-tours-archive.v2 .search-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.roamease-tours-archive.v2 .search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    height: 48px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.roamease-tours-archive.v2 .search-input:focus {
    outline: none;
    border-color: var(--e-global-color-primary, #C79375);
    box-shadow: 0 0 0 3px rgba(199, 147, 117, 0.1);
}

.roamease-tours-archive.v2 .btn.btn-primary {
    flex-shrink: 0;
    min-width: 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--e-global-color-primary, #C79375);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.roamease-tours-archive.v2 .btn.btn-primary:hover {
    background: var(--e-global-color-primary-dark, #a0664d);
    transform: translateY(-1px);
}
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.2s ease, color 0.2s ease;
}

.roamease-tours-archive.v2 .btn.btn-primary:hover {
    background: var(--e-global-color-secondary, #333333);
    color: var(--e-global-color-primary, #C79375);
}

.roamease-tours-archive.v2 .results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: transparent !important;
    border: 1px solid var(--e-global-color-primary, #C79375);
    border-radius: 12px;
}

.roamease-tours-archive.v2 .results-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roamease-tours-archive.v2 .active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.roamease-tours-archive.v2 .active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 14px;
    border: 1px solid var(--e-global-color-primary, #C79375);
    background: #fff;
    color: #000;
    font-size: 12px;
    line-height: 1;
}

.roamease-tours-archive.v2 .active-chip button {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 14px;
}

.roamease-tours-archive.v2 .btn-clear {
    padding: 8px 12px;
    background: transparent;
    color: var(--e-global-color-primary, #C79375);
    border: 1px solid var(--e-global-color-primary, #C79375);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

/* Mobile/Tablet: EDIT FILTERS Button (hidden on desktop) */
.roamease-tours-archive.v2 button.btn-edit-filters,
.roamease-tours-archive.v2 .btn-edit-filters[type="button"],
.roamease-tours-archive.v2 .btn-edit-filters[type="submit"],
.roamease-tours-archive.v2 .btn-edit-filters {
    display: none;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    color: var(--e-global-color-primary, #C79375);
    border: 1px solid var(--e-global-color-primary, #C79375);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    text-align: center;
}

.roamease-tours-archive.v2 button.btn-edit-filters:hover,
.roamease-tours-archive.v2 button.btn-edit-filters:focus,
.roamease-tours-archive.v2 button.btn-edit-filters:focus-visible,
.roamease-tours-archive.v2 .btn-edit-filters:hover,
.roamease-tours-archive.v2 .btn-edit-filters:focus,
.roamease-tours-archive.v2 .btn-edit-filters:focus-visible {
    background: var(--e-global-color-primary, #C79375);
    color: var(--e-global-color-accent, #fff);
    border-color: var(--e-global-color-primary, #C79375);
}

.btn-edit-filters svg {
    width: 20px;
    height: 20px;
}

/* Filters Backdrop (mobile/tablet only) */
.filters-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filters-backdrop.active {
    opacity: 1;
}

/* Filters Header (modal title + close button) */
.filters-header {
    display: none;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: space-between;
    background: var(--e-global-color-secondary, #fff);
}

.filters-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.btn-close-filters {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #111827;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filters Footer (VIEW ALL JOURNEYS button) */
.filters-footer {
    display: none;
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
    background: var(--e-global-color-secondary, #fff);
}

.btn-apply-filters {
    width: 100%;
    padding: 14px 20px;
    background: var(--e-global-color-primary, #C79375);
    color: var(--e-global-color-accent, #fff);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-apply-filters:hover {
    background: var(--e-global-color-secondary, #333333);
}

/* Desktop: Keep normal layout */
@media (min-width: 1025px) {
    .btn-edit-filters,
    .filters-backdrop,
    .filters-header,
    .filters-footer {
        display: none !important;
    }

    .roamease-tours-archive.v2 .filters-sidebar {
        position: sticky;
        top: 20px;
    }
}

@media (max-width: 1024px) {
    /* Show EDIT FILTERS button on tablet/mobile - full width */
    .roamease-tours-archive.v2 .btn-edit-filters {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        align-self: stretch;
        justify-content: center;
        text-align: center;
        margin-left: 0 !important;
        margin-right: 0 !important;
        height: 48px;
        border-radius: 8px;
        padding: 0 18px;
    }

    /* Ensure the results column can constrain width like the search bar */
    .roamease-tours-archive.v2 .results {
        width: 100%;
    }

    /* Match vertical rhythm: button then search */
    .roamease-tours-archive.v2 .results .btn-edit-filters {
        margin-bottom: 12px;
    }

    /* Ensure search bar elements have equal height */
    .roamease-tours-archive.v2 .search-input,
    .roamease-tours-archive.v2 .btn.btn-primary {
        height: 48px;
    }

    /* Hide sidebar by default, show as modal when active */
    .roamease-tours-archive.v2 .filters-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        /* Modal panel background should come from Elementor globals */
        background: var(--e-global-color-accent, var(--e-global-color-secondary, #fff)) !important;
        color: var(--e-global-color-text, #111827);
        border-radius: 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        overflow: hidden;
        transform: translateY(100%);
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s ease, visibility 0.3s ease, opacity 0.3s ease;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .roamease-tours-archive.v2 .filters-sidebar.active {
        transform: translateY(0);
        visibility: visible;
        opacity: 1;
    }

    /* Show modal header and footer on mobile (force-visible) */
    .roamease-tours-archive.v2 .filters-sidebar .filters-header,
    .roamease-tours-archive.v2 .filters-sidebar .filters-footer {
        display: flex !important;
    }

    .roamease-tours-archive.v2 .filters-sidebar .filters-header {
        min-height: 64px;
        align-items: center;
    }

    .roamease-tours-archive.v2 .filters-sidebar .filters-header .btn-close-filters {
        display: flex !important;
        visibility: visible;
    }

    /* Make the form the scroll container so footer never overlaps pills */
    .roamease-tours-archive.v2 .filters-sidebar form {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
        padding-bottom: 28px;
        background: transparent;
    }

    /* Modal header/footer should match the panel background */
    .roamease-tours-archive.v2 .filters-header,
    .roamease-tours-archive.v2 .filters-footer {
        background: transparent;
        color: inherit;
    }

    /* Remove divider line between header and first filter group (per screenshot) */
    .roamease-tours-archive.v2 .filters-header {
        border-bottom: 0 !important;
        flex: 0 0 auto;
    }

    .roamease-tours-archive.v2 .filters-sidebar form .filter-block:first-child .block-title {
        border-top: 0 !important;
    }

    .roamease-tours-archive.v2 .filters-title {
        color: inherit;
        width: 100%;
        text-align: center;
        font-family: var(--e-global-typography-heading-font-family, var(--e-global-typography-primary-font-family, inherit));
        font-weight: var(--e-global-typography-heading-font-weight, 700);
    }

    .roamease-tours-archive.v2 .btn-close-filters {
        color: inherit;
        opacity: 0.8;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        outline: none;
    }

    .roamease-tours-archive.v2 .filters-header {
        position: relative;
        justify-content: center;
    }

    .roamease-tours-archive.v2 .filters-header .btn-close-filters {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Footer button: same style as EDIT FILTERS (outline primary, fill on hover) */
    .roamease-tours-archive.v2 .filters-footer {
        justify-content: center;
        flex: 0 0 auto;
        position: relative;
        bottom: auto;
        background: var(--e-global-color-accent, var(--e-global-color-secondary, #fff)) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.08);
        z-index: 1;
    }

    .roamease-tours-archive.v2 button.btn-apply-filters,
    .roamease-tours-archive.v2 .btn-apply-filters[type="button"],
    .roamease-tours-archive.v2 .btn-apply-filters[type="submit"],
    .roamease-tours-archive.v2 .btn-apply-filters {
        width: min(100%, 320px);
        margin: 0 auto;
        background: transparent;
        color: var(--e-global-color-primary, #C79375);
        border: 1px solid var(--e-global-color-primary, #C79375);
        text-align: center;
    }

    .roamease-tours-archive.v2 button.btn-apply-filters:hover,
    .roamease-tours-archive.v2 button.btn-apply-filters:focus,
    .roamease-tours-archive.v2 button.btn-apply-filters:focus-visible,
    .roamease-tours-archive.v2 .btn-apply-filters:hover,
    .roamease-tours-archive.v2 .btn-apply-filters:focus,
    .roamease-tours-archive.v2 .btn-apply-filters:focus-visible {
        background: var(--e-global-color-primary, #C79375);
        color: var(--e-global-color-accent, #fff);
        border-color: var(--e-global-color-primary, #C79375);
    }

    /* Modal filter sections: subtle separators like the reference UI */
    .roamease-tours-archive.v2 .filters-sidebar .filter-block .block-title {
        border-top-color: rgba(0, 0, 0, 0.12);
    }

    /* Modal pills: neutral border/text; selected uses primary */
    .roamease-tours-archive.v2 .filters-sidebar .pill {
        background: #fff;
        border-color: rgba(0, 0, 0, 0.18);
        color: var(--e-global-color-text, #111827);
    }

    .roamease-tours-archive.v2 .filters-sidebar .pill:hover {
        border-color: rgba(0, 0, 0, 0.30);
        background: #fff;
    }

    .roamease-tours-archive.v2 .filters-sidebar input[type="checkbox"]:checked + .pill {
        background: var(--e-global-color-primary, #C79375);
        border-color: var(--e-global-color-primary, #C79375);
        color: var(--e-global-color-accent, #fff);
    }

    .tours-grid-v2 .tour-card .tour-image {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        flex: 0 0 220px;
    }
    
    .roamease-tours-archive.v2 .layout {
        display: flex;
        flex-direction: column;
    }

    /* Tour grid: 2 columns on tablet */
    .tours-grid-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .tours-grid-v2 .tour-card {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    /* Tour grid: 1 column on mobile */
    .tours-grid-v2 {
        grid-template-columns: 1fr;
    }

    .tours-grid-v2 .tour-card {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
        height: auto;
        min-height: 500px;
    }
    
    .tours-grid-v2 .tour-card .tour-image {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
        flex: 0 0 200px;
    }
    
    .tours-grid-v2 .tour-card .tour-content {
        height: auto;
        max-height: none;
        padding: 20px 16px;
    }
    
    .tours-grid-v2 .tour-card .tour-title {
        font-size: 16px;
        line-height: 22px;
    }

    /* Mobile modal takes more screen height */
    .roamease-tours-archive.v2 .filters-sidebar {
        height: 90vh;
        max-height: 90vh;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.tours-grid-v2 .tour-card.reveal-base {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
}

.tours-grid-v2 .tour-card.reveal-base.inview {
    opacity: 1;
    transform: none;
}

/* Loading State */
.re-v2-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    gap: 12px;
}

.re-v2-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--e-global-color-accent, #2C7BE5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
