/* WAKANA cart — ทุก class ขึ้นต้นด้วย wk- กันชนกับ CSS เดิมของเว็บ */
.wk-fab,
.wk-overlay,
.wk-toast {
  --wk-line: #06c755;
  --wk-line-dark: #05a847;
  --wk-ink: #222;
  --wk-muted: #6b6b6b;
  --wk-border: #e3e3e3;
  --wk-bg: #fff;
  --wk-soft: #f6f6f6;
  --wk-danger: #c62828;
  font-family: inherit;
  color: var(--wk-ink);
  box-sizing: border-box;
}
.wk-overlay *,
.wk-overlay *::before,
.wk-overlay *::after {
  box-sizing: border-box;
}
html.wk-lock,
html.wk-lock body {
  overflow: hidden;
}

/* ---------- ปุ่มลอย ---------- */
.wk-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483000;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--wk-line);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.wk-fab[hidden] {
  display: none;
}
.wk-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--wk-danger);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}
.wk-fab-count:empty {
  display: none;
}
.wk-bump {
  animation: wk-bump 0.35s ease;
}
@keyframes wk-bump {
  50% {
    transform: scale(1.15);
  }
}

/* ---------- แผงตะกร้า ---------- */
.wk-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: flex-end;
}
.wk-overlay[hidden] {
  display: none;
}
.wk-drawer {
  width: min(440px, 100vw);
  height: 100%;
  max-height: 100dvh;
  background: var(--wk-bg);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}
.wk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--wk-border);
}
.wk-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.wk-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--wk-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--wk-ink);
}
.wk-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 20px;
}
.wk-footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--wk-border);
  background: var(--wk-bg);
}
.wk-footer[hidden] {
  display: none;
}
.wk-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 8px;
}

/* ---------- รายการในตะกร้า ---------- */
.wk-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wk-border);
}
.wk-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--wk-soft);
}
.wk-item-main {
  min-width: 0;
}
.wk-item-name {
  display: block;
  font-weight: 600;
  color: var(--wk-ink);
  text-decoration: none;
  line-height: 1.35;
}
.wk-item-price {
  font-size: 13px;
  color: var(--wk-muted);
  margin: 2px 0 6px;
}
.wk-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}
.wk-item-subtotal {
  font-weight: 700;
  white-space: nowrap;
}
.wk-remove {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--wk-muted);
  font-size: 20px;
  cursor: pointer;
}
.wk-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--wk-border);
  border-radius: 8px;
  overflow: hidden;
}
.wk-stepper button {
  width: 36px;
  height: 34px;
  border: 0;
  background: var(--wk-soft);
  font-size: 18px;
  cursor: pointer;
  color: var(--wk-ink);
}
.wk-stepper button:disabled {
  opacity: 0.4;
  cursor: default;
}
.wk-qty {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
}
.wk-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  font-size: 17px;
}
.wk-total strong {
  font-size: 20px;
}
.wk-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--wk-muted);
}

/* ---------- ฟอร์ม ---------- */
.wk-form {
  margin-top: 12px;
}
.wk-field {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.wk-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}
.wk-form input[type='text'],
.wk-form input[type='tel'],
.wk-form input[type='datetime-local'],
.wk-form textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px; /* < 16px แล้ว iOS ซูมเข้าเองตอนแตะช่อง */
  padding: 10px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 8px;
  background: #fff;
  color: var(--wk-ink);
}
.wk-form [aria-invalid='true'] {
  border-color: var(--wk-danger);
}
.wk-radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--wk-border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.wk-radio:has(input:checked) {
  border-color: var(--wk-line);
  background: #f0fbf4;
}
/* CSS ของเว็บที่ฝังตะกร้าอาจซ่อน radio (wakana: style12.css เลื่อนไป left:-9999px · Bootstrap clip ทิ้ง)
   ⇒ selector ต้องเฉพาะเจาะจงกว่า [type=radio]:not(:checked) */
.wk-overlay .wk-radio input[type='radio'] {
  position: static;
  left: auto;
  clip: auto;
  pointer-events: auto;
  opacity: 1;
  appearance: auto;
  -webkit-appearance: radio;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--wk-line);
}
.wk-overlay legend.wk-label {
  width: auto;
  font-size: inherit;
  line-height: inherit;
  margin-bottom: 6px;
}
.wk-radio span {
  display: flex;
  flex-direction: column;
}
.wk-radio small {
  color: var(--wk-muted);
}
.wk-address[hidden] {
  display: none;
}
.wk-location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -6px 0 14px;
}
.wk-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--wk-muted);
}
.wk-error {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--wk-danger);
}
.wk-error[hidden] {
  display: none;
}
.wk-notice {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e1;
  font-size: 14px;
}

/* ---------- ปุ่ม ---------- */
.wk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.wk-btn-line {
  background: var(--wk-line);
  color: #fff;
}
.wk-btn-line:hover {
  background: var(--wk-line-dark);
}
.wk-btn-secondary {
  background: var(--wk-soft);
  color: var(--wk-ink);
  border: 1px solid var(--wk-border);
}
.wk-empty .wk-btn {
  display: inline-flex;
  width: auto;
  margin-top: 8px;
}
.wk-link {
  border: 0;
  background: none;
  padding: 6px 0;
  font: inherit;
  font-size: 14px;
  color: #1a73e8;
  text-decoration: underline;
  cursor: pointer;
}
.wk-link-danger {
  color: var(--wk-danger);
}

/* ---------- ส่งต่อไปมือถือ ---------- */
.wk-handoff {
  text-align: center;
}
.wk-qr {
  width: min(280px, 80vw);
  margin: 12px auto;
}
.wk-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- toast ---------- */
.wk-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483002;
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(34, 34, 34, 0.92);
  color: #fff;
  font-size: 15px;
  text-align: center;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.wk-toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* แผงตะกร้าเปิดอยู่ = ปุ่มสั่งอยู่ล่าง ⇒ ย้าย toast ไปใต้หัวแผง ไม่ให้บังปุ่ม */
html.wk-lock .wk-toast {
  top: calc(80px + env(safe-area-inset-top, 0px));
  bottom: auto;
  transform: translate(-50%, -20px);
}
html.wk-lock .wk-toast-show {
  transform: translate(-50%, 0);
}

@media (max-width: 480px) {
  .wk-drawer {
    width: 100vw;
    box-shadow: none;
  }
}
