/*
 * Home Tour — inc/belle-home-tour.php
 *
 * 1. The Elementor card on the home page ("Hua Hin Home Tour", container
 *    c58bce7): CSS classes belle-tour (card), belle-tour__text (left column),
 *    belle-tour__eyebrow / __title / __lead / __steps (widgets), belle-tour__media
 *    (right column with the video). Layout (direction, gaps, padding, widths)
 *    stays in Elementor; colours, type and decoration are here.
 * 2. The [belle_home_tour] button (.btour-cta) and its popup (.btour-dialog).
 *
 * Gold follows the Elementor kit's Primary / "Primary Hover" colours, with fallbacks.
 */

.belle-tour,
.btour,
.btour-dialog {
    --bt-gold: var(--e-global-color-primary, #AA8656);
    --bt-gold-deep: var(--e-global-color-54c3f6d, #8E6D43);
    --bt-gold-soft: #F4EDE2;
    --bt-ink: #3C3633;
    --bt-muted: #6F675F;
    --bt-line: #D9D1C5;
    --bt-line-soft: #ECE6DC;
    --bt-soft: #F9F6F0;
    --bt-error: #B42318;
}

/* ── 1. The card ─────────────────────────────────────────────────────── */
.e-con.belle-tour {
    position: relative;
    background: linear-gradient(140deg, #FFFFFF 0%, #FFFFFF 45%, #FBF7F1 100%);
    border: 1px solid #E7DDCD;
    border-radius: 24px;
    box-shadow: 0 1px 2px rgba(60, 54, 51, .05), 0 24px 48px -28px rgba(60, 54, 51, .35);
    overflow: hidden;
}

.belle-tour .belle-tour__eyebrow .elementor-heading-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--bt-gold-deep);
}
.belle-tour .belle-tour__eyebrow .elementor-heading-title::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: var(--bt-gold);
}

.belle-tour .belle-tour__title { margin-top: 14px; }
.belle-tour .belle-tour__title .elementor-heading-title {
    margin: 0;
    font-size: clamp(28px, 2.5vw, 38px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.015em;
    text-transform: none; /* the theme capitalises every h2 */
    color: var(--bt-ink);
    text-wrap: balance;
}

.belle-tour .belle-tour__lead { margin-top: 16px; }
.belle-tour .belle-tour__lead,
.belle-tour .belle-tour__lead p {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--bt-muted);
}

.belle-tour .belle-tour__steps { margin-top: 26px; }
.belle-tour .belle-tour__steps ol {
    counter-reset: btstep;
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.belle-tour .belle-tour__steps li {
    counter-increment: btstep;
    position: relative;
    min-height: 34px;
    margin: 0;
    padding-left: 50px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--bt-muted);
}
.belle-tour .belle-tour__steps li::before {
    content: counter(btstep);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bt-gold-soft);
    color: var(--bt-gold-deep);
    font-size: 15px;
    font-weight: 700;
}
.belle-tour .belle-tour__steps li strong {
    display: block;
    font-weight: 700;
    color: var(--bt-ink);
}

.belle-tour .belle-tour__cta { margin-top: 30px; }

/* Video: rounded frame with a soft shadow; the widget itself is untouched. */
.belle-tour .belle-tour__media .elementor-widget-video,
.belle-tour .belle-tour__media .elementor-widget-video > .elementor-widget-container,
.belle-tour .belle-tour__media .elementor-wrapper {
    border-radius: 18px;
    overflow: hidden;
}
.belle-tour .belle-tour__media .elementor-widget-video {
    box-shadow: 0 22px 44px -22px rgba(60, 54, 51, .45);
}

@media (max-width: 767px) {
    .e-con.belle-tour { border-radius: 18px; }
    .belle-tour .belle-tour__eyebrow .elementor-heading-title { font-size: 12px; }
    .belle-tour .belle-tour__lead,
    .belle-tour .belle-tour__lead p { font-size: 15px; }
    .belle-tour .belle-tour__steps { margin-top: 22px; }
    .belle-tour .belle-tour__steps li { padding-left: 46px; }
    .belle-tour .belle-tour__cta { margin-top: 24px; }
    .belle-tour .belle-tour__media .elementor-widget-video,
    .belle-tour .belle-tour__media .elementor-widget-video > .elementor-widget-container,
    .belle-tour .belle-tour__media .elementor-wrapper { border-radius: 14px; }
}

/* ── 2a. Button ──────────────────────────────────────────────────────── */
.btour-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }

.btour .btour-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    margin: 0;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    background: var(--bt-gold);
    box-shadow: 0 10px 24px -10px rgba(142, 109, 67, .7);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btour .btour-cta__btn:hover {
    background: var(--bt-gold-deep);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -12px rgba(142, 109, 67, .8);
}
.btour .btour-cta__btn:hover .btour-icon { transform: translateX(3px); }
.btour .btour-cta__btn:focus-visible { outline: 3px solid var(--bt-gold); outline-offset: 3px; }

