/*
 * Stay & Play
 * Builds on common.css (.common-btn, .common-select) and golf-tours.css (inner banner).
 * Tokens match the rest of the site: text #1F2E24, border #DCE5DF, muted green #5C8A6B,
 * brand gradient #0F5729 -> #31814F, 40px controls, 5px control radius, 10px card radius.
 */

.stay-play {
    --sp-text: #1F2E24;
    --sp-muted: #5C8A6B;
    --sp-border: #DCE5DF;
    --sp-surface: #F1F4F2;
    --sp-green: #0F5729;
    --sp-green-2: #31814F;
    --sp-tint: #E8F3EC;
    --sp-red: #C0392B;
    --sp-amber: #B7791F;
    color: var(--sp-text);
}
.stay-play .sp-r { text-align: right; }
.stay-play .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shared bits ---------- */
.sp-h2 { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.sp-h3 { font-size: 17px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.sp-h3 .bi { color: var(--sp-green-2); }
.sp-prose { font-size: 15px; line-height: 24px; color: #3b4a40; }
.sp-note { font-size: 13px; color: var(--sp-muted); margin: 12px 0 0; }
.sp-pause {
    display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; padding: 12px 16px;
    background: #FFF7E6; border: 1px solid #F0D9A8; border-radius: 10px; color: #7A5413; font-size: 15px; line-height: 22px;
}
.sp-pause .bi { font-size: 18px; line-height: 22px; }
.sp-panel { background: #fff; border: 1px solid var(--sp-border); border-radius: 10px; padding: 20px; }

.sp-empty {
    text-align: center; padding: 48px 16px; background: #fff;
    border: 1px dashed var(--sp-border); border-radius: 10px;
}
.sp-empty .bi { font-size: 32px; color: var(--sp-muted); display: block; margin-bottom: 8px; }
.sp-empty h4 { margin: 0 0 4px; font-size: 18px; }
.sp-empty p { margin: 0; color: var(--sp-muted); }

.stay-play .common-btn { text-decoration: none; }
.stay-play .common-btn.is-disabled { background: #C9D2CC !important; cursor: not-allowed; pointer-events: none; }
.stay-play .common-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Rates grid (cards + package page) */
.sp-rates { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; margin: 0; }
.sp-rates caption { caption-side: bottom; text-align: left; padding: 6px 0 0; font-size: 12px; color: var(--sp-muted); }
.sp-rates th, .sp-rates td { padding: 8px 10px; border-bottom: 1px solid var(--sp-border); text-align: left; }
.sp-rates thead th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); background: var(--sp-surface); border-bottom: 1px solid var(--sp-border); }
.sp-rates thead th:first-child { border-top-left-radius: 6px; }
.sp-rates thead th:last-child { border-top-right-radius: 6px; }
.sp-rates tbody th { font-weight: 600; }
.sp-rates tbody td { font-weight: 700; }
.sp-rates thead th:nth-child(n+2), .sp-rates tbody td { text-align: right; }
.sp-rates tbody tr:last-child th, .sp-rates tbody tr:last-child td { border-bottom: 0; }
.sp-rates.is-compact { font-size: 13px; }
.sp-rates.is-compact th, .sp-rates.is-compact td { padding: 6px 8px; }

/* ---------- Listing ---------- */
.sp-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }

.sp-filter {
    background: #fff; border: 1px solid var(--sp-border); border-radius: 10px; padding: 16px;
    position: sticky; top: 110px;
}
.sp-filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sp-filter-head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.sp-filter-actions { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #98a79d; }
.sp-filter-actions button { background: none; border: 0; padding: 0; color: var(--sp-green-2); font-weight: 600; cursor: pointer; }
.sp-filter-actions button:hover { text-decoration: underline; }
.sp-filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sp-filter-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border: 1px solid var(--sp-border); border-radius: 8px; padding: 8px 10px;
    font-size: 14px; color: #7d8d82; background: #fff; transition: background .15s, border-color .15s, color .15s;
}
.sp-filter-item.is-on { border-color: var(--sp-green-2); background: var(--sp-tint); color: var(--sp-text); }
.sp-filter-item label { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; flex: 1; min-width: 0; }
.sp-filter-item input { margin: 0; accent-color: var(--sp-green); width: 16px; height: 16px; flex: none; }
.sp-filter-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sp-filter-count { font-size: 12px; font-weight: 700; background: #fff; border: 1px solid var(--sp-border); border-radius: 20px; padding: 0 7px; min-width: 22px; text-align: center; }
.sp-filter-item.is-on .sp-filter-count { border-color: var(--sp-green-2); color: var(--sp-green); }
.sp-jump { color: #98a79d; font-size: 12px; text-decoration: none; }
.sp-filter-item:not(.is-on) .sp-jump { visibility: hidden; }
.sp-jump:hover { color: var(--sp-green); }
.sp-filter-foot { margin: 12px 0 0; font-size: 12px; color: var(--sp-muted); }

.sp-province { margin-bottom: 40px; scroll-margin-top: 120px; }
.sp-province-title {
    font-size: 24px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: baseline; gap: 10px;
}
.sp-province-title .bi { color: var(--sp-green-2); font-size: 20px; align-self: center; }
.sp-province-title span { font-size: 14px; font-weight: 500; color: var(--sp-muted); }

.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }

.sp-card {
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid var(--sp-border); border-radius: 10px; overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.sp-card:hover { box-shadow: 0 8px 24px rgba(15, 87, 41, .10); transform: translateY(-2px); }
.sp-card.is-unavailable:hover { box-shadow: none; transform: none; }
.sp-card-img { position: relative; margin: 0; }
.sp-card-img img { display: block; width: 100%; height: 170px; object-fit: cover; }
.sp-card.is-unavailable .sp-card-img img { filter: grayscale(.7); opacity: .85; }
.sp-badge {
    position: absolute; top: 12px; left: 12px; background: #1F2E24; color: #fff;
    font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}
.sp-card-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; flex: 1; }
.sp-card-body h3 { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.3; }
.sp-card-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: #3b4a40; }
.sp-card-facts li { display: flex; gap: 9px; align-items: flex-start; line-height: 20px; }
.sp-card-facts .bi { color: var(--sp-green-2); flex: none; line-height: 20px; }
.sp-card-facts strong { font-weight: 700; color: var(--sp-text); }
.sp-card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sp-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sp-places { font-size: 13px; font-weight: 600; color: var(--sp-green-2); display: inline-flex; align-items: center; gap: 6px; }
.sp-places .bi { font-size: 8px; }
.sp-places.is-low { color: var(--sp-red); }
.sp-places.is-off { color: #8b988f; }
.sp-card .common-btn { min-width: 0; padding: 0 18px; min-height: 40px; font-size: 15px; white-space: nowrap; }

/* ---------- Package page ---------- */
.sp-overview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.sp-hero { margin: 0; border-radius: 10px; overflow: hidden; min-height: 320px; background: var(--sp-surface); }
.sp-hero img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; }
.sp-summary { display: flex; flex-direction: column; gap: 14px; }
.sp-summary h2 { font-size: 26px; font-weight: 700; margin: 0; line-height: 1.2; }
.sp-lead { margin: 0; color: #3b4a40; font-size: 15px; line-height: 22px; }
.sp-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.sp-facts li { display: flex; gap: 10px; align-items: flex-start; line-height: 20px; }
.sp-facts .bi { color: var(--sp-green-2); font-size: 16px; flex: none; line-height: 20px; }
.sp-summary .common-btn { margin-top: auto; }

.sp-details { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; margin-top: 32px; align-items: start; }
.sp-incl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin: 24px 0; }
.sp-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.sp-checklist li { display: flex; gap: 10px; align-items: flex-start; line-height: 22px; }
.sp-checklist.is-yes .bi { color: var(--sp-green-2); }
.sp-checklist.is-no .bi { color: #B9C3BC; }
.sp-checklist .bi { flex: none; line-height: 22px; }

.sp-tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-tiers li {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-radius: 8px; padding: 10px 12px; font-size: 14px; border: 1px solid var(--sp-border);
}
.sp-tiers li strong { white-space: nowrap; }
.sp-tiers li.is-full { background: var(--sp-tint); border-color: #BFE0CB; }
.sp-tiers li.is-full strong { color: var(--sp-green); }
.sp-tiers li.is-half { background: #FFF8E8; border-color: #F1DCA8; }
.sp-tiers li.is-half strong { color: var(--sp-amber); }
.sp-tiers li.is-none { background: #FDECEA; border-color: #F3C4BE; }
.sp-tiers li.is-none strong { color: var(--sp-red); }

/* ---------- Booking form ---------- */
.sp-booking {
    margin-top: 36px; background: #fff; border: 1px solid var(--sp-border); border-radius: 10px;
    padding: 28px 28px 0; scroll-margin-top: 110px;
}
.sp-booking-head h2 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.sp-booking-head p { margin: 0 0 8px; color: var(--sp-muted); font-size: 15px; }

/* Border-less fieldset: a native fieldset border runs straight through its legend. */
.sp-step { border: 0; margin: 0; padding: 22px 0; min-width: 0; position: relative; }
.sp-step::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--sp-border); }
.sp-step:first-of-type { margin-top: 18px; }
.sp-step legend {
    float: none; width: auto; font-size: 18px; font-weight: 700; margin: 0 0 16px; padding: 0;
    display: flex; align-items: center; gap: 10px;
}
.sp-step-no {
    width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(90deg, #0F5729, #31814F);
    color: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none;
}

.sp-field { display: flex; flex-direction: column; min-width: 0; }
.sp-field label, .sp-bulk-label { font-size: 15px; font-weight: 600; line-height: 20px; margin: 0 0 6px; color: var(--sp-text); }
.sp-field label small { font-weight: 400; color: var(--sp-muted); }
.sp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }

.sp-input {
    width: 100%; height: 40px; padding: 9px 15px; font-size: 14px; line-height: 20px; color: var(--sp-text);
    background: #fff; border: 1px solid var(--sp-border); border-radius: 5px; outline: 0;
    transition: border-color .15s, box-shadow .15s;
}
.sp-input::placeholder { color: #9AB5A3; }
.sp-input:focus, .stay-play .common-select:focus { border-color: var(--sp-green-2); box-shadow: 0 0 0 3px rgba(49, 129, 79, .15); outline: 0; }
.sp-input.is-invalid { border-color: var(--sp-red); background: #FFF8F7; }
.stay-play .common-select { background-color: #fff; }
.sp-hint { font-size: 13px; color: var(--sp-muted); margin-top: 6px; }
.sp-error { color: var(--sp-red); font-size: 13px; line-height: 18px; min-height: 0; margin-top: 4px; }
.sp-error:empty { display: none; }

.sp-alert {
    display: none; background: #FDECEA; border: 1px solid #F3C4BE; color: #8E281D;
    border-radius: 8px; padding: 12px 14px; margin: 16px 0 0; font-size: 14px;
}

/* Count stepper + bulk apply */
.sp-toolbar { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; margin-bottom: 18px; }
.sp-stepper { display: flex; align-items: stretch; height: 40px; }
.sp-stepper .sp-input { width: 72px; text-align: center; border-radius: 0; border-left: 0; border-right: 0; -moz-appearance: textfield; appearance: textfield; padding: 9px 4px; font-weight: 600; }
.sp-stepper .sp-input::-webkit-outer-spin-button, .sp-stepper .sp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-stepper button {
    width: 40px; border: 1px solid var(--sp-border); background: var(--sp-surface); color: var(--sp-green);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.sp-stepper button:first-child { border-radius: 5px 0 0 5px; }
.sp-stepper button:last-child { border-radius: 0 5px 5px 0; }
.sp-stepper button:hover:not([disabled]) { background: var(--sp-tint); }
.sp-stepper button[disabled] { opacity: .45; cursor: not-allowed; }

.sp-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sp-bulk .sp-bulk-label { margin: 0; }
.sp-bulk .common-select { width: 150px; }
.sp-btn-ghost {
    height: 40px; padding: 0 18px; border: 1px solid var(--sp-green-2); background: #fff; color: var(--sp-green);
    border-radius: 5px; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s;
}
.sp-btn-ghost:hover { background: var(--sp-tint); }

/* People rows */
.sp-people-head, .sp-person {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) 170px 160px 100px; gap: 12px; align-items: center;
}
.sp-people-head {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted);
    background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 6px; padding: 8px 12px;
}
.sp-person { padding: 10px 12px; border-bottom: 1px solid var(--sp-border); }
.sp-person:last-child { border-bottom: 0; }
.sp-person:nth-child(even) { background: #FAFBFA; }
.sp-num { font-size: 13px; font-weight: 700; color: var(--sp-muted); }
.sp-cell { min-width: 0; }
.sp-cell label { display: none; }
.sp-price { font-weight: 700; font-size: 15px; }
#sp-rows { border: 1px solid var(--sp-border); border-top: 0; border-radius: 0 0 6px 6px; margin-top: -1px; }
.sp-people-head + #sp-rows { margin-top: 0; }

/* Review */
.sp-review-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sp-review-table td { padding: 8px 4px; border-bottom: 1px solid var(--sp-border); }
.sp-review-table tfoot td { font-weight: 700; font-size: 17px; border-bottom: 0; padding-top: 12px; }
.sp-review-places { font-size: 13px; color: var(--sp-muted); margin: 8px 0 0; }
.sp-check { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 0; font-size: 14px; line-height: 21px; cursor: pointer; font-weight: 400; }
.sp-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--sp-green); flex: none; }
.sp-check a { color: var(--sp-green-2); font-weight: 600; text-decoration: underline; }

/* Sticky total + action */
.sp-bar {
    position: sticky; bottom: 0; z-index: 20; margin: 0 -28px; padding: 14px 28px;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--sp-border);
    border-radius: 0 0 10px 10px; box-shadow: 0 -6px 16px rgba(31, 46, 36, .06);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sp-bar-total { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sp-bar-total small { font-size: 13px; color: var(--sp-muted); }
.sp-bar-total strong { font-size: 22px; font-weight: 700; }
.sp-bar .common-btn { min-width: 170px; }

/* ---------- Confirmation ---------- */
.sp-confirm { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid var(--sp-border); border-radius: 10px; padding: 28px; }
.sp-confirm-status { display: flex; gap: 14px; align-items: flex-start; border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; border: 1px solid; }
.sp-confirm-status .bi { font-size: 26px; line-height: 1; flex: none; }
.sp-confirm-status strong { font-size: 18px; display: block; }
.sp-confirm-status p { margin: 4px 0 0; font-size: 15px; }
.sp-confirm-status.is-ok { background: var(--sp-tint); border-color: #BFE0CB; color: #0F5729; }
.sp-confirm-status.is-info { background: #EEF5FF; border-color: #C9DCF5; color: #1B5FA5; }
.sp-confirm-status.is-warn { background: #FFF8E8; border-color: #F1DCA8; color: #8A5A0B; }
.sp-confirm-ref { display: flex; flex-direction: column; margin-bottom: 20px; }
.sp-confirm-ref span { font-size: 13px; color: var(--sp-muted); text-transform: uppercase; letter-spacing: .05em; }
.sp-confirm-ref strong { font-size: 28px; letter-spacing: .06em; }
.sp-confirm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0 0 24px; padding: 18px 0; border-top: 1px solid var(--sp-border); border-bottom: 1px solid var(--sp-border); }
.sp-confirm-grid dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); margin: 0 0 2px; }
.sp-confirm-grid dd { margin: 0; font-size: 15px; font-weight: 500; }
.sp-table-wrap { overflow-x: auto; margin-bottom: 24px; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table th, .sp-table td { padding: 10px 8px; border-bottom: 1px solid var(--sp-border); text-align: left; }
.sp-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); background: var(--sp-surface); }
.sp-table .sp-r { text-align: right; }
.sp-table tfoot td { font-weight: 700; font-size: 16px; border-bottom: 0; }
.sp-policy-inline { margin-bottom: 24px; }
.sp-confirm-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
    .sp-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 991px) {
    .sp-overview, .sp-details { grid-template-columns: 1fr; }
    .sp-hero, .sp-hero img { min-height: 240px; max-height: 340px; }
    .sp-grid-3 { grid-template-columns: 1fr; }

    /* Province filter becomes a swipeable bar of chips. minmax(0, 1fr) + min-width: 0 stop the
       scrolling chip list from stretching the column (and the cards) wider than the screen. */
    .sp-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .sp-filter, .sp-results { min-width: 0; }
    .sp-filter { position: static; padding: 12px 14px; }
    .sp-filter-head { margin-bottom: 10px; }
    .sp-filter-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .sp-filter-item { flex: none; scroll-snap-align: start; border-radius: 20px; padding: 6px 12px; }
    .sp-jump { display: none; }
    .sp-filter-foot { display: none; }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
    .sp-review-table td:nth-child(2) { display: none; }   /* "R4,299 each": the amount column already says it */
    .sp-review-table td { overflow-wrap: anywhere; }
    .sp-tiers li { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---------- Phone ---------- */
@media (max-width: 767px) {
    .sp-province-title { font-size: 21px; }
    .sp-grid { grid-template-columns: 1fr; gap: 16px; }
    .sp-card-img img { height: 140px; }
    .sp-booking { padding: 20px 16px 0; }
    .sp-bar { margin: 0 -16px; padding: 12px 16px; }
    .sp-bar .common-btn { min-width: 0; padding: 0 22px; }
    .sp-bar-total strong { font-size: 20px; }
    .sp-step legend { font-size: 17px; }

    .sp-people-head { display: none; }
    #sp-rows { border: 0; display: grid; gap: 10px; }
    .sp-person {
        grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border: 1px solid var(--sp-border); border-radius: 10px; background: #fff !important;
    }
    .sp-person .sp-num { grid-column: 1 / -1; font-size: 14px; color: var(--sp-text); }
    .sp-cell-name { grid-column: 1 / -1; }
    .sp-cell label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 4px; }
    .sp-person .sp-price { grid-column: 1 / -1; }
    .sp-toolbar { flex-direction: column; align-items: stretch; }
    .sp-bulk { flex-direction: column; align-items: stretch; }
    .sp-bulk .common-select, .sp-btn-ghost { width: 100%; }
    .sp-confirm { padding: 18px; }
    .sp-confirm-grid { grid-template-columns: 1fr; }
    .sp-confirm-ref strong { font-size: 22px; }
}
