/* ==========================================================================
   viator-perf.css — CLS reduction, accessibility, and design polish
   for all Viator pages (products, attractions, destinations).
   ========================================================================== */

/* ---- CLS: Reserve space for images ---- */
.ticket__pic {
    aspect-ratio: 674 / 446;
    overflow: hidden;
    background-color: #f0f0f0;
}

.ticket__pic picture,
.ticket__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hero/main-info image CLS fix */
.main-info__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #e8e8e8;
    min-height: 200px;
}

.main-info__image picture,
.main-info__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Swiper gallery CLS fix */
.gallery-main .swiper-slide {
    aspect-ratio: 674 / 446;
    overflow: hidden;
    background-color: #f0f0f0;
}

.gallery-main .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumbs .swiper-slide {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
}

.gallery-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Destination cards CLS fix */
.destinations-cards .product-item {
    aspect-ratio: 355 / 290;
    overflow: hidden;
    border-radius: 10px;
}

.destinations-cards .product-link {
    aspect-ratio: 355 / 290;
}

/* Tour card in similar-tours CLS fix */
.similar-tours .tour__img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
}

.similar-tours .tour__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ViatorProduct List — ticket item image CLS */
.viator-tickets__item-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: 8px;
}

.viator-tickets__item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- CLS: Reserve space for dynamic content ---- */
.tickets__wrapper {
    min-height: 400px;
}

.paging {
    min-height: 48px;
}

/* Sticker CLS: fixed size to avoid layout jumps */
.sticker,
.sticker-red {
    min-height: 50px;
    display: flex;
    align-items: center;
}

/* ---- Accessibility: Focus indicators ---- */
/* !important needed to override inline style="outline: none" on many buttons */
*:focus-visible {
    outline: 2px solid #1BBEF2 !important;
    outline-offset: 2px !important;
}

