/* Koperasi SMKSBS: delivery address picker + order summary (checkout modal). */
.dlv { margin: 4px 0 6px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--azure) 5%, var(--paper)); border: 1px solid color-mix(in srgb, var(--azure) 22%, var(--line)); }
.dlv.in { animation: dlvIn 420ms var(--ease-out) both; }
@keyframes dlvIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.dlv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dlv-head label { margin: 0 !important; }
.dlv-rate { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; color: var(--azure-dark); background: color-mix(in srgb, var(--azure) 13%, transparent); white-space: nowrap; }

/* search */
.dlv-search { position: relative; }
.dlv-search input { width: 100%; padding-left: 42px !important; padding-right: 42px !important; }
.dlv-ico { position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: var(--azure); pointer-events: none; }
.dlv-spin { position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--azure) 25%, transparent); border-top-color: var(--azure); opacity: 0; pointer-events: none; }
.dlv-spin.on, .dlv-search.loading .dlv-spin { opacity: 1; animation: dlvSpin .7s linear infinite; }
@keyframes dlvSpin { to { transform: rotate(360deg); } }
.dlv-clear { position: absolute; right: 8px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 13px; display: none; }
.dlv-clear:hover { background: color-mix(in srgb, var(--azure) 12%, transparent); color: var(--azure-dark); }
.dlv-search.has-text .dlv-clear { display: block; }
.dlv-search.has-text .dlv-spin.on { right: 40px; }

