/* =====================================================================
   DELIVERY: choose your agent, order tracking, rider app
   Loaded after style.css and products.css
   (order status chips .status / .st-* live in style.css)
===================================================================== */

/* ---------- Rider avatar, dots, stars ---------- */
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--g-800); display: block; border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.avatar-default { display: grid; place-items: center; background: linear-gradient(145deg, var(--g-500), var(--g-800)); }
.avatar-default svg { width: 66%; height: 66%; }
.table .avatar { width: 44px; height: 44px; border-width: 2px; }
.star { color: var(--amber); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--g-500); box-shadow: 0 0 0 3px rgba(22,160,95,.18); }
.dot.off { background: #b2bdb6; }
.rc-line { display: block; font-size: .85rem; color: var(--ink-2); font-weight: 600; margin-top: 2px; }

/* =================================
   Choose your delivery agent (choose_rider.php)
================================= */
.cr-wrap {
    width: min(1200px, 100% - 40px); margin: 32px auto 0;
    display: grid; grid-template-columns: 1fr 390px; gap: 30px; align-items: start;
}
.cr-title { font-family: var(--serif); color: var(--g-900); font-size: clamp(1.8rem, 3.6vw, 2.5rem); line-height: 1.1; margin-bottom: 6px; }
.cr-bike { font-style: normal; }
.cr-sub { font-size: 1.1rem; font-weight: 700; color: var(--ink-2); margin: 18px 0 14px; }
.cr-filters {
    display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
    padding: 14px 18px; margin-bottom: 14px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; font-weight: 600; font-size: .92rem;
}
.cr-filters label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.cr-filters input { width: 18px; height: 18px; accent-color: var(--g-600); }
.cr-fl { font-weight: 700; color: var(--ink-2); }
.cr-note { margin: 0 0 12px; font-size: .85rem; color: var(--muted); font-weight: 600; }

.rider-card {
    position: relative; display: flex; align-items: center; gap: 18px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 20px;
    padding: 16px 22px 16px 16px; margin-bottom: 12px; cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.rider-card:hover { border-color: var(--g-300); box-shadow: var(--shadow-sm); }
.rider-card:has(input:checked) { border-color: var(--g-600); background: var(--g-50); box-shadow: 0 0 0 4px rgba(22,160,95,.12); }
.rider-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rider-card .avatar { width: 68px; height: 68px; }
.rc-name { display: block; font-size: 1.1rem; color: var(--ink); }
.rc-pick { margin-left: auto; }
.t-select, .t-selected { display: inline-block; border-radius: 999px; padding: 8px 22px; font-weight: 700; font-size: .9rem; }
.t-select { border: 1.5px solid var(--g-600); color: var(--g-700); background: #fff; }
.t-selected { display: none; background: var(--g-600); color: #fff; border: 1.5px solid var(--g-600); }
.rider-card input:checked ~ .rc-pick .t-select { display: none; }
.rider-card input:checked ~ .rc-pick .t-selected { display: inline-block; }
.rider-card.is-off .avatar { filter: grayscale(.6); }
.rider-card.is-disabled { cursor: not-allowed; opacity: .55; }
.rider-card.is-disabled .rc-pick { display: none; }

.cr-side { display: grid; gap: 22px; position: sticky; top: 98px; }
.cr-loc { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 0; overflow: hidden; }
.cr-loc h3 { font-size: 1rem; }
.cr-loc p { font-size: .88rem; color: var(--muted); margin: 6px 0 14px; }
.cr-loc iframe { width: calc(100% + 36px); margin: 0 -18px; height: 190px; border: 0; display: block; }
.cr-sum { position: static; }
.cr-secure { text-align: center; font-size: .78rem; color: var(--muted); margin: 12px 0 8px; font-weight: 600; }
.cr-info { background: var(--g-50); border: 1px solid var(--g-200); border-radius: 12px; padding: 10px 14px; font-size: .78rem; line-height: 1.5; color: var(--g-800); }
.cr-cancel { text-align: center; margin-top: 12px; }
.cr-cancel button { background: none; border: 0; color: var(--red); text-decoration: underline; font: 700 .85rem var(--font); cursor: pointer; }

/* =================================
   Order confirmed / tracking (order_success.php)
================================= */
.tk-wrap {
    width: min(1200px, 100% - 40px); margin: 28px auto 0;
    display: grid; grid-template-columns: 1fr 350px; gap: 30px; align-items: start;
}
.tk-head { display: flex; gap: 18px; align-items: center; margin: 4px 0 6px; }
.tk-check { width: 60px; height: 60px; border-radius: 50%; background: var(--g-600); color: #fff; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; flex-shrink: 0; box-shadow: 0 0 0 8px rgba(22,160,95,.15); }
.tk-check.sm { width: 26px; height: 26px; font-size: .85rem; display: inline-grid; vertical-align: middle; margin-right: 6px; box-shadow: none; }
.tk-head.is-bad .tk-check { background: var(--red); box-shadow: 0 0 0 8px rgba(214,69,69,.14); }
.tk-head h1 { font-family: var(--serif); color: var(--g-900); font-size: 2rem; line-height: 1.1; }
.tk-head.is-bad h1 { color: var(--red); }
.tk-head p { color: var(--muted); max-width: 560px; margin-top: 4px; }

.tl { list-style: none; display: flex; margin: 30px 0 26px; padding: 22px 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.tl li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .85rem; color: var(--ink-2); text-align: center; }
.tl li::before { content: ''; position: absolute; top: 18px; right: 50%; width: 100%; height: 4px; background: var(--line); z-index: 0; border-radius: 2px; }
.tl li:first-child::before { display: none; }
.tl li.done::before { background: var(--g-500); }
.tl-dot { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: grid; place-items: center; font-weight: 800; margin-bottom: 4px; }
.tl li.done .tl-dot { background: var(--g-600); border-color: var(--g-600); color: #fff; }
.tl li small { color: var(--muted); min-height: 1em; font-weight: 600; }

.tk-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 24px; margin-bottom: 20px; }
.tk-card h3 { font-size: 1rem; margin-bottom: 12px; }
.tk-rider { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: center; }
.tk-rider-info { display: flex; gap: 14px; align-items: flex-start; }
.tk-rider-info .avatar { width: 76px; height: 76px; }
.tk-rname { display: block; font-size: 1.15rem; }
.btn-call {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 9px 22px;
    background: var(--g-600); color: #fff; border-radius: 12px; font-weight: 700; text-decoration: none; font-size: .9rem;
}
.btn-call:hover { background: var(--g-700); color: #fff; }
.tk-map-box { min-width: 0; }
#track-map { height: 210px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; }
.tk-map-note { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 8px; }
.emoji-pin { font-size: 26px; line-height: 30px; text-align: center; background: none; border: 0; }

.tk-totals { margin: 14px 0 0 auto; max-width: 320px; font-size: .92rem; font-weight: 600; }
.tk-totals div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink-2); }
.tk-grand { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px !important; color: var(--g-700) !important; font-weight: 800; font-size: 1.1rem; }

.tk-info h3 { color: var(--g-800); }
.tk-kv { display: flex; justify-content: space-between; margin: 10px 0; font-size: .95rem; color: var(--ink-2); }
.tk-info hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.tk-loc { display: flex; gap: 10px; }
.tk-loc p { font-size: .85rem; margin-top: 2px; color: var(--muted); }
.tk-pin { font-size: 1.5rem; }
.tk-eta {
    background: linear-gradient(135deg, var(--g-600), var(--g-800)); color: #fff;
    border-radius: 20px; padding: 18px 22px; margin-bottom: 20px;
}
.tk-eta strong { display: block; font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; margin: 2px 0; }
.tk-eta small { display: block; font-size: .8rem; font-weight: 600; color: #c8e6d5; }
.tk-home {
    display: block; text-align: center; background: var(--g-900); color: #fff; border-radius: 14px;
    padding: 13px; font-weight: 700; text-decoration: none;
}
.tk-home:hover { background: var(--g-800); color: #fff; }
.tk-stars { font-size: 1.6rem; color: var(--amber); }
.tk-rate { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-rate button { background: var(--amber-50); border: 1.5px solid #f5d891; border-radius: 12px; padding: 6px 13px; font: 700 .9rem var(--font); cursor: pointer; color: var(--amber-ink); }
.tk-rate button:hover { background: var(--amber); border-color: var(--amber); color: #fff; }

/* =================================
   Rider app (rider/index.php) - made for phones
================================= */
.rd-body { background: #eef3ef; }
.rd-top {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: linear-gradient(135deg, var(--g-700), var(--g-900)); color: #fff; padding: 16px 20px;
    position: sticky; top: 0; z-index: 10;
}
.rd-top b { font-size: 1.05rem; }
.rd-top small { display: block; color: #bfe3cd; font-weight: 600; }
.rd-top a { color: #fff; font-weight: 700; text-decoration: none; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: .88rem; }
.rd-top a:hover { background: rgba(255,255,255,.24); }
.rd-main { width: min(600px, 100%); margin: 0 auto; padding: 18px 16px 60px; }
.rd-flash { background: var(--g-50); border: 1px solid var(--g-200); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-weight: 700; color: var(--g-800); }
.rd-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.rd-status { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.rd-status h2 { font-size: 1.1rem; }
.gps { font-size: .82rem; font-weight: 600; color: var(--muted); margin-top: 4px; }
.gps.ok { color: var(--g-700); }
.gps.bad { color: var(--red); }
.rd-toggle { border: 0; border-radius: 999px; padding: 11px 20px; background: var(--g-600); color: #fff; font: 700 .92rem var(--font); cursor: pointer; white-space: nowrap; }
.rd-status.is-on .rd-toggle { background: #6b7a71; }
.rd-h { font-size: 1.05rem; margin: 22px 4px 12px; color: var(--ink-2); }
.rd-empty { text-align: center; color: var(--muted); font-weight: 600; padding: 28px 0; }

.rd-order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 1.1rem; }
.rd-cust { font-size: 1.15rem; font-weight: 800; }
.rd-phone { display: inline-block; margin: 4px 0; color: var(--g-700); font-weight: 700; text-decoration: none; }
.rd-addr { font-weight: 600; margin: 4px 0 10px; color: var(--ink-2); }
.rd-items { margin: 8px 0 8px 20px; font-weight: 600; color: var(--ink-2); }
.rd-total { color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.rd-total b { color: var(--ink); }
.rd-btns { display: flex; gap: 10px; margin-bottom: 10px; }
.rd-nav { flex: 1; text-align: center; background: var(--blue); color: #fff; border-radius: 14px; padding: 14px 8px; font-weight: 700; text-decoration: none; }
.rd-nav.alt { flex: 0 0 90px; background: #33ccff; color: #003; }
.rd-big { width: 100%; border: 0; border-radius: 16px; padding: 17px; font: 700 1.05rem var(--font); color: #fff; cursor: pointer; }
.rd-big.go { background: var(--violet); }
.rd-big.done { background: var(--g-600); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .cr-wrap, .tk-wrap { grid-template-columns: 1fr; }
    .cr-side { position: static; }
    .tk-rider { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .rider-card { flex-wrap: wrap; }
    .tl { padding-inline: 4px; }
    .tl li { font-size: .74rem; }
    .tl-dot { width: 34px; height: 34px; }
    .tl li::before { top: 16px; }
}