/* Tab buttons keyboard focus */
.tabs__title:focus-visible,
.tour-tabs__title:focus-visible {
    outline: 2px solid #1BBEF2;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Spoller buttons keyboard accessible */
.spollers-filter__title:focus-visible {
    outline: 2px solid #1BBEF2;
    outline-offset: 2px;
}

/* Filter tag buttons keyboard accessible */
.spoller__tag:focus-visible {
    outline: 2px solid #1BBEF2;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Paging buttons keyboard accessible */
.paging__btn:focus-visible {
    outline: 2px solid #1BBEF2;
    outline-offset: 2px;
}

/* Links focus */
a:focus-visible {
    outline: 2px solid #1BBEF2;
    outline-offset: 2px;
}

/* ---- Accessibility: Star ratings for screen readers ---- */
.rating__stars {
    display: inline-flex;
    gap: 2px;
}

.rating__stars .fa-star {
    font-size: 16px;
    color: #ccc;
    transition: color 0.2s ease;
}

.rating__stars .fa-star.checked {
    color: #FFB800;
}

/* ---- Design polish: Card improvements ---- */
.ticket {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    overflow: hidden;
    background: #fff;
}

.ticket:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
}

.ticket__content {
    padding: 16px;
    line-height: 1.6;
}

.ticket__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.ticket__description {
    line-height: 1.6;
    color: #5A5A5A;
    font-size: 0.95rem;
}

/* ---- Design polish: Buttons ---- */
.more-btn {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #1BBEF2, #43D9E8);
    color: #fff;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.more-btn:hover,
.more-btn:focus {
    background: linear-gradient(135deg, #0fa8d8, #36c8da);
    box-shadow: 0 2px 8px rgba(27, 190, 242, 0.3);
    color: #fff;
    text-decoration: none;
}

.send-form {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #1BBEF2, #43D9E8);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.send-form:hover,
.send-form:focus {
    background: linear-gradient(135deg, #0fa8d8, #36c8da);
    box-shadow: 0 3px 12px rgba(27, 190, 242, 0.35);
    color: #fff;
    text-decoration: none;
}

/* ---- Design polish: Consistent spacing ---- */
.tour-tabs__navigation,
.tabs__navigation {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tour-tabs__title,
.tabs__title {
    padding: 10px 20px;
    border: none;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    color: #5A5A5A;
}

.tour-tabs__title._tab-active,
.tabs__title._tab-active {
    background: #1BBEF2;
    color: #fff;
}

.tour-tabs__title:hover,
.tabs__title:hover {
    background: #e0f7fe;
    color: #1BBEF2;
}

.tour-tabs__title._tab-active:hover,
.tabs__title._tab-active:hover {
    background: #0fa8d8;
    color: #fff;
}

/* ---- Design polish: Breadcrumbs ---- */
.breadcrumbs-block,
.breadcrumbs-main {
    font-size: 0.9rem;
    line-height: 1.8;
}

.breadcrumb-main {
    color: #1BBEF2;
    text-decoration: none;
}

.breadcrumb-main:hover {
    text-decoration: underline;
}

/* ---- Design polish: Review bars ---- */
.review-star__line {
    height: 8px;
    background: #1BBEF2;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ---- Design polish: Price text ---- */
.price-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.guarantee {
    color: #27ae60;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ---- Design polish: Overview content ---- */
.overview p,
.main-content {
    line-height: 1.7;
    color: #444;
}

.overview h3,
.overview h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* ---- Design polish: Inclusions/Exclusions ---- */
.included-item {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 24px;
    line-height: 1.6;
}

.included-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.excluded-item {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 24px;
    line-height: 1.6;
}

.excluded-item::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #e74c3c;
    font-weight: bold;
}

/* ---- Design polish: Spoller/accordion sections ---- */
.spollers-filter__title {
    padding: 12px 16px;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    background: #f9f9f9;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 4px;
}

.spollers-filter__title:hover {
    background: #f0f0f0;
}

.spollers-filter__title._spoller-active {
    background: #e0f7fe;
    color: #1BBEF2;
}

/* ---- Design polish: Filter tag pills ---- */
.spoller__tag {
    display: inline-block;
    padding: 6px 14px;
    margin: 4px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.spoller-tag-active {
    background: #1BBEF2;
    color: #fff;
    border-color: #1BBEF2;
}

.spoller-tag-inactive:hover {
    border-color: #1BBEF2;
    color: #1BBEF2;
}

/* ---- Design polish: Destination cards ---- */
.destinations-cards .product-item {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    border-radius: 10px;
    overflow: hidden;
}

.destinations-cards .product-item:hover {
    transform: translateY(-3px);
}

.destinations-cards .product-name {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---- Design polish: Search form ---- */
.attractions-search__head {
    padding: 2rem 0;
}

.attractions-search__head-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

/* ---- Design polish: Paging ---- */
.paging {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 16px 0;
}

.paging__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    color: #5A5A5A;
}

.paging__btn:hover {
    background: #e0f7fe;
    color: #1BBEF2;
}

.paging__btn-active {
    background: #1BBEF2;
    color: #fff;
}

.paging__btn-active:hover {
    background: #0fa8d8;
    color: #fff;
}

.paging__arrow {
    background: #fff;
    border: 1px solid #ddd;
}

.paging__arrow:hover {
    border-color: #1BBEF2;
}

.paging__arrow img {
    width: 14px;
    height: 14px;
}

/* ---- Accessibility: Contrast improvements ---- */
.unactive-rating {
    color: #666;
}

.location-link {
    color: #1BBEF2;
    text-decoration: underline;
}

.location-link:hover {
    color: #0fa8d8;
}

/* ---- CLS: Prevent layout shift from tab content ---- */
.tabs__content {
    min-height: 200px;
}

/* ---- Performance: Contain paint for cards ---- */
.ticket,
.product-item {
    contain: layout style;
}

/* ---- Accessibility: Hidden text for screen readers ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   SYSTEMIC CLS FIXES — Header, Fonts, Sections, JS-rendered content
   ========================================================================== */

/* ---- CLS: Font-display swap for Font Awesome ---- */
/* Override FA 4.7 @font-face which ships without font-display */
@font-face {
    font-family: 'FontAwesome';
    font-display: swap;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2') format('woff2'),
         url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff') format('woff');
}

/* Ensure FA icons always reserve space even before font loads */
.fa {
    display: inline-block;
    min-width: 1em;
    text-align: center;
}

/* ---- CLS: Header / navigation ---- */
.header-new {
    contain: layout style;
    height: 70px;
    box-sizing: border-box;
}

.brand-new img {
    width: 54px;
    height: 30px;
}

.search-new__icon-new {
    width: 12px;
    height: 12px;
}

/* ---- CLS: Section min-heights to prevent content jumps ---- */

/* JS-rendered product list (ViatorProduct/List.cshtml) */
#js-viator-product-list {
    min-height: 400px;
}

/* Pagination container (ViatorProduct/List) */
.js-pager {
    min-height: 48px;
}

/* City promo hero section */
.city-promo {
    min-height: 250px;
}

/* Breadcrumbs bar */
.breadcrumbs-block {
    min-height: 28px;
}

/* Tour intro wrapper (product detail page) */
.tour-intro__wrapper {
    min-height: 350px;
}

/* Viator tours filter form */
.viator-tours__filter {
    min-height: 80px;
}

/* Viator product list items (Mustache template targets) */
.viator-tickets__item {
    min-height: 180px;
}

/* Swiper tag slider */
.swiper-tags {
    min-height: 40px;
}

/* Overview slider container */
.overview-slider {
    min-height: 44px;
}

/* Overview service icons (transport, plane, etc.) */
.overview-service img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* Filter sidebar */
.spollers-filter {
    min-height: 48px;
}

/* Similar tours grid */
.similar-tours {
    min-height: 200px;
}

/* Tour order sidebar */
.order {
    min-height: 150px;
}

/* Slider gallery container */
.slider-gallery {
    min-height: 300px;
}

/* Footer CLS prevention */
footer .footer-wrap {
    min-height: 50px;
}

footer .footer-menu {
    min-height: 30px;
}

/* ---- CLS: Prevent FOUT/FOIT layout shifts ---- */
/* Size-adjust fallback for Raleway-Black loaded async */
body {
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

/* Ensure descriptions don't collapse before content loads */
.description,
.main-content,
.block__content {
    min-height: 1em;
}

/* Attractions list tab panel */
.variants {
    min-height: 300px;
}

/* Tour description section */
.tour-tabs .tabs__content {
    min-height: 300px;
}

/* Attraction mask (description with show more) */
.attraction-mask {
    min-height: 60px;
}

/* ---- CLS: Paging arrow images explicit dimensions ---- */
.paging__arrow img {
    width: 8px;
    height: 13px;
    display: block;
}

/* ---- CLS: Audio guides section ---- */
.audio-guides-block,
.card.mt-3 {
    min-height: 60px;
}

/* ---- CLS: Cookie consent bar ---- */
.cookie-consent {
    min-height: 40px;
}