.dlv-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 290px; overflow-y: auto; border-radius: 14px; background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(8,27,54,.28); opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top; pointer-events: none; transition: opacity 180ms ease, transform 220ms var(--ease-out); }
.dlv-list.open { opacity: 1; transform: none; pointer-events: auto; }
.dlv-opt { display: flex; align-items: center; gap: 11px; padding: 11px 13px; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); animation: dlvOpt 320ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 38ms); }
.dlv-opt:last-child { border-bottom: 0; }
@keyframes dlvOpt { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.dlv-opt:hover, .dlv-opt.hi { background: color-mix(in srgb, var(--azure) 9%, transparent); }
.dlv-opt-ico { flex: 0 0 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--azure); background: color-mix(in srgb, var(--azure) 12%, transparent); transition: transform 220ms var(--ease-spring); }
.dlv-opt-ico svg { width: 18px; height: 18px; }
.dlv-opt:hover .dlv-opt-ico, .dlv-opt.hi .dlv-opt-ico { transform: scale(1.12) rotate(-6deg); }
.dlv-opt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dlv-opt-main { font-size: 14px; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlv-opt-main b { color: var(--azure-dark); font-weight: 700; }
.dlv-opt-sec { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlv-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.dlv-chip b { font-size: 12.5px; color: var(--ink); }
.dlv-chip small { font-size: 11px; color: var(--azure-dark); font-weight: 600; }
.dlv-empty { padding: 16px; font-size: 13px; color: var(--ink-faint); text-align: center; }

/* locate button */
.dlv-locate { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 11px 14px; border-radius: 12px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--azure-dark); background: var(--paper); border: 1.5px dashed color-mix(in srgb, var(--azure) 45%, var(--line)); transition: background 200ms, transform 200ms var(--ease-spring), border-color 200ms; }
.dlv-locate svg { width: 18px; height: 18px; }
.dlv-locate:hover { background: color-mix(in srgb, var(--azure) 8%, var(--paper)); border-style: solid; transform: translateY(-1px); }
.dlv-locate:active { transform: scale(.98); }
.dlv-locate.busy svg { animation: dlvSpin 1s linear infinite; }

/* map */
.dlv-map-wrap { position: relative; height: 0; opacity: 0; margin-top: 0; border-radius: 14px; overflow: hidden; transition: height 520ms var(--ease-out), opacity 400ms ease, margin 400ms var(--ease-out); }
.dlv-map-wrap.open { height: 230px; opacity: 1; margin-top: 12px; border: 1px solid var(--line); }
.dlv-map { position: absolute; inset: 0; }
.dlv-map-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2; pointer-events: none; font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: rgba(8,27,54,.78); color: #fff; backdrop-filter: blur(4px); white-space: nowrap; }
.dlv-pin { display: flex; align-items: center; justify-content: center; }
.dlv-pin svg { width: 100%; height: 100%; }
.dlv-pin-school { width: 34px; height: 34px; padding: 7px; border-radius: 50%; color: #fff; background: #0F2A50; border: 2.5px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.dlv-pin-dest { width: 40px; height: 40px; color: var(--azure); filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); transform-origin: 50% 100%; }
.dlv-pin-dest.drop { animation: dlvDrop 640ms var(--ease-spring) both; }
@keyframes dlvDrop { 0% { transform: translateY(-46px) scale(.6); opacity: 0; } 60% { transform: translateY(2px) scale(1.06); opacity: 1; } 100% { transform: none; } }

/* result card */
.dlv-result { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 420ms var(--ease-out), opacity 300ms ease, margin 300ms; }
.dlv-result.show { max-height: 200px; opacity: 1; margin-top: 12px; }
.dlv-r-main { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 14px; color: #fff; background: linear-gradient(155deg, var(--azure), var(--azure-dark)); box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--azure-dark) 70%, #000); position: relative; overflow: hidden; }
.dlv-result.show .dlv-r-main::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 35%; background: linear-gradient(105deg, rgba(255,255,255,0), rgba(255,255,255,.35), rgba(255,255,255,0)); transform: skewX(-18deg); animation: dlvSheen 1100ms ease-out 250ms 1 both; pointer-events: none; }
@keyframes dlvSheen { to { transform: translateX(520%) skewX(-18deg); } }
.dlv-r-ico { flex: 0 0 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.dlv-r-ico svg { width: 21px; height: 21px; }
.dlv-result.show .dlv-r-ico svg { animation: dlvDrive 900ms var(--ease-out) 1; }
@keyframes dlvDrive { from { transform: translateX(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
.dlv-r-text { flex: 1; min-width: 0; }
.dlv-r-addr { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dlv-r-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; opacity: .92; }
.dlv-r-meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.dlv-r-fee { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; white-space: nowrap; }

.dlv-extra { margin-top: 12px; }
.dlv-extra label { margin: 0 0 6px !important; }
.dlv-extra textarea { width: 100%; }
.dlv-note { font-size: 12.5px; line-height: 1.5; margin-top: 0; max-height: 0; overflow: hidden; opacity: 0; color: var(--ink-soft); transition: max-height 300ms, opacity 300ms, margin 300ms; }
.dlv-note.show { max-height: 80px; opacity: 1; margin-top: 10px; }
.dlv-note.bad { color: #B3261E; font-weight: 600; }
.dlv.plain .dlv-search, .dlv.plain .dlv-locate, .dlv.plain .dlv-map-wrap, .dlv.plain .dlv-result { display: none; }
.dlv.plain .dlv-extra { margin-top: 0; }

/* order summary above the confirm button */
.ck-sum { padding: 0 2px 12px; font-size: 13.5px; }
.ck-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; color: var(--ink-soft); }
.ck-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ck-fee-row { max-height: 0; overflow: hidden; opacity: 0; padding: 0; transition: max-height 350ms var(--ease-out), opacity 300ms, padding 300ms; }
.ck-fee-row.on { max-height: 40px; opacity: 1; padding: 3px 0; }
.ck-total { margin-top: 6px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 15px; font-weight: 700; color: var(--ink); }
.ck-total b { font-family: 'Space Grotesk', sans-serif; font-size: 20px; color: var(--azure-dark); }
.pay-fee-note { margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }

/* dark theme */
[data-theme="dark"] .dlv { background: rgba(244,162,97,.06); border-color: rgba(244,162,97,.25); }
[data-theme="dark"] .dlv-rate { color: #F4A261; background: rgba(244,162,97,.14); }
[data-theme="dark"] .dlv-list { background: #14223D; border-color: rgba(255,255,255,.1); box-shadow: 0 18px 40px -10px rgba(0,0,0,.6); }
[data-theme="dark"] .dlv-opt { border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .dlv-opt:hover, [data-theme="dark"] .dlv-opt.hi { background: rgba(244,162,97,.12); }
[data-theme="dark"] .dlv-opt-main b, [data-theme="dark"] .dlv-chip small, [data-theme="dark"] .ck-total b, [data-theme="dark"] .dlv-locate { color: #F4A261; }
[data-theme="dark"] .dlv-locate { background: #14223D; border-color: rgba(244,162,97,.4); }
[data-theme="dark"] .dlv-map-wrap.open { border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .dlv-note.bad { color: #FF9C94; }

@media (max-width: 520px) {
  .dlv { padding: 12px; border-radius: 14px; }
  .dlv-map-wrap.open { height: 200px; }
  .dlv-r-fee { font-size: 18px; }
  .dlv-chip small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dlv.in, .dlv-opt, .dlv-pin-dest.drop, .dlv-r-main::after, .dlv-r-ico svg { animation: none !important; }
  .dlv-map-wrap, .dlv-result, .ck-fee-row, .dlv-list { transition: none; }
}

.dlv-opt-optional, .dlv-extra .dlv-optl { font-weight: 400; color: var(--ink-faint); }

[data-theme="dark"] .dlv { --azure: #F4A261; --azure-dark: #F4A261; }
[data-theme="dark"] .dlv-r-main { background: linear-gradient(155deg, #E8873A, #C2641E); color: #fff; }
[data-theme="dark"] .dlv-r-ico { background: rgba(255,255,255,.2); }
[data-theme="dark"] .dlv-pin-dest { color: #F4A261; }

/* Leaflet map */
.dlv-map { z-index: 0; isolation: isolate; background: #e8eef3; }
.dlv-map .leaflet-control-attribution { font-size: 10px; }
.dlv-map .leaflet-control-zoom { border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.dlv-ic { background: none; border: 0; }
.dlv-ic .dlv-pin { width: 100%; height: 100%; }
.dlv-ic .dlv-pin-school { box-sizing: border-box; }
[data-theme="dark"] .dlv-map .leaflet-control-attribution { background: rgba(10,18,32,.75); color: #9FB3D9; }
[data-theme="dark"] .dlv-map .leaflet-control-zoom a { background: #14223D; color: #fff; border-color: rgba(255,255,255,.12); }

.dlv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dlv-actions .dlv-locate { margin-top: 0; padding: 11px 8px; }
.dlv-empty-btn { display: block; margin: 10px auto 0; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--azure); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.dlv-relaxed { padding: 9px 13px; font-size: 12px; line-height: 1.45; color: var(--ink-soft); background: color-mix(in srgb, var(--azure) 8%, transparent); border-bottom: 1px solid var(--line); }
[data-theme="dark"] .dlv-empty-btn { background: #E8873A; }
@media (max-width: 380px) { .dlv-actions { grid-template-columns: 1fr; } }