.btour-icon { width: 18px; height: 18px; flex: none; transition: transform .2s ease; }

.btour-cta__note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--bt-muted); }

@media (max-width: 767px) {
    .btour-cta { flex-direction: column; align-items: stretch; text-align: center; }
    .btour .btour-cta__btn { width: 100%; }
}

/* ── 2b. Popup ───────────────────────────────────────────────────────── */
html.btour-lock { overflow: hidden; }

.btour-dialog {
    width: min(680px, calc(100% - 32px));
    max-width: none;
    max-height: min(calc(100dvh - 48px), 860px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #FFFFFF;
    color: var(--bt-ink);
    font-family: inherit;
    box-shadow: 0 40px 90px -20px rgba(20, 14, 10, .5);
    overflow: hidden;
}
.btour-dialog[open] {
    display: flex;
    flex-direction: column;
    animation: btour-in .24s cubic-bezier(.2, .8, .2, 1);
}
.btour-dialog::backdrop {
    background: rgba(28, 22, 18, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
@keyframes btour-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .btour-dialog[open] { animation: none; }
    .btour-icon, .btour .btour-cta__btn { transition: none; }
}

.btour-dialog *,
.btour-dialog *::before,
.btour-dialog *::after { box-sizing: border-box; }

/* Header */
.btour-head {
    position: relative;
    flex: none;
    padding: 24px 64px 0 28px;
    background: linear-gradient(180deg, var(--bt-soft) 0%, #FFFFFF 100%);
    border-bottom: 1px solid var(--bt-line-soft);
}
.btour-head__eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--bt-gold-deep);
}
.btour-head__title {
    margin: 0;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: none;
    color: var(--bt-ink);
}
.btour-head__title:focus { outline: none; }
.btour-dialog .btour-head__close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--bt-line-soft);
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--bt-ink);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.btour-dialog .btour-head__close:hover { background: var(--bt-soft); border-color: var(--bt-line); }
.btour-dialog .btour-head__close:focus-visible { outline: 3px solid var(--bt-gold); outline-offset: 2px; }
.btour-head__close svg { width: 18px; height: 18px; }

.btour-progress {
    display: flex;
    gap: 24px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}
.btour-progress__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 -1px;
    padding: 0 0 12px;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--bt-muted);
}
.btour-progress__num {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bt-line-soft);
    color: var(--bt-muted);
    font-size: 12px;
    font-weight: 700;
}
.btour-progress__item.is-current { color: var(--bt-ink); border-bottom-color: var(--bt-gold); }
.btour-progress__item.is-current .btour-progress__num,
.btour-progress__item.is-done .btour-progress__num { background: var(--bt-gold); color: #FFFFFF; }
.btour-dialog.is-thanks .btour-progress { visibility: hidden; height: 0; margin: 0; }
.btour-dialog.is-thanks .btour-head { padding-bottom: 20px; }

/* Form + steps: the body scrolls, the foot stays in view */
.btour-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}
.btour-step {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.btour-step[hidden] { display: none; }
.btour-step__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 22px 28px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.btour-step__foot {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px;
    border-top: 1px solid var(--bt-line-soft);
    background: #FFFFFF;
}
.btour-step__foot--center { justify-content: center; flex-wrap: wrap; }
.btour-foot-note { margin: 0; font-size: 13px; color: var(--bt-muted); }

/* Fields */
.btour-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
}
.btour-grid + .btour-field,
.btour-field + .btour-field { margin-top: 20px; }
.btour-grid > .btour-field { margin-top: 0; }
.btour-field--wide { grid-column: 1 / -1; }

.btour-dialog fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.btour-dialog .btour-label,
.btour-dialog legend.btour-label {
    float: none;
    display: block;
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--bt-ink);
}
.btour-req { color: var(--bt-gold-deep); }
.btour-unit,
.btour-optional { font-weight: 400; color: var(--bt-muted); }
.btour-unit { margin-left: 4px; font-size: 12px; letter-spacing: .04em; }
.btour-unit[hidden] { display: none; }
.btour-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--bt-muted); }

.btour-dialog .btour-input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--bt-line);
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: none;
    color: var(--bt-ink);
    font-family: inherit;
    font-size: 16px; /* 16px stops iOS zooming in on focus */
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.btour-dialog textarea.btour-input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.btour-dialog .btour-input::placeholder { color: #A39A90; }
.btour-dialog .btour-input:focus {
    outline: none;
    border-color: var(--bt-gold);
    box-shadow: 0 0 0 3px rgba(170, 134, 86, .2);
}
.btour-dialog .btour-input.is-invalid {
    border-color: var(--bt-error);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .12);
}

