/* =============================================
   SiapTour — Shared Components
   Reusable UI components loaded globally.
   Used by: Tour, Accommodation, Blog, Rental, Front-page
   ============================================= */

/* --- Section Utilities --- */
.section-padding {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 48px;
}

.section-subtitle {
    font-size: var(--small-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: block;
}

.section-title {
    font-size: var(--h2-size);
    font-weight: 900;
    color: var(--heading-color);
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.section-desc {
    font-size: var(--body-size);
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.7;
}

/* --- Section Footer (View All Button) --- */
.section-footer {
    text-align: center;
    margin-top: 40px;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    font-size: var(--button-size);
    font-weight: 700;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view-all:hover {
    background: var(--primary-color);
    color: var(--cta-text-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
}

.btn-view-all svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.btn-view-all:hover svg {
    transform: translateX(4px);
}

/* ============================================
   Related Section — Heading Override (H3 size)
   ============================================ */

.related-tours .section-title,
.related-rooms .section-title,
.related-posts-section .section-title {
    font-size: var(--h3-size);
    font-weight: 800;
    color: var(--heading-color);
}

/* ============================================
   Single CTA Bar — Shared WhatsApp Component
   Inline bar inside related section (not separate section)
   ============================================ */

.single-cta-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding: 16px 24px;
    background: rgba(var(--heading-color-rgb), 0.03);
    border: 1px solid rgba(var(--heading-color-rgb), 0.06);
    border-radius: 12px;
}

.single-cta-bar__text {
    font-size: var(--secondary-size);
    color: var(--text-color);
    font-weight: 600;
}

.single-cta-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: var(--secondary-size);
    font-weight: 700;
    color: var(--cta-text-color);
    background: var(--wa-color);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.single-cta-bar__btn svg {
    width: 18px;
    height: 18px;
}

.single-cta-bar__btn:hover {
    background: var(--wa-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--wa-color-rgb), 0.3);
}

@media (max-width: 768px) {
    .single-cta-bar {
        flex-direction: column;
        text-align: center;
    }

    .single-cta-bar__btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Single Tour Hero Action Buttons --- */
.single-hero .hero-wa-btn,
.single-hero .hero-booking-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    min-height: 54px;
    border-radius: 16px;
    font-size: var(--small-size);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.single-hero .hero-wa-btn {
    background: rgba(var(--heading-color-rgb), 0.1);
    background: color-mix(in srgb, var(--heading-color) 10%, transparent);
    border: 1px solid rgba(var(--heading-color-rgb), 0.15);
    border: 1px solid color-mix(in srgb, var(--heading-color) 15%, transparent);
    color: var(--heading-color);
}

.single-hero .hero-wa-btn:hover {
    background: rgba(var(--heading-color-rgb), 0.2);
    background: color-mix(in srgb, var(--heading-color) 20%, transparent);
    border-color: rgba(var(--heading-color-rgb), 0.3);
    border-color: color-mix(in srgb, var(--heading-color) 30%, transparent);
    color: var(--heading-color);
}

.single-hero .hero-wa-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.single-hero .hero-booking-btn {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: var(--cta-text-color) !important;
}

.single-hero .hero-booking-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(var(--primary-color-rgb), 0.4);
}

/* Price highlight in hero */
.quick-value--price {
    color: var(--primary-color);
    font-size: var(--h4-size);
}

@media (max-width: 991px) {
    .single-hero .hero-wa-btn,
    .single-hero .hero-booking-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* --- WhatsApp Only Banner (in hero) --- */
.single-hero__wa-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(var(--wa-color-rgb), 0.2);
    border: 1px solid rgba(var(--wa-color-rgb), 0.4);
    border-radius: 12px;
}

.wa-banner__info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--secondary-size);
    font-weight: 700;
    color: var(--heading-color);
    line-height: 1.4;
}

.wa-banner__info svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wa-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--wa-color);
    color: var(--cta-text-color) !important;
    font-size: var(--small-size);
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.wa-banner__btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--wa-color-rgb), 0.3);
}

@media (max-width: 768px) {
    .single-hero__wa-banner {
        flex-direction: column;
        text-align: center;
    }

    .wa-banner__info {
        justify-content: center;
    }

    .wa-banner__btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Filter Tabs --- */
.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 24px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(var(--heading-color-rgb), 0.05);
}

.filter-tab {
    padding: 10px 24px;
    font-size: var(--secondary-size);
    font-weight: 600;
    color: var(--text-color);
    background: rgba(var(--heading-color-rgb), 0.03);
    border: 1px solid rgba(var(--heading-color-rgb), 0.08);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.filter-tab:hover,
.filter-tab--active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--cta-text-color);
}

@media (max-width: 768px) {
    .filter-tabs {
        gap: 8px;
    }

    .filter-tab {
        padding: 8px 18px;
        font-size: var(--small-size);
    }
}

