/* ==========================================================================
   Booking CRO Styles
   Extracted from inline blocks in single-1.php and form-booking-production.php
   Token-ized for design system consistency.
   ========================================================================== */

/* ==========================================================================
   1. Tour Page Typography
   ========================================================================== */

.st-single-tour h1 {
    font-size: var(--fs-h1, 30px);
    line-height: var(--lh-snug, 1.2);
    font-weight: var(--weight-bold, 700);
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .st-single-tour h1 {
        font-size: 2.5rem;
    }
}

.st-single-tour h2 {
    font-size: var(--fs-h2, 24px);
    font-weight: var(--weight-bold, 700);
    margin-bottom: var(--space-md, 1rem);
    line-height: var(--lh-head, 1.25);
}

.st-single-tour h3 {
    font-size: var(--fs-h3, 20px);
    font-weight: var(--weight-bold, 700);
    margin-bottom: var(--space-md, 1rem);
    line-height: 1.3;
}

.st-single-tour .lead {
    font-size: 1.125rem;
    line-height: var(--lh-body, 1.6);
}

.st-single-tour .lh-relaxed {
    line-height: var(--lh-body, 1.6);
}


/* ==========================================================================
   2. Tour Page Layout & Gallery
   ========================================================================== */

/* Clean light gray background */
.st-single-tour .min-vh-100 {
    background-color: var(--color-background-light, #f8f9fa);
}

/* Section spacing */
.st-single-tour .gap-4 > * + * {
    margin-top: var(--space-xl, 2rem);
}

/* HR dividers */
.st-single-tour hr {
    margin: var(--space-sm, 0.75rem) 0;
    border: none;
    height: 1px;
    background-color: var(--color-border, #e5e7eb);
    opacity: 1;
}

/* Itinerary reduced padding */
.st-single-tour .st-program {
    padding: var(--space-xs, 0.5rem);
}

/* Gallery minimal spacing */
#st-content-wrapper .st-gallery.style-masonry {
    margin-top: 2px;
    margin-bottom: 2px;
}

/* Remove extra gallery padding */
#tour-gallery-mobile,
#tour-gallery-desktop {
    padding: 0;
    margin: 0;
}

/* Content wrapper - proper spacing from header */
#st-content-wrapper.st-single-tour {
    padding-top: var(--space-lg, 1.5rem);
}

@media (min-width: 768px) {
    #st-content-wrapper.st-single-tour {
        padding-top: var(--space-xl, 2rem);
    }
}

/* Tighten spacing between sections */
.st-single-tour .st-single-service-content {
    margin-bottom: var(--space-xs, 0.5rem);
}

/* Tour section spacing */
.tour-section {
    padding: var(--space-md, 1rem) 0;
}

/* Sticky header visibility */
.st-header {
    position: relative;
    z-index: 1000;
}


/* ==========================================================================
   2b. Mobile Gallery Styles
   ========================================================================== */

@media screen and (max-width: 767.98px) {
    #st-content-wrapper {
        margin-top: 0;
    }

    #tour-gallery-mobile {
        padding: 0;
        margin: 0 0 var(--space-xs, 0.5rem) 0;
    }

    .tour-gallery,
    .st-gallery {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    /* Full width gallery on mobile */
    #tour-gallery-mobile .st-gallery {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        width: calc(100% + 1rem);
    }

    .tour-details {
        position: relative;
        z-index: 2;
        background: var(--color-background, #ffffff);
        padding: var(--space-sm, 0.75rem) var(--space-sm, 0.75rem) 0;
    }

    /* Content below gallery */
    #tour-main-content {
        padding-left: var(--space-sm, 0.75rem);
        padding-right: var(--space-sm, 0.75rem);
    }

    .single #st-content-wrapper .st-single-service-content {
        margin-top: 0;
    }
}


/* ==========================================================================
   2c. Desktop Gallery & Layout
   ========================================================================== */

@media screen and (min-width: 768px) {
    .tour-gallery,
    .st-gallery {
        margin: 2px 0;
        padding: 0;
    }

    #tour-gallery-desktop {
        margin: 0 0 var(--space-xs, 0.5rem) 0;
        padding: 0;
    }

    /* Desktop tighter spacing */
    #st-content-wrapper {
        padding: var(--space-sm, 0.75rem);
    }

    article#tour-article {
        padding: 0.25rem 0;
    }
}

