/* Step-by-step booking form on /tour/detail/ (mockup variant A).
   Everything is scoped to .is-stepper, which the page script adds once it has
   initialised; without JS the original all-sections form still renders. */

.single-woo-tour .mobile-booking-flow:not(.is-stepper) .booking-steps,
.single-woo-tour .mobile-booking-flow:not(.is-stepper) .booking-recap,
.single-woo-tour .mobile-booking-flow:not(.is-stepper) .booking-room-auto,
.single-woo-tour .mobile-booking-flow:not(.is-stepper) .booking-period-cards { display: none !important; }

.single-woo-tour .mobile-booking-flow .is-step-hidden,
.single-woo-tour .booking-recap[hidden],
.single-woo-tour .booking-room-auto[hidden],
.single-woo-tour .booking-period-cards[hidden],
.single-woo-tour #mobileBookingPeriod[hidden],
.single-woo-tour .booking-step-buttons [hidden] { display: none !important; }

/* The step bar replaces the numbered circles on each section heading. */
.single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-heading > span { display: none; }
.single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-heading small { display: block !important; }

/* ---- Step bar ---- */
.single-woo-tour .booking-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 2px;
    border-bottom: 1px solid #e7ebf1;
}
.single-woo-tour .booking-steps button {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    padding: 4px 2px 9px;
    border: 0;
    background: none;
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}
.single-woo-tour .booking-steps button::after {
    content: '';
    position: absolute;
    right: 6px;
    bottom: -1px;
    left: 6px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}