/* --- Tour Card Component (shared by front-page + archive) --- */
.tour-card {
    background: var(--bg-color);
    border: 1px solid rgba(var(--heading-color-rgb), 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.tour-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.tour-card__image {
    position: relative;
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.tour-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.tour-card__placeholder {
    width: 100%;
    height: 100%;
    background: rgba(var(--heading-color-rgb), 0.05);
}

.tour-card__price {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary-color);
    color: var(--cta-text-color);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: var(--small-size);
    font-weight: 700;
}

.tour-card__content {
    padding: 24px;
}

.tour-card__title {
    font-size: var(--h5-size);
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tour-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tour-card__title a:hover {
    color: var(--primary-color);
}

.tour-card__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: var(--small-size);
    color: var(--text-color);
    opacity: 0.7;
}

.tour-card__duration,
.tour-card__destination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tour-card__meta svg {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.tour-card__btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: var(--small-size);
    font-weight: 700;
    color: var(--cta-text-color);
    background: var(--cta-bg-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Dual button row (reusable: tour, accommodation, rental slider, blog) */
.tour-card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

.tour-card__actions .tour-card__btn {
    flex: 1;
    text-align: center;
}

.tour-card__wa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--wa-color);
    background: rgba(var(--wa-color-rgb), 0.08);
    border: 1px solid rgba(var(--wa-color-rgb), 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tour-card__wa-icon svg {
    width: 18px;
    height: 18px;
}

.tour-card__wa-icon:hover {
    background: var(--wa-color);
    color: var(--cta-text-color);
    border-color: var(--wa-color);
}

/* Optional excerpt (used by blog card) */
.tour-card__excerpt {
    font-size: var(--small-size);
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Facilities Grid (Include/Exclude) --- */
.tour-facilities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tour-facilities-col {
    padding: 20px;
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.05);
    border-radius: 16px;
}

.facilities-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--body-size);
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(var(--heading-color-rgb), 0.08);
}

.tour-facilities--include .facilities-col-title {
    color: var(--success-color, #22C55E);
}

.tour-facilities--exclude .facilities-col-title {
    color: var(--error-color, #EF4444);
}

.facilities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.facility-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--heading-color-rgb), 0.05);
    font-size: var(--secondary-size);
    color: var(--text-color);
}

.facility-item:last-child {
    border-bottom: none;
}

.facility-item svg {
    flex-shrink: 0;
}

.facility-item--include svg {
    color: var(--success-color, #22C55E);
}

.facility-item--exclude svg {
    color: var(--error-color, #EF4444);
}

.facility-cost {
    font-size: var(--small-size);
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Keyboard focus states for accessibility */
button:focus-visible,
a.btn-main:focus-visible,
.btn-header-cta:focus-visible,
.footer-btn:focus-visible,
.share-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* --- Archive Pagination (shared by tour, blog, all archives) --- */
.archive-pagination {
    margin-top: 32px;
    margin-bottom: 48px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.archive-pagination .page-numbers {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--heading-color-rgb), 0.05);
    border-radius: 50%;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
}
.archive-pagination .page-numbers.current,
.archive-pagination .page-numbers:hover {
    background: var(--primary-color);
    color: var(--cta-text-color);
}
.archive-pagination .navigation.pagination {
    margin: 0;
}
.archive-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* --- Filter Dropdown (shared by accommodation + rental) --- */
.acc-filters__dropdown,
.rental-filters__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    min-width: 340px;
    max-width: 500px;
    background: var(--bg-color);
    border: 1px solid rgba(var(--heading-color-rgb), 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.acc-filters__dropdown.is-open,
.rental-filters__dropdown.is-open {
    display: block;
}

/* =============================================
   RESPONSIVE — 480px (Tour Card + Shared Components)
   ============================================= */
@media (max-width: 480px) {
    .tour-card__content {
        padding: 16px;
    }
    .tour-card__title {
        font-size: var(--content-size);
        margin-bottom: 10px;
    }
    .tour-card__meta {
        gap: 10px;
        font-size: var(--xs-size);
        margin-bottom: 12px;
    }
    .tour-card__btn {
        display: block;
        width: 100%;
        text-align: center;
    }
    .tour-card__actions {
        flex-direction: row;
    }
    .tour-card__actions .tour-card__btn {
        flex: 1;
    }
    .tour-card__price {
        padding: 6px 12px;
        font-size: var(--xs-size);
    }
    .tour-card__excerpt {
        font-size: var(--xs-size);
        margin-bottom: 12px;
    }
    /* Section utilities */
    .section-header {
        margin-bottom: 32px;
    }
    .filter-tabs {
        gap: 6px;
        padding: 16px 0;
        margin-bottom: 24px;
    }
    .filter-tab {
        padding: 7px 14px;
        font-size: var(--xs-size);
    }
}

/* =============================================
   Filter Loading Overlay
   ============================================= */
.filter-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bg-color-rgb), 0.6);
    z-index: 10;
    border-radius: 16px;
}

.filter-loading__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(var(--heading-color-rgb), 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: filterSpin 0.6s linear infinite;
}

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