/* ========== Booking page (order.php) ========== */
.order-page {
    background: #f4f6fb;
    padding: 36px 0 90px;
    min-height: 70vh;
}

.order-page .container { max-width: 1240px; }

/* shared icon style */
.order-page svg:not(.car-art) {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Heading ---------- */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--primary); }
.crumbs span { margin: 0 8px; }

.order-head h1 {
    font-size: 46px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.1;
    color: var(--heading);
    margin-bottom: 8px;
}

.order-head h1 span { color: var(--primary); }
.order-head p { font-size: 17px; color: var(--muted); margin-bottom: 30px; }

.order-alert {
    background: #fff0f6;
    border: 1px solid #ffc2dc;
    color: #b0005a;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 15px;
    margin-bottom: 20px;
}

/* ---------- Layout ---------- */
.order-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

.order-steps { display: grid; gap: 18px; min-width: 0; }

.step-card {
    background: #fff;
    border-radius: 22px;
    padding: 26px 28px 28px;
    border: 1px solid #e8ebf3;
}

.step-card[hidden] { display: none; }

.step-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 20px;
}

.step-title small { font-size: 14px; font-weight: 400; color: var(--muted); }

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--heading);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* hide native radios/checkboxes inside option tiles */
.type-tab input, .car-opt input, .deliv-opt input, .addon input,
.pay-opt input, .pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* focus ring for keyboard users */
.type-tab input:focus-visible + span, .car-opt input:focus-visible + .car-box,
.deliv-opt input:focus-visible + span, .addon input:focus-visible + span,
.pay-opt input:focus-visible + span, .pill input:focus-visible + span {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- 1. Rental type ---------- */
.type-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.type-tab span {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 16px;
    border: 1.5px solid #e3e6ef;
    border-radius: 16px;
    cursor: pointer;
    transition: all .2s;
}

.type-tab svg {
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 12px;
    background: #f2f4fa;
    color: var(--heading);
    transition: all .2s;
}

.type-tab strong { font-size: 16px; font-weight: 600; color: var(--heading); }
.type-tab small  { font-size: 13px; color: var(--muted); }

.type-tab span:hover { border-color: #b9c6ff; }
.type-tab input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.type-tab input:checked + span svg { background: var(--primary); color: #fff; }

/* ---------- 2. Cars ---------- */
.car-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.car-box {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    border: 1.5px solid #e3e6ef;
    border-radius: 18px;
    cursor: pointer;
    transition: all .2s;
    height: 100%;
}

.car-box:hover { border-color: #b9c6ff; transform: translateY(-2px); }

.car-art { width: 130px; height: 60px; margin-bottom: 8px; transition: transform .3s; }
.car-opt input:checked + .car-box .car-art { transform: translateX(6px); }

.car-name { font-size: 19px; font-weight: 600; color: var(--heading); }
.car-example { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

.car-specs { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.car-specs span { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #3a3d4a; }
.car-specs svg { width: 15px; height: 15px; color: var(--muted); }

.car-price {
    margin-top: auto;
    font-size: 22px;
    font-weight: 700;
    color: var(--heading);
}

.car-price small { font-size: 14px; font-weight: 400; color: var(--muted); }

.car-check {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #d3d7e3;
    display: grid;
    place-items: center;
    color: transparent;
    transition: all .2s;
}

.car-check svg { width: 15px; height: 15px; stroke-width: 3; }

.car-opt input:checked + .car-box { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.car-opt input:checked + .car-box .car-check { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 3. When & where ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field[hidden], .trip-point[hidden] { display: none; }

.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3a3d4a;
}

.label small { font-weight: 400; color: var(--muted); }

.field input, .field select, .field textarea {
    width: 100%;
    font-size: 16px;
    color: var(--heading);
    background: #f7f8fc;
    border: 1.5px solid #e3e6ef;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    transition: border-color .2s, background .2s;
}

.field textarea { resize: vertical; min-height: 54px; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }

.field-row.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.field-row:not(.two) { max-width: 320px; }

.field-error { font-size: 13px; color: #d4005f; margin-top: -2px; }
.field:has(.field-error) input,
.field:has(.field-error) textarea,
.field:has(.field-error) select { border-color: #ff7ab3; }

/* A → B timeline */
.trip-line { position: relative; padding-left: 46px; }

.trip-line::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 40px;
    border-left: 2px dashed #c9cfdf;
}

.trip-point { position: relative; }

.dot {
    position: absolute;
    left: -46px;
    top: 26px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 0 0 4px #fff;
}

.dot-b { background: var(--accent); }

.hour-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pill span {
    display: block;
    padding: 9px 16px;
    border-radius: 100px;
    border: 1.5px solid #e3e6ef;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.pill span:hover { border-color: #b9c6ff; }
.pill input:checked + span { background: var(--heading); border-color: var(--heading); color: #fff; }

.duration-note {
    font-size: 14px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 10px;
    padding: 9px 14px;
    margin: 2px 0 20px;
}

.duration-note:empty { display: none; }
.duration-note.bad { color: #b0005a; background: #fff0f6; }

.deliv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }

.deliv-opt span {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1.5px solid #e3e6ef;
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s;
}

.deliv-opt svg { width: 22px; height: 22px; color: var(--muted); }
.deliv-opt strong { font-size: 15px; font-weight: 600; color: var(--heading); }
.deliv-opt small { font-size: 14px; font-weight: 600; color: #12a05c; }
.deliv-opt input[value="home"] + span small { color: var(--heading); }

.deliv-opt span:hover { border-color: #b9c6ff; }
.deliv-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.deliv-opt input:checked + span svg { color: var(--primary); }

/* ---------- 4. Add-ons ---------- */
.addon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.addon[hidden] { display: none; }

.addon > span {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #e3e6ef;
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s;
}

.addon-box {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1.5px solid #c9cfdf;
    display: grid;
    place-items: center;
    color: transparent;
    transition: all .2s;
}

.addon-box svg { width: 14px; height: 14px; stroke-width: 3; }
.addon-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.addon-text strong { font-size: 15px; font-weight: 600; color: var(--heading); }
.addon-text small { font-size: 12.5px; color: var(--muted); }
.addon-price { font-size: 15px; font-weight: 600; color: var(--heading); white-space: nowrap; }
.addon-price small { font-size: 12px; font-weight: 400; color: var(--muted); }

.addon > span:hover { border-color: #b9c6ff; }
.addon input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.addon input:checked + span .addon-box { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 5. Details ---------- */
.phone-input {
    display: flex;
    align-items: stretch;
    background: #f7f8fc;
    border: 1.5px solid #e3e6ef;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .2s;
}

.phone-input em {
    font-style: normal;
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
    padding: 12px 0 12px 14px;
}

.field .phone-input input { border: none; background: transparent; padding-left: 8px; }
.phone-input:focus-within { border-color: var(--primary); background: #fff; }
.field:has(.field-error) .phone-input { border-color: #ff7ab3; }

/* ---------- 6. Payment ---------- */
.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.pay-opt span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px;
    border: 1.5px solid #e3e6ef;
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s;
    height: 100%;
}

.pay-opt svg {
    width: 36px;
    height: 36px;
    padding: 7px;
    border-radius: 10px;
    background: #f2f4fa;
    color: var(--heading);
    margin-bottom: 8px;
    transition: all .2s;
}

.pay-opt strong { font-size: 15px; font-weight: 600; color: var(--heading); }
.pay-opt small { font-size: 12.5px; color: var(--muted); }

.pay-opt span:hover { border-color: #b9c6ff; }
.pay-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.pay-opt input:checked + span svg { background: var(--primary); color: #fff; }

/* ---------- Summary ---------- */
.order-summary { position: sticky; top: calc(var(--header-h) + 20px); }

.sum-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #e8ebf3;
    box-shadow: 0 20px 50px rgba(11, 11, 26, .08);
}

.sum-car {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef0f5;
    margin-bottom: 16px;
}

.sum-car .car-art { width: 92px; height: 44px; margin: 0; flex-shrink: 0; }
.sum-car strong { display: block; font-size: 19px; font-weight: 600; color: var(--heading); }
.sum-car span { font-size: 14px; color: var(--muted); }

.sum-dates {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    background: #f7f8fc;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.sum-dates small { display: block; font-size: 12px; color: var(--muted); }
.sum-dates strong { font-size: 14px; font-weight: 600; color: var(--heading); }
.sum-arrow { color: var(--muted); }

.sum-lines { list-style: none; display: grid; gap: 10px; margin-bottom: 14px; }

.sum-lines li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 14.5px;
    color: #3a3d4a;
}

.sum-lines li span:last-child { white-space: nowrap; font-weight: 500; }
.sum-lines .sum-empty { color: var(--muted); font-style: italic; }

.sum-deposit-row {
    display: flex;
    justify-content: space-between;
    font-size: 14.5px;
    color: #3a3d4a;
    padding-top: 10px;
    border-top: 1px dashed #dde0ea;
    margin-bottom: 4px;
}

.sum-deposit-row[hidden] { display: none; }

.sum-deposit-row i {
    font-style: normal;
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #eef0f5;
    font-size: 11px;
    color: var(--muted);
    cursor: help;
}

.sum-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0 18px;
    margin-top: 10px;
    border-top: 1.5px solid #eef0f5;
}

.sum-total span { font-size: 16px; font-weight: 500; color: var(--heading); }

.sum-total strong {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: var(--heading);
}

.sum-total strong.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.06); color: var(--primary); } }

.agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: #3a3d4a;
    margin-bottom: 14px;
    cursor: pointer;
}

.agree input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex-shrink: 0; }
.agree a { color: var(--primary); text-decoration: underline; }
.sum-card .field-error { margin: -6px 0 12px; }

.sum-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 18px 22px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.sum-btn span {
    font-size: 16px;
    background: rgba(255, 255, 255, .18);
    padding: 4px 10px;
    border-radius: 8px;
}

.sum-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.sum-secure {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-top: 14px;
}

.sum-secure svg { width: 18px; height: 18px; color: #12a05c; flex-shrink: 0; }

/* Mobile bottom bar (hidden on desktop) */
.mobile-bar { display: none; }

/* ---------- Confirmation ---------- */
.order-done {
    max-width: 620px;
    margin: 20px auto 0;
    text-align: center;
}

.done-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #12a05c;
    color: #fff;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    box-shadow: 0 0 0 10px #dff5ea;
    animation: pop .5s cubic-bezier(.2, 1.4, .4, 1);
}

.done-icon svg { width: 42px; height: 42px; stroke-width: 3; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.order-done h1 { font-size: 40px; font-weight: 600; letter-spacing: -1px; color: var(--heading); margin-bottom: 10px; }
.done-sub { font-size: 17px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.done-sub strong { color: var(--heading); }

.done-ref {
    display: inline-block;
    background: #fff;
    border: 1.5px dashed #c9cfdf;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 24px;
}

.done-ref strong { color: var(--heading); letter-spacing: 1px; margin-left: 6px; }

.done-card {
    text-align: left;
    background: #fff;
    border-radius: 22px;
    border: 1px solid #e8ebf3;
    padding: 24px;
    margin-bottom: 24px;
}

.done-card dl { display: grid; gap: 10px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #eef0f5; }
.done-card dl div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: 15px; }
.done-card dt { color: var(--muted); }
.done-card dd { color: var(--heading); font-weight: 500; }
.done-card .sum-deposit { padding-top: 10px; border-top: 1px dashed #dde0ea; }

.done-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.done-btn {
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 26px;
    border-radius: 14px;
    transition: background .2s;
}

.done-btn:hover { background: var(--primary-dark); }
.done-btn.ghost { background: #fff; color: var(--heading); border: 1.5px solid #dde0ea; }
.done-btn.ghost:hover { border-color: var(--heading); }

/* ========== Responsive ========== */
@media (max-width: 1100px) {
    .order-grid { grid-template-columns: 1fr 340px; }
    .pay-grid { grid-template-columns: 1fr 1fr; }
    .type-tab span { grid-template-columns: 1fr; text-align: left; }
    .type-tab svg { grid-row: auto; margin-bottom: 8px; }
}

@media (max-width: 900px) {
    .order-page { padding: 24px 0 120px; }
    .order-head h1 { font-size: 34px; }
    .order-grid { grid-template-columns: 1fr; }
    .order-summary { position: static; scroll-margin-top: calc(var(--header-h) + 10px); }

    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 95;
        background: #fff;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px rgba(11, 11, 26, .1);
    }

    .mobile-bar small { display: block; font-size: 12px; color: var(--muted); }
    .mobile-bar strong { font-size: 22px; font-weight: 700; color: var(--heading); }

    .mobile-bar-btn {
        background: var(--primary);
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        padding: 13px 22px;
        border-radius: 12px;
    }

    /* keep chat button above the bottom bar on this page */
    body:has(.mobile-bar) .chat-fab { bottom: 92px; }
}

@media (max-width: 600px) {
    .order-head h1 { font-size: 28px; }
    .order-head p { font-size: 15px; }
    .step-card { padding: 20px 16px 22px; border-radius: 18px; }
    .step-title { font-size: 19px; }
    .type-tabs { gap: 8px; }
    .type-tab span { padding: 12px 10px; }
    .type-tab small { display: none; }
    .type-tab strong { font-size: 14px; }
    .car-grid, .addon-grid, .deliv-opts { grid-template-columns: 1fr; }
    .car-box { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; }
    .car-art { width: 96px; height: 46px; grid-row: 1 / 4; margin: 0; align-self: center; }
    .car-specs { grid-column: 1 / -1; margin: 10px 0; }
    .car-price { grid-column: 1 / -1; }
    .field-row.two { grid-template-columns: 1fr; }
    .trip-line { padding-left: 40px; }
    .trip-line::before { left: 13px; }
    .dot { left: -40px; width: 28px; height: 28px; font-size: 13px; }
    .sum-card { padding: 20px 16px; }
    .done-card dl div { grid-template-columns: 1fr; gap: 2px; }
    .order-done h1 { font-size: 30px; }
}