.single-woo-tour .booking-steps button:disabled { cursor: not-allowed; opacity: .45; }
.single-woo-tour .booking-steps .booking-step-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.single-woo-tour .booking-steps .booking-step-dot {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1.5px solid #dce3ed;
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
}
.single-woo-tour .booking-steps button.is-current { color: #172033; font-weight: 700; }
.single-woo-tour .booking-steps button.is-current::after { background: #e85d24; }
.single-woo-tour .booking-steps button.is-current .booking-step-dot { border-color: #e85d24; color: #e85d24; }
.single-woo-tour .booking-steps button.is-done .booking-step-dot { border-color: #16a34a; background: #16a34a; color: #fff; font-size: 0; }
.single-woo-tour .booking-steps button.is-done .booking-step-dot::before { content: '\2713'; font-size: 13px; }
.single-woo-tour .booking-steps button:focus-visible { outline: 2px solid #e85d24; outline-offset: -2px; border-radius: 8px; }

/* ---- Recap of finished steps ---- */
.single-woo-tour .booking-recap { display: flex; flex-wrap: wrap; gap: 6px; }
.single-woo-tour .booking-recap button {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid #e7ebf1;
    border-radius: 999px;
    background: #f7f9fc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}
.single-woo-tour .booking-recap button b { overflow: hidden; color: #172033; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.single-woo-tour .booking-recap button span { flex: 0 0 auto; color: #e85d24; text-decoration: underline; }
.single-woo-tour .booking-recap button:hover { border-color: #fdc9ad; background: #fff4ed; }

/* ---- Period cards (replace the dropdown) ---- */
.single-woo-tour .booking-period-cards { display: grid; gap: 6px; }
.single-woo-tour .booking-period-month { margin-top: 4px; color: #64748b; font-size: 12px; font-weight: 700; }
.single-woo-tour .booking-period-month:first-child { margin-top: 0; }
.single-woo-tour .booking-period-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 8px 12px;
    line-height: 1.3;
    border: 1.5px solid #e7ebf1;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.single-woo-tour .booking-period-card:hover:not(:disabled) { border-color: #fdc9ad; }
.single-woo-tour .booking-period-card[aria-checked='true'] { border-color: #e85d24; background: #fff4ed; box-shadow: inset 0 0 0 1px #e85d24; }
.single-woo-tour .booking-period-card:disabled { cursor: not-allowed; opacity: .5; }
.single-woo-tour .booking-period-card .bpc-date { min-width: 0; font-size: 14px; font-weight: 600; }
.single-woo-tour .booking-period-card .bpc-amount { display: flex; flex: 0 0 auto; align-items: baseline; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.single-woo-tour .booking-period-card .bpc-price { color: #e85d24; font-size: 14px; font-weight: 700; }
.single-woo-tour .booking-period-card:disabled .bpc-price { color: #dc2626; }
.single-woo-tour .booking-period-card .bpc-orig { color: #94a3b8; font-size: 11px; }
.single-woo-tour .booking-period-empty { margin: 0; color: #64748b; font-size: 14px; }

/* ---- Room auto-fit notice ---- */
.single-woo-tour .booking-room-auto {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 13px;
    line-height: 1.35;
}
.single-woo-tour .booking-room-auto button {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: #e85d24;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* ---- Back / Next / Confirm ---- */
.single-woo-tour .booking-step-buttons { display: flex; gap: 8px; min-width: 0; }
.single-woo-tour .booking-step-buttons .mobile-booking-submit { flex: 1 1 auto; min-width: 0; }
.single-woo-tour .booking-step-back {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: #fff;
    color: #475569;
}
.single-woo-tour .booking-step-back .material-symbols-outlined { font-size: 20px; }

/* ---- Desktop sidebar ---- */
@media (min-width: 993px) {
    /* Steps are short, so the form grows with its content instead of a fixed 450px scroll box. */
    .single-woo-tour .summary.entry-summary.description_single .scroll-form,
    .single-woo-tour .summary.entry-summary.description_single .scroll-form.memberRegister {
        height: auto;
        max-height: calc(100vh - 190px);
    }
    .single-woo-tour .booking-period-cards { max-height: 280px; overflow-y: auto; padding-right: 2px; overscroll-behavior: contain; }
    /* Total on its own row so the amount never truncates; buttons span the full width below it. */
    .single-woo-tour .mobile-booking-actionbar { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .single-woo-tour .booking-step-buttons .mobile-booking-submit { min-height: 46px; }
    .single-woo-tour .booking-step-back { flex-basis: 40px; width: 40px; }
}

/* ---- Mobile / tablet sheet ---- */
@media (max-width: 992px) {
    .single-woo-tour .booking-steps { margin-bottom: 12px; }
    .single-woo-tour .booking-steps button { font-size: 13px; }
    .single-woo-tour .booking-steps .booking-step-dot { width: 30px; height: 30px; font-size: 14px; }
    .single-woo-tour .booking-recap { margin-bottom: 12px; }
    .single-woo-tour .booking-recap button { font-size: 13px; }
    .single-woo-tour .booking-period-card { padding: 12px 14px; }
    .single-woo-tour .booking-period-card .bpc-date,
    .single-woo-tour .booking-period-card .bpc-price { font-size: 16px; }
    .single-woo-tour .booking-period-card .bpc-orig { font-size: 12px; }
    .single-woo-tour .booking-room-auto { font-size: 14px; }
    .single-woo-tour .booking-room-auto button { min-height: 38px; font-size: 14px; }
    .single-woo-tour .booking-step-back { flex-basis: 48px; width: 48px; }
}

/* Empty validation line left a gap above the total. */
.single-woo-tour .mobile-booking-flow.is-stepper #mobileBookingValidation:empty { display: none; }

/* Contact inputs: a legacy rule in public/style.css gives text/email inputs a bottom-only
   border, so name/email looked different from phone. Give every field the same box. */
.single-woo-tour .description_single #tourBookingForm #mobileBookingFlow .mobile-contact-grid input,
.single-woo-tour .description_single #tourBookingForm #mobileBookingFlow .mobile-contact-grid select,
.single-woo-tour .description_single #tourBookingForm #mobileBookingFlow .mobile-contact-grid textarea {
    margin: 0;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: #fff;
}
.single-woo-tour .description_single #tourBookingForm #mobileBookingFlow .mobile-contact-grid input:focus,
.single-woo-tour .description_single #tourBookingForm #mobileBookingFlow .mobile-contact-grid select:focus,
.single-woo-tour .description_single #tourBookingForm #mobileBookingFlow .mobile-contact-grid textarea:focus {
    border-color: #e85d24;
    box-shadow: 0 0 0 3px rgba(232, 93, 36, .12);
    outline: 0;
}

/* Desktop total: label + info on the left, discount pill under it, amount right-aligned. */
@media (min-width: 993px) {
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-actionbar {
        padding: 14px 0 0;
        border: 0;
        border-top: 1px solid #e7ebf1;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-total-panel {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr);
        grid-template-areas: "label info price" "disc disc price";
        align-items: center;
        gap: 4px 6px;
        padding: 0;
    }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-total-panel > span {
        grid-area: label;
        color: #334155;
        font-size: 14px;
        font-weight: 600;
    }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-details {
        grid-area: info;
        position: static;
        display: grid;
        width: 20px;
        height: 20px;
        place-items: center;
        transform: none;
        border: 0;
        background: none;
        color: #94a3b8;
        cursor: pointer;
    }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-details:hover,
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-details[aria-expanded='true'] { color: #e85d24; }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-details .material-symbols-outlined { font-size: 18px; }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-discount {
        grid-area: disc;
        justify-self: start;
        padding: 1px 8px;
        border-radius: 999px;
        background: #ecfdf5;
        color: #15803d;
        font-size: 12px;
        line-height: 1.6;
    }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-discount b { color: inherit; font-weight: 700; }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-price-line {
        grid-area: price;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
        min-width: 0;
        font-variant-numeric: tabular-nums;
    }
    .single-woo-tour .mobile-booking-flow.is-stepper #mobileBookingOriginalTotal { font-size: 12px; line-height: 1.3; }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-price-line > strong { font-size: 24px; line-height: 1.15; }
    .single-woo-tour .mobile-booking-flow.is-stepper .mobile-booking-breakdown { right: 0; left: 0; width: auto; }
}

/* Mobile bottom bar total. The bar is moved out of the form into .description_single on
   mobile, so these selectors hang off .description_single instead of .is-stepper.
   Layout: "ยอดรวมสุทธิ ⓘ" / big amount / green discount pill. The struck-out original
   price is dropped here because the pill already shows the saving. */
@media (max-width: 992px) {
    .single-woo-tour .description_single .mobile-booking-actionbar { grid-template-columns: minmax(0, 1fr) minmax(150px, 50%); align-items: center; }
    .single-woo-tour .description_single .mobile-booking-total-panel {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "label info" "price price" "disc disc";
        align-items: center;
        gap: 1px 4px;
        padding: 0;
    }
    .single-woo-tour .description_single .mobile-booking-total-panel > span {
        grid-area: label;
        color: #64748b;
        font-size: 13px;
        line-height: 1.3;
    }
    .single-woo-tour .description_single .mobile-booking-details {
        grid-area: info;
        position: static;
        display: grid;
        justify-self: start;
        width: 22px;
        height: 22px;
        place-items: center;
        transform: none;
        border: 0;
        background: none;
        color: #94a3b8;
    }
    .single-woo-tour .description_single .mobile-booking-details[aria-expanded='true'] { color: #e85d24; }
    .single-woo-tour .description_single .mobile-booking-details .material-symbols-outlined { font-size: 18px; }
    .single-woo-tour .description_single .mobile-booking-price-line { grid-area: price; min-width: 0; font-variant-numeric: tabular-nums; }
    .single-woo-tour .description_single #mobileBookingOriginalTotal { display: none !important; }
    .single-woo-tour .description_single .mobile-booking-price-line > strong { font-size: 24px; line-height: 1.15; }
    .single-woo-tour .description_single .mobile-booking-discount {
        grid-area: disc;
        justify-self: start;
        margin-top: 2px;
        padding: 0 8px;
        border-radius: 999px;
        background: #ecfdf5;
        color: #15803d;
        font-size: 12px;
        line-height: 1.6;
    }
    .single-woo-tour .description_single .mobile-booking-discount b { color: inherit; font-weight: 700; }
    .single-woo-tour .description_single .booking-step-buttons .mobile-booking-submit { min-height: 52px; font-size: 16px; }
    .single-woo-tour .description_single .booking-step-back { flex-basis: 44px; width: 44px; align-self: stretch; }
}