/* CRO: Gallery inside col-lg-8 adjustments */
@media (min-width: 992px) {
    .pca-gallery-col .pca-gallery-grid {
        aspect-ratio: 2 / 1;
        max-height: 420px;
    }
    .pca-gallery-col .pca-gallery-wrapper {
        padding-top: 0;
    }
    .sticky-offset-md {
        top: calc(85px + 1rem);
    }
    /* Align sidebar widget top flush with gallery top */
    .booking-widget-instant {
        margin-top: 0;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .pca-gallery-col .pca-gallery-grid {
        aspect-ratio: 2.5 / 1;
        max-height: 400px;
    }
}


/* ==========================================================================
   3. Section Heading Accent Bars
   ========================================================================== */

.tour-itinerary-heading,
.tour-faq-heading,
.tour-inclusions-heading {
    position: relative;
    padding-left: 16px;
}

.tour-itinerary-heading::before,
.tour-faq-heading::before,
.tour-inclusions-heading::before {
    background-color: var(--color-primary-orange, #FF6B35);
    border-radius: var(--radius-xs, 3px);
    content: "";
    display: block;
    height: 24px;
    left: 0;
    position: absolute;
    top: 3px;
    width: 6px;
}


/* ==========================================================================
   4. Trust Signals
   ========================================================================== */

/* Compact trust signals under price (CRO) */
.pca-trust-signals--compact {
    display: flex;
    gap: var(--space-md, 1rem);
    flex-wrap: wrap;
    margin-top: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.pca-trust-signals--compact .pca-trust-item {
    font-size: 0.8125rem;
    color: var(--color-success-dark, #059669);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pca-trust-signals--compact .pca-trust-item svg {
    color: var(--color-success-dark, #059669);
    flex-shrink: 0;
}

/* .pca-trust-section removed — trust signals now below CTA */

/* Checkout trust section */
.checkout-trust {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm, 12px);
}

.checkout-trust__help {
    display: flex;
    justify-content: center;
}

.checkout-trust__help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs, 8px);
    font-size: var(--fs-sm, 14px);
    font-weight: var(--weight-medium, 500);
    color: var(--color-info, #3b82f6);
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    text-decoration: none;
    margin: 0 auto;
    transition: color 0.2s ease, transform 0.2s ease;
}

.checkout-trust__help-button .bi {
    font-size: 1rem;
}

.checkout-trust__help-button:hover,
.checkout-trust__help-button:focus {
    color: var(--color-primary-hover, #2a42a1);
    transform: translateY(-1px);
}

.checkout-trust__help-button:focus-visible {
    outline: 2px solid var(--color-primary-hover, #2a42a1);
    outline-offset: 2px;
}

.checkout-trust__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs, 8px);
    background: color-mix(in srgb, var(--color-success, #10b981) 8%, white);
    border-radius: var(--radius-lg, 8px);
    padding: var(--space-sm, 12px) var(--space-md, 16px);
}

.checkout-trust__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs, 8px);
    font-size: var(--fs-sm, 14px);
    color: var(--color-heading, #111827);
}

.checkout-trust__item .bi {
    color: var(--color-success-dark, #059669);
    font-size: 1rem;
}

/* Hide trust bullets when sticky nav CTA visible */
#sticky-tour-navigation.hide-cta .checkout-trust,
.hide-cta .checkout-trust {
    display: none !important;
}


/* ==========================================================================
   5. CTA Button States
   ========================================================================== */

#book-now-btn {
    cursor: pointer;
    opacity: 1;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#book-now-btn[data-state="incomplete"] {
    background: var(--color-primary, #324fbe);
}

#book-now-btn[data-state="valid"],
#book-now-btn.btn-ready {
    background: var(--color-success, #10b981);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}


/* ==========================================================================
   6. Pickup Progressive Disclosure
   ========================================================================== */

.pickup-component:not(.pca-pickup-active) {
    pointer-events: none;
}

.pickup-component {
    position: relative;
    z-index: 2;
}

/* Overlay dims inactive state without affecting child opacity/stacking context.
   opacity on a parent makes ALL children faded (CSS spec) — the dropdown results
   would inherit the 0.45 and render translucent even with background: #fff.
   A pseudo-element overlay avoids this: the dropdown z-index sits above it. */
.pickup-component::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.3s ease;
}

.pickup-component.pca-pickup-active::after {
    opacity: 0;
}

/* Keep booking actions below pickup dropdown overlay */
.pickup-component ~ .booking-actions {
    position: relative;
    z-index: 0;
}


/* ==========================================================================
   7. Guest Pre-fill Display
   ========================================================================== */

#guests-display[data-state="prefilled"] .guest-primary {
    color: var(--color-heading, #111827);
    font-weight: var(--weight-medium, 500);
}


/* ==========================================================================
   8. Booking Widget Form Controls
   ========================================================================== */

/* Section titles */
.section-title {
    font-size: var(--fs-body, 16px);
    font-weight: var(--weight-semibold, 600);
    color: var(--color-heading, #111827);
    font-family: var(--font-display, "Plus Jakarta Sans", var(--font-body));
}

/* Section summary */
.section-summary {
    font-size: var(--fs-sm, 14px);
    font-weight: var(--weight-regular, 400);
    color: var(--color-muted, #6b7280);
    font-family: var(--font-body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-top: 2px;
}

.total-meta {
    margin-top: 4px;
    font-size: var(--fs-xs, 12px);
    color: var(--color-muted, #6b7280);
    text-align: right;
}

.price-unit {
    font-weight: var(--weight-regular, 400);
    font-size: var(--fs-sm, 14px);
}

/* Focus styles for accessibility */
.date-picker-button:focus-visible,
.btn-primary-cta:focus-visible,
.btn-secondary-cta:focus-visible,
.section-toggle:focus-visible {
    outline: 2px solid var(--color-info, #3b82f6);
    outline-offset: 2px;
}

/* Section toggle button */
.section-toggle {
    width: 100%;
    padding: var(--space-sm, 12px) var(--space-md, 16px);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    background: var(--color-background, #ffffff);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--fs-sm, 14px);
    line-height: 1.25;
    font-weight: var(--weight-medium, 500);
    font-family: var(--font-body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial);
    color: var(--color-heading, #111827);
}

.section-toggle:hover {
    border-color: var(--color-primary, #324fbe);
}

.section-toggle[aria-expanded="true"] {
    background-color: color-mix(in srgb, var(--color-info, #3b82f6) 10%, transparent);
    border-color: var(--color-info, #3b82f6);
}

.section-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm, 14px);
    font-weight: var(--weight-medium, 500);
    color: var(--color-primary, #324fbe);
    margin-left: var(--space-md, 16px);
}

.section-action .bi {
    transition: transform 0.2s ease;
}

.section-toggle[aria-expanded="true"] .section-action .bi {
    transform: rotate(-180deg);
}

/* Form inputs */
.booking-widget-instant .form-control,
.booking-widget-instant .form-select {
    font-size: var(--fs-sm, 14px);
    font-weight: var(--weight-medium, 500);
    font-family: var(--font-body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    padding: var(--space-sm, 0.75rem) var(--space-md, 1rem);
    background: var(--color-background, #ffffff);
    width: 100%;
    min-height: 48px;
}

.booking-widget-instant .form-control::placeholder {
    color: var(--color-muted, #6b7280);
}

/* Form labels */
.counter-label,
.total-label {
    font-weight: var(--weight-semibold, 600);
    color: var(--color-heading, #111827);
}

/* Pricing note for package tours */
.guest-pricing-note {
    margin: var(--space-sm, 0.75rem) 0 0;
    padding: var(--space-xs, 0.5rem) var(--space-sm, 0.75rem);
    font-size: var(--fs-sm, 14px);
    color: var(--color-muted, #6b7280);
    background: var(--color-background-muted, #f3f4f6);
    border-radius: var(--radius-md, 6px);
    text-align: center;
}


/* ==========================================================================
   9. Date Picker & Calendar
   ========================================================================== */

.date-picker-button {
    width: 100%;
    min-height: 64px;
    padding: var(--space-md, 16px);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    background: var(--color-background, #ffffff);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-xs, 8px);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial);
    position: relative;
}

.date-picker-button:hover {
    border-color: var(--color-primary, #324fbe);
    box-shadow: 0 4px 12px -4px rgba(50, 79, 190, 0.25);
}

.date-picker-button:focus-visible {
    border-color: var(--color-info, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.date-picker-button .date-picker-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    gap: 4px;
}

.date-picker-button .date-picker-label {
    font-family: var(--font-body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial);
    font-size: var(--fs-xs, 12px);
    line-height: 16px;
    font-weight: var(--weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-heading, #111827);
}

.date-picker-button .date-display {
    font-size: var(--fs-sm, 14px);
    font-weight: var(--weight-regular, 400);
    color: var(--color-heading, #111827);
}

.date-picker-button .date-display.is-placeholder {
    color: var(--color-muted, #6b7280);
}

.date-picker-button .completion-check {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 14px;
    color: var(--color-success, #10b981);
}

/* Shortcut spinner */
.shortcut-spinner {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border-muted, #d1d5db);
    border-top-color: var(--color-info, #3b82f6);
    border-radius: 50%;
    animation: booking-shortcut-spin 0.6s linear infinite;
    pointer-events: none;
}

@keyframes booking-shortcut-spin {
    to { transform: rotate(360deg); }
}

.date-picker-button.loading .completion-check {
    visibility: hidden;
}

/* Booking shortcuts grid */
.booking-shortcuts__grid {
    display: grid;
    gap: var(--space-sm, 12px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.booking-shortcuts__grid--single {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 767.98px) {
    .booking-shortcuts__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.booking-shortcuts__item {
    min-width: 0;
}


/* ==========================================================================
   9b. Guest Picker
   ========================================================================== */

.guest-picker-button {
    width: 100%;
}

.guest-picker-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.2;
}

.guest-picker-button .guest-display-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.2142857143;
}

.guest-picker-button .guest-display-container .guest-primary {
    font-family: var(--font-body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji");
    font-size: var(--fs-sm, 14px);
    font-weight: var(--weight-regular, 400);
    color: var(--color-heading, #111827);
}

.guest-picker-button .guest-display-container.is-placeholder .guest-primary,
.guest-picker-button .guest-display-container[data-state="placeholder"] .guest-primary {
    color: var(--color-muted, #6b7280);
}

.guest-picker-button .guest-secondary {
    font-size: var(--fs-xs, 12px);
    color: var(--color-muted, #6b7280);
    display: none !important;
}


/* ==========================================================================
   10. Flatpickr Hidden Inputs & Calendar
   ========================================================================== */

/* Ensure all hidden inputs stay hidden (Flatpickr overrides — !important justified) */
.check-in-out-input,
.fp-anchor {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
}

/* Flatpickr with .flatpickr-input class (double-specificity override) */
.check-in-out-input.flatpickr-input,
.fp-anchor.flatpickr-input {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Flatpickr calendar display */
.flatpickr-calendar {
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
    border-radius: var(--radius-lg, 8px);
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-background, #ffffff);
}

/* Calendar open state (Flatpickr override — !important justified) */
.flatpickr-calendar.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Widget overflow for calendar */
.booking-widget-instant { overflow: visible; }
.booking-widget-instant .widget-card { position: relative; z-index: 1; }

/* Calendar popup layer (Flatpickr override — !important justified) */
#tour-date-calendar {
    z-index: 10010 !important;
    will-change: transform;
    transform: translateZ(0);
    max-height: calc(100vh - var(--space-md, 16px));
    overflow: visible;
}

/* Calendar caret */
#tour-date-calendar.arrowTop:after,
#tour-date-calendar.arrowBottom:after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border: var(--space-xs, 8px) solid transparent;
}

#tour-date-calendar.arrowTop:after {
    top: calc(-1 * var(--space-xs, 8px));
    left: var(--caret-offset, var(--space-lg, 24px));
    border-bottom-color: var(--color-background, #ffffff);
}

#tour-date-calendar.arrowBottom:after {
    bottom: calc(-1 * var(--space-xs, 8px));
    left: var(--caret-offset, var(--space-lg, 24px));
    border-top-color: var(--color-background, #ffffff);
}


/* ==========================================================================
   11. Child Discount Badge
   ========================================================================== */

.child-discount-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 4px 10px;
    margin-top: var(--space-xs, 8px);
    font-size: var(--fs-xs, 12px);
    font-weight: var(--weight-medium, 500);
    color: var(--color-success-dark, #059669);
    background: color-mix(in srgb, var(--color-success, #10b981) 8%, white);
    border-radius: var(--radius-sm, 4px);
    line-height: 1.4;
}

.child-discount-badge svg {
    flex-shrink: 0;
    color: var(--color-success-dark, #059669);
}


/* ==========================================================================
   12. Expanded Trust Signals (below CTA)
   ========================================================================== */

.pca-trust-signals--detailed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--space-md, 16px) var(--space-md, 16px) 0;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

.pca-trust-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-heading, #111827);
}

.pca-trust-detail svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--color-success-dark, #059669);
}

.pca-trust-detail div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pca-trust-detail strong {
    font-weight: var(--weight-semibold, 600);
    font-size: 13px;
}

.pca-trust-detail span {
    font-size: var(--fs-xs, 12px);
    color: var(--color-muted, #6b7280);
}


/* ==========================================================================
   13. Social Proof Card
   ========================================================================== */

.pca-social-proof-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: var(--space-sm, 12px);
    margin: var(--space-md, 16px) var(--space-md, 16px) 0;
    background: var(--color-background-light, #f8f9fa);
    border-radius: var(--radius-md, 6px);
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-body, #374151);
}

.pca-social-proof-card svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--color-muted, #6b7280);
}

.pca-social-proof-card strong {
    font-weight: var(--weight-semibold, 600);
    color: var(--color-heading, #111827);
}
