/* Hide pagination when infinite scroll is active */
.has-infinite-scroll .camping-pagination {
    display: none !important;
}

/* Preview with toggle on the right */
.card-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    column-gap: 12px;
    align-items: center;
}

.card-preview__text {
    min-width: 0;
}

/* Preview toggle - three animated chevrons (right side) */
.preview-toggle {
    width: 72px;
    min-height: 52px;
    margin: 0 0 2px;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    color: #687381;
    user-select: none;
    outline: none;
}

.preview-toggle:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 4px;
    border-radius: 4px;
}

.preview-toggle__chevron {
    width: 18px;
    height: 18px;
    border-right: 4px solid currentColor;
    border-bottom: 4px solid currentColor;
    transform: rotate(45deg);
    opacity: 0;
    margin-top: -6px;
}

/* Sequential animation for chevrons */
@keyframes previewChevronFlow {
    0% {
        opacity: 0;
        transform: translateY(-3px) rotate(45deg);
    }
    25% {
        opacity: 1;
        transform: translateY(0) rotate(45deg);
    }
    55% {
        opacity: 0.55;
        transform: translateY(3px) rotate(45deg);
    }
    100% {
        opacity: 0;
        transform: translateY(6px) rotate(45deg);
    }
}

.preview-toggle:not(.is-hidden) .preview-toggle__chevron {
    animation: previewChevronFlow 1.4s ease-in-out infinite;
}

.preview-toggle:not(.is-hidden) .preview-toggle__chevron:nth-child(1) {
    animation-delay: 0s;
}

.preview-toggle:not(.is-hidden) .preview-toggle__chevron:nth-child(2) {
    animation-delay: 0.18s;
}

.preview-toggle:not(.is-hidden) .preview-toggle__chevron:nth-child(3) {
    animation-delay: 0.36s;
}

/* Hide toggle after expansion */
.preview-toggle.is-hidden {
    display: none;
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    .preview-toggle__chevron {
        animation: none !important;
        opacity: 1;
    }
}

/* Preview text color consistency */
.card-preview,
.card-preview-text,
.card-preview-full {
    color: inherit;
}

.card-preview-full {
    color: inherit;
}

/* Media wrapper for image + nav */
.list-card-media {
    min-width: 0;
}

/* Thumb container - remove gradients */
.list-card-media .thumb {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    background: transparent;
}

/* Remove gradients from thumb variants */
.thumb.lake,
.thumb.mountain,
.thumb.forest,
.thumb {
    background: transparent;
}

.thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    position: relative;
}

.thumb-link img,
.thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.thumb[data-card-gallery] {
    cursor: pointer;
}

/* Badge overlay - improved visibility */
.thumb .badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 28px);
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    color: #101921;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(16, 25, 33, .10);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

/* Gallery navigation - pill indicators below image */
.card-gallery-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 12px;
    margin-top: 7px;
    line-height: 0;
}

.card-gallery-nav[hidden] {
    display: none !important;
}

.card-gallery-nav__dot {
    display: block;
    width: 5px;
    height: 4px;
    border-radius: 999px;
    background: rgba(104, 115, 129, .35);
    opacity: .75;
    transform: scaleX(1);
    transition:
        width .24s cubic-bezier(.22,.61,.36,1),
        opacity .24s ease,
        background-color .24s ease,
        transform .24s cubic-bezier(.22,.61,.36,1);
}

.card-gallery-nav__dot.is-active {
    width: 18px;
    opacity: 1;
    background: #687381;
    transform: scaleX(1.04);
}

/* Update date below gallery nav */
.card-update-date {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.3;
    color: #687381;
    text-align: center;
}

.card-update-date strong {
    color: #384554;
    font-weight: 700;
}

/* ========================================
   Object Feature Icons (42×42, no background)
   ======================================== */

.object-feature-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
}

.object-feature-icon {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    outline: none;
}

.object-feature-icon:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
    border-radius: 4px;
}

.object-feature-icon img {
    width: 42px;
    height: 42px;
    display: block;
    pointer-events: none;
}

/* Tooltip */
.object-feature-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    max-width: 260px;
    padding: 8px 11px;
    border-radius: 10px;
    background: #101921;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    z-index: 25;
    box-shadow: 0 6px 18px rgba(16, 25, 33, .24);
    transition: 
        opacity .2s ease,
        transform .2s ease;
}

.object-feature-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #101921;
}

.object-feature-icon:hover .object-feature-tooltip,
.object-feature-icon:focus-visible .object-feature-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Rating Block: Inline SVG with linearGradient
   ======================================== */