/* Chips */
.btour-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.btour-chips[hidden] { display: none; }
.btour-chip { position: relative; margin: 0; cursor: pointer; }
.btour-chip__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.btour-chip__text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--bt-line);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--bt-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btour-chip:hover .btour-chip__text { border-color: var(--bt-gold); background: var(--bt-soft); }
.btour-chip__input:checked + .btour-chip__text {
    border-color: var(--bt-gold);
    background: var(--bt-gold);
    color: #FFFFFF;
}
.btour-chip__input:focus-visible + .btour-chip__text { outline: 3px solid var(--bt-gold); outline-offset: 2px; }

/* Buy / Rent: segmented control */
.btour-deal {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: var(--bt-soft);
    border: 1px solid var(--bt-line-soft);
}
.btour-deal .btour-chip__text { min-width: 96px; height: 38px; border-color: transparent; background: transparent; font-weight: 600; }
.btour-deal .btour-chip:hover .btour-chip__text { border-color: transparent; background: rgba(170, 134, 86, .1); }
.btour-deal .btour-chip__input:checked + .btour-chip__text {
    background: var(--bt-gold);
    color: #FFFFFF;
    box-shadow: 0 4px 10px -4px rgba(142, 109, 67, .6);
}

/* Buttons. Theme Options CSS forces a gradient on every button[type="submit"]
   with !important, hence the !important backgrounds here. */
.btour-dialog .btour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    margin: 0;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: var(--bt-gold) !important;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease;
}
.btour-dialog .btour-btn:hover { background: var(--bt-gold-deep) !important; color: #FFFFFF; }
.btour-dialog .btour-btn:focus-visible { outline: 3px solid var(--bt-gold); outline-offset: 3px; }
.btour-dialog .btour-btn:disabled { background: #CFC7BC !important; cursor: wait; }
.btour-dialog .btour-btn--ghost {
    background: #FFFFFF !important;
    border: 1px solid var(--bt-line);
    color: var(--bt-ink);
}
.btour-dialog .btour-btn--ghost:hover { background: var(--bt-soft) !important; color: var(--bt-ink); }

.btour-dialog .btour-link {
    margin: 0;
    padding: 8px 4px;
    border: 0;
    background: none;
    color: var(--bt-muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.btour-dialog .btour-link:hover { color: var(--bt-ink); }
.btour-dialog .btour-link:focus-visible { outline: 3px solid var(--bt-gold); outline-offset: 2px; border-radius: 6px; }

.btour-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: btour-spin .7s linear infinite;
}
.btour-spinner[hidden] { display: none; }
@keyframes btour-spin { to { transform: rotate(360deg); } }

.btour-privacy { margin: 16px 0 0; font-size: 12px; color: var(--bt-muted); }

.btour-error {
    flex: none;
    margin: 0 28px 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #FEF3F2;
    color: var(--bt-error);
    font-size: 14px;
    line-height: 1.5;
}
.btour-error[hidden] { display: none; }
.btour-error a { color: inherit; font-weight: 700; text-decoration: underline; }

/* Honeypot */
.btour-hp {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Thank you */
.btour-thanks .btour-step__body { padding-top: 36px; padding-bottom: 32px; text-align: center; }
.btour-thanks__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--bt-gold-soft);
    color: var(--bt-gold-deep);
}
.btour-thanks__icon svg { width: 30px; height: 30px; }
.btour-thanks__title {
    margin: 0 0 10px;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    text-transform: none;
    color: var(--bt-ink);
}
.btour-thanks__title:focus { outline: none; }
.btour-thanks__text {
    max-width: 440px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.6;
    color: var(--bt-muted);
}
.btour-thanks__small { margin-top: 8px; font-size: 13px; }

/* Phones: full screen */
@media (max-width: 600px) {
    .btour-dialog {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .btour-dialog[open] { animation-name: btour-up; }
    @keyframes btour-up {
        from { opacity: 0; transform: translateY(24px); }
        to   { opacity: 1; transform: none; }
    }
    .btour-head { padding: 18px 60px 0 20px; }
    .btour-head__title { font-size: 21px; }
    .btour-dialog .btour-head__close { top: 14px; right: 14px; }
    .btour-progress { gap: 18px; margin-top: 14px; }
    .btour-step__body { padding: 18px 20px 22px; }
    .btour-step__foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
    .btour-error { margin: 0 20px 12px; }
    .btour-grid { grid-template-columns: minmax(0, 1fr); }
    .btour-deal { display: flex; }
    .btour-deal .btour-chip { flex: 1 1 0; }
    .btour-deal .btour-chip__text { width: 100%; min-width: 0; }
    .btour-step:not(.btour-thanks) .btour-step__foot .btour-btn { flex: 1 1 auto; }
    .btour-step__foot--center .btour-btn { flex: 1 1 100%; }
}
