/* Bảng màu thương hiệu Thủy Sinh Tím — đồng bộ với website chính thuysinhtim.vn
   đỏ #e0130b (nút, giá, hành động) · đỏ đậm #b90000 (thanh menu) · navy #06273c (tiêu đề, chân trang)
   tím nhạt #c098d4 và xanh lá #96cf28 lấy từ logo (điểm nhấn) */
:root {
  --red: #e0130b;
  --red-d: #b90000;
  --red-l: #fdecea;
  --navy: #06273c;
  --navy-2: #0d3b57;
  --lav: #c098d4;
  --lav-d: #7d4f9a;
  --lav-l: #f5eefa;
  --green: #96cf28;
  --green-d: #4f8a10;
  --green-l: #eef8d9;

  --ink: #1a1a1a;
  --muted: #666;
  --line: #e3e3e3;
  --bg: #f5f5f5;
  --card: #ffffff;
  --warn: #d97706;
  --danger: #d1344b;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(6, 39, 60, 0.12);

  /* tên cũ, giữ lại để trang nhân viên (admin) vẫn chạy bình thường */
  --violet: var(--red);
  --violet-d: var(--red-d);
  --violet-l: var(--lav-l);
  --teal: var(--green-d);
  --teal-l: var(--green-l);

  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.btn {
  border: 0; border-radius: 4px; padding: 10px 16px; font-weight: 700; background: var(--red); color: #fff;
  transition: transform .08s, background .15s; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:hover { background: var(--red-d); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--lav-l); }
.btn.teal { background: var(--green-d); }
.btn.teal:hover { background: #3e6e0c; }
.btn.danger { background: #fde8ec; color: var(--danger); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 4px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #d4d4d4; border-radius: 4px; background: #fff; min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: transparent; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }

dialog { border: 0; border-radius: 8px; padding: 0; max-width: min(720px, 94vw); width: 100%; box-shadow: 0 24px 80px rgba(6, 39, 60, .4); color: var(--ink); }
dialog::backdrop { background: rgba(6, 39, 60, .6); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--navy); color: #fff; border-radius: 8px 8px 0 0; }
.dlg-head h2 { margin: 0; font-size: 17px; }
.dlg-body { padding: 18px 20px; max-height: 76vh; overflow: auto; }
.x { background: none; border: 0; font-size: 26px; line-height: 1; color: #cfe0ea; padding: 4px 8px; }
.x:hover { color: #fff; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--lav-l); color: var(--lav-d); }
.badge.teal { background: var(--green-l); color: var(--green-d); }
.badge.warn { background: var(--red); color: #fff; }
.badge.gray { background: #eee; color: #555; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 6px; z-index: 99; box-shadow: var(--shadow); max-width: 90vw; }

/* link sang trang website chính */
.shop-link { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--navy); text-decoration: none; }
.shop-link:hover { text-decoration: underline; color: var(--red); }

/* ---------- popup chọn điểm giao trên bản đồ ---------- */
#mapDlg { max-width: min(760px, 96vw); display: none; flex-direction: column; overflow: hidden; }
#mapDlg[open] { display: flex; }
.map-search { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.map-search input { min-height: 40px; }
.map-res { max-height: 38vh; overflow: auto; border-bottom: 1px solid var(--line); background: #fff; }
.map-r { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f0f0; background: #fff; padding: 10px 14px; font-size: 14px; }
button.map-r:hover { background: var(--lav-l); }
.map-r.muted { color: var(--muted); }
.map-wrap { position: relative; height: min(58vh, 460px); background: #e8eef2; }
#mapBox { position: absolute; inset: 0; }
.map-pin { position: absolute; left: 50%; top: 50%; width: 34px; height: 50px; margin: -50px 0 0 -17px; z-index: 500; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.map-tip { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 500; pointer-events: none; background: rgba(6,39,60,.85); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.map-me { position: absolute; right: 10px; bottom: 26px; z-index: 500; border: 0; background: #fff; color: var(--navy); font-weight: 700; padding: 9px 12px; border-radius: 6px; box-shadow: var(--shadow); }
.map-msg { position: absolute; left: 10px; right: 10px; bottom: 70px; z-index: 500; background: var(--navy); color: #fff; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.map-foot { padding: 12px; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); background: #fff; }
.map-addr { flex: 1; font-size: 14px; color: var(--muted); min-width: 0; }
.map-addr b { color: var(--ink); font-weight: 600; }
.map-far { margin-top: 6px; padding: 6px 10px; border-radius: 4px; background: #fff4e5; color: #7a3e00; font-weight: 700; font-size: 13px; }
.map-foot .btn { flex: none; }
@media (max-width: 560px) {
  #mapDlg { max-width: 100vw; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  #mapDlg .dlg-head { border-radius: 0; }
  .map-wrap { flex: 1; height: auto; }
  .map-foot { flex-direction: column; align-items: stretch; }
  .map-tip { font-size: 12px; }
}

/* nút chọn điểm giao trong giỏ */
.pick-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1.5px dashed var(--red); background: var(--red-l); border-radius: 6px; padding: 12px; min-height: 52px; }
.pick-btn span { flex: 1; font-size: 14px; color: var(--ink); }
.pick-btn b { flex: none; background: var(--red); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 4px; }
.pick-btn.ok { border-style: solid; border-color: var(--green-d); background: var(--green-l); }
.pick-btn.ok b { background: var(--green-d); }
.pick-btn.bad { border-color: var(--red); border-style: solid; }
.far-warn { margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: #fff4e5; border: 1.5px solid var(--warn); color: #7a3e00; font-size: 14px; font-weight: 600; }
.order-form .two.one { grid-template-columns: 1fr; }
.lbl-sub { font-weight: 400; color: var(--muted); }
.time-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.time-hint button { border: 0; background: none; padding: 0; color: var(--red); font-weight: 700; text-decoration: underline; }