.object-meta--rating {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

/* 5-star rating display - flex row of individual SVGs */
.rating-stars {
    display: flex;
    align-items: center;
    gap: 0;
    width: calc(32px * 5);
    height: 32px;
    line-height: 0;
}

.rating-star-svg {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: block;
}

.rating-star-shape {
    vector-effect: non-scaling-stroke;
}

/* Rating summary: number + votes */
.rating-summary {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #384554;
    font-size: 12px;
    line-height: 1.2;
}

.rating-summary strong {
    font-size: 16px;
    font-weight: 900;
    color: #101921;
}

.rating-summary span {
    font-size: 12px;
    font-weight: 800;
    color: #687381;
}

/* Remove pill styling in rating block */
.object-meta--rating .pill,
.list-card .pill--rating,
.list-card .pill--votes {
    background: transparent;
    border: 0;
    padding: 0;
}

/* ========================================
   Grid Mode: Bottom Alignment
   ======================================== */

.content-view.is-grid .list-card {
    display: flex !important;
    flex-direction: column;
}

.content-view.is-grid .list-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content-view.is-grid .list-card-body .object-feature-icons {
    margin-top: auto;
}

.content-view.is-grid .side-price {
    flex: 0 0 auto;
}

.content-view.is-grid .list-card .side-price {
    border-left: none;
    padding-left: 0;
}

/* Unified catalog rating and favorite tooltip */
.content-view .list-card:hover,
.content-view .list-card:focus-within {
    position: relative;
    z-index: 30;
}

.content-view.is-grid .list-card .side-price {
    display: flex !important;
    width: 100%;
    min-width: 0;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 14px;
    padding-left: 0 !important;
    border-left: 0 !important;
}

.content-view.is-grid .list-card .side-price .object-meta--rating {
    align-items: flex-start !important;
    margin: 0 !important;
}

.content-view.is-list .list-card .side-price {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}

.content-view.is-list .list-card .side-price .object-meta--rating {
    align-items: flex-end !important;
    margin: 0 0 auto !important;
}

.content-view .list-card .rating-summary strong {
    font-size: 24px;
    line-height: 1;
}

.content-view .list-card .rating-summary span {
    font-size: 11px;
    white-space: nowrap;
}

.content-view .list-card .object-meta--rating.is-empty .rating-summary strong {
    color: #101921;
}

.content-view .list-card .camp-favorite-button--catalog-photo {
    overflow: visible;
}

.content-view .list-card .camp-favorite-button--catalog-photo::after {
    position: absolute;
    z-index: 90;
    top: calc(100% + 10px);
    right: 0;
    display: block;
    max-width: min(260px, calc(100vw - 32px));
    padding: 8px 11px;
    border-radius: 10px;
    background: #101921;
    color: #fff;
    box-shadow: 0 6px 18px rgba(16, 25, 33, .24);
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.content-view .list-card .camp-favorite-button--catalog-photo::before {
    position: absolute;
    z-index: 91;
    top: calc(100% + 4px);
    right: 14px;
    width: 0;
    height: 0;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #101921;
    border-left: 6px solid transparent;
    content: '';
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.content-view .list-card .camp-favorite-button--catalog-photo:hover::after,
.content-view .list-card .camp-favorite-button--catalog-photo:focus-visible::after,
.content-view .list-card .camp-favorite-button--catalog-photo:hover::before,
.content-view .list-card .camp-favorite-button--catalog-photo:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile: adjust sizes */
@media (max-width: 767px) {
    .card-preview {
        grid-template-columns: 1fr;
    }
    
    .preview-toggle {
        justify-self: center;
        margin-top: 4px;
        width: 100px;
    }
    
    /* Hide gallery nav on mobile */
    .card-gallery-nav {
        display: none !important;
    }
    
    /* Hide update date on mobile */
    .card-update-date {
        display: none;
    }
    
    /* Feature icons: keep 42×42 on mobile */
    .object-feature-icons {
        gap: 6px;
        margin: 12px 0 0;
    }
    
    .object-feature-icon {
        width: 42px;
        height: 42px;
    }
    
    .object-feature-icon img {
        width: 42px;
        height: 42px;
    }
    
    /* Tooltip: use title fallback on mobile, hide CSS tooltip */
    .object-feature-tooltip {
        display: none;
    }
    
    /* Rating stars: 32×32 on mobile (same as desktop) */
    .rating-stars {
        width: calc(32px * 5);
        height: 32px;
    }
    
    .rating-star-svg {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    .object-feature-icon,
    .object-feature-tooltip {
        transition: none !important;
    }
}
