/* =====================================================================
   หน้าร้านออนไลน์ — ดีไซน์ B แบบแอปช้อปปิ้งบนมือถือ (โหลดหลัง app.css จึงทับกฎ .shop* เดิม)
   ไฟล์นี้โหลดทุกหน้า: ทุกกฎต้องขึ้นต้นด้วย .shop เพื่อไม่กระทบหน้าพนักงาน
   สีหลักมาจากตัวแปรของร้าน: --brand, --brand-strong, --brand-rgb, --brand-soft, --brand-tint
   โครง: หัวสีร้าน (ติดบน) → [ช่องค้นหาติดบน] → เนื้อหา → ท้ายร้าน → แถบเมนูล่าง (มือถือ)
         หน้าที่มี .shop-actionbar (สินค้า/ตะกร้า/สั่งซื้อ) ใช้แถบปุ่มแทนแถบเมนูล่าง
   ===================================================================== */

.shop {
  --shop-shadow: 0 2px 10px rgba(120,60,20,.07);
  --shop-shadow-lift: 0 8px 22px rgba(120,60,20,.12);
  --shop-radius-card: 18px;
  --shop-radius-panel: 20px;
  --shop-bar-h: 56px;
  --shop-top: calc(var(--shop-bar-h) + env(safe-area-inset-top));
  --shop-tab-h: 62px;
  --shop-act-h: 76px;
  --shop-bottom: calc(var(--shop-tab-h) + env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  overflow-x: clip;
  padding-bottom: var(--shop-bottom);
}
.shop:has(.shop-actionbar) { --shop-bottom: calc(var(--shop-act-h) + env(safe-area-inset-bottom)); }

/* ---------- หัวร้าน: แถบสีของร้าน กะทัดรัด ---------- */
.shop .shop-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: var(--shop-top);
  padding: env(safe-area-inset-top) 12px 0 14px;
  background: var(--brand-strong); color: #fff;
  border: 0; border-radius: 0;
  box-shadow: 0 2px 10px rgba(var(--brand-rgb), .25);
}
.shop .shop-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem; line-height: 1.2;
}
.shop .shop-logo {
  flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: #fff; color: var(--brand-strong); font-weight: 800; font-size: 1.05rem; line-height: 1;
}
.shop .shop-brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop .shop-nav { display: none; align-items: center; gap: 4px; flex: none; }
.shop .shop-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: rgba(255,255,255,.88); text-decoration: none; font-size: .92rem; font-weight: 600; white-space: nowrap;
}
.shop .shop-link:hover { background: rgba(255,255,255,.14); color: #fff; }
.shop .shop-link.on { background: rgba(255,255,255,.2); color: #fff; }
.shop .shop-cart {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
  color: #fff; background: rgba(0,0,0,.16);
}
.shop .shop-cart:hover, .shop .shop-cart.on { background: rgba(0,0,0,.26); }
.shop .shop-cart-count {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: .72rem; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--brand-strong);
}
.shop .shop-bar .lang-switch { flex: none; background: rgba(0,0,0,.18); }
.shop .shop-bar .lang-switch a { min-height: 30px; padding: 0 10px; color: #fff; }
.shop .shop-bar .lang-switch a.on { background: #fff; color: var(--brand-strong); }

.shop .shop-announce {
  margin: 10px 12px 0; padding: 8px 14px; border-radius: 12px;
  background: var(--brand-soft); color: var(--ink); text-align: center; font-size: .85rem; font-weight: 600; line-height: 1.45;
}
.shop .shop-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 12px 12px 28px; min-width: 0; }
.shop .shop-footer {
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center;
  padding: 18px 16px 20px; background: transparent; border: 0;
  color: var(--muted); font-size: .85rem; text-align: center;
}
.shop .shop-footer strong { color: var(--ink); }
.shop .shop-footer a { color: inherit; }

/* ---------- แถบเมนูล่าง (มือถือ) ---------- */
.shop .shop-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  height: var(--shop-bottom); padding: 0 6px env(safe-area-inset-bottom);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(120,60,20,.06);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.shop:has(.shop-actionbar) .shop-tabbar { display: none; }
.shop .shop-tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
  height: var(--shop-tab-h); color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.shop .shop-tabbar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop .shop-tabbar a.on { color: var(--brand-strong); }
.shop .shop-tabbar a.on svg { stroke-width: 2.2; }
.shop .shop-tabbar a.on::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
.shop .shop-tabbar a { position: relative; }
.shop .shop-tab-icon { position: relative; display: inline-grid; }
.shop .shop-tab-badge {
  position: absolute; top: -5px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- แถบปุ่มล่างติดจอ (สินค้า/ตะกร้า/สั่งซื้อ) ---------- */
.shop .shop-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; /* สูงกว่าแถบเมนูล่าง เผื่อเบราว์เซอร์เก่าที่ไม่รองรับ :has */
  display: flex; align-items: center; gap: 12px;
  min-height: var(--shop-bottom); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.98); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(120,60,20,.08);
}
.shop .shop-act-main { flex: 1 1 auto; min-width: 0; }
.shop .shop-act-total { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; line-height: 1.25; }
.shop .shop-act-total .small { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop .shop-act-total strong { font-size: 1.2rem; font-weight: 800; white-space: nowrap; }

/* ---------- หัวข้อ / ว่าง ---------- */
.shop .shop-title { margin: 4px 2px 12px; font-size: 1.3rem; font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.shop .shop-title-count { font-size: .85rem; font-weight: 600; color: var(--muted); }
.shop .shop-subtitle { font-size: .95rem; margin: 18px 2px 8px; color: var(--muted); font-weight: 700; }
.shop .shop-empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--shop-radius-panel); box-shadow: var(--shop-shadow);
}
.shop .shop-empty h1 { color: var(--ink); font-size: 1.2rem; }
.shop .shop-empty p { margin: 0; }
.shop .shop-back {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px;
  background: var(--chip); color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 600;
}

/* ---------- ปุ่ม: หลัก = แคปซูลดำ, รอง = แคปซูลสีชิป ---------- */
/* หมายเหตุ: app.css มี .block { display:block } ซึ่งทำให้ปุ่ม .btn.block เรียงผิด จึงกำหนด display ที่นี่ */
.shop .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--chip); color: var(--ink); font-weight: 600; gap: 10px; line-height: 1.2; text-align: center;
}
.shop .btn.block { display: flex; width: 100%; }
.shop .btn:hover { background: color-mix(in srgb, var(--chip) 85%, var(--ink)); }
.shop .btn.primary { background: var(--ink); color: #fff; }
.shop .btn.primary:hover { background: #000; }
.shop .btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.shop .btn.ghost:hover { background: var(--surface); }
.shop .btn.small { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.shop .btn.big { min-height: 52px; font-size: 1.02rem; }
.shop .btn:disabled { opacity: .45; }
/* ปุ่มหลักแบบมีวงกลมสีร้านด้านขวา */
.shop .btn.shop-cta { justify-content: space-between; padding: 0 7px 0 22px; }
.shop .btn.shop-cta > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop .shop-cta-dot {
  flex: none; width: 38px; height: 38px; border-radius: 999px; background: var(--brand);
  display: grid; place-items: center;
}
.shop .btn.small .shop-cta-dot { width: 26px; height: 26px; }
.shop .shop-cta-dot::after {
  content: ""; width: 9px; height: 9px; margin-left: -3px;
  border-top: 2px solid #fff; border-right: 2px solid #fff; transform: rotate(45deg);
}
.shop .link { color: var(--brand-strong); }
.shop a:not(.btn):not(.chip):not(.shop-link) { -webkit-tap-highlight-color: rgba(var(--brand-rgb), .12); }

/* ---------- ฟอร์ม (ตัวอักษร 16px กัน iOS ซูม) ---------- */
.shop .field { color: var(--muted); font-weight: 600; font-size: .88rem; gap: 6px; }
.shop .field input, .shop .field select, .shop .field textarea,
.shop .shop-coupon-form input {
  font: inherit; font-size: 16px; font-weight: 400; min-height: 50px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%;
}
.shop .field textarea { min-height: 0; line-height: 1.5; }
.shop .field input:focus, .shop .field select:focus, .shop .field textarea:focus,
.shop .shop-coupon-form input:focus, .shop .shop-qty input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .2);
}
.shop details summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 6px 0; }

/* ---------- ค้นหา (ติดบน) + หมวด ---------- */
.shop .shop-searchbar {
  position: sticky; top: var(--shop-top); z-index: 20;
  margin: -12px -12px 10px; padding: 10px 12px;
  background: var(--bg);
}
.shop:has(.shop-announce) .shop-searchbar { margin-top: -6px; }
.shop .shop-search {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 4px 4px 12px;
  background: var(--surface); border-radius: 999px; box-shadow: 0 0 0 1px var(--line), var(--shop-shadow);
}
.shop .shop-search-icon { flex: none; color: var(--muted); }
.shop .shop-search input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 0; border: 0; background: transparent; color: var(--ink);
}
.shop .shop-search input:focus { outline: none; box-shadow: none; }
.shop .shop-search:focus-within { box-shadow: 0 0 0 2px var(--brand), var(--shop-shadow); }
.shop .shop-search .btn { min-height: 38px; padding: 0 16px; }
.shop .shop-cats {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px 12px; padding: 2px 12px 4px;
  scrollbar-width: none; scroll-padding-inline: 12px; -webkit-overflow-scrolling: touch;
}
.shop .shop-cats::-webkit-scrollbar { display: none; }
.shop .chip {
  flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap;
}
.shop .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- สไลด์แบนเนอร์ ---------- */
.shop .shop-slider { position: relative; margin: 0 0 12px; border-radius: var(--shop-radius-panel); overflow: hidden; box-shadow: var(--shop-shadow); }
.shop .shop-slides {
  position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.shop .shop-slides::-webkit-scrollbar { display: none; }
.shop .shop-slide {
  position: relative; flex: 0 0 100%; aspect-ratio: 16 / 9; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: flex-end; overflow: hidden;
  background: var(--slide-bg, var(--brand)); color: #fff; text-decoration: none;
}
.shop .shop-slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shop .shop-slide.has-img.has-text::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.62) 100%);
}
.shop .shop-slide.no-img {
  background-image: radial-gradient(circle at 88% 15%, rgba(255,255,255,.22) 0 22%, transparent 23%),
                    radial-gradient(circle at 100% 100%, rgba(0,0,0,.14) 0 30%, transparent 31%);
  background-color: var(--slide-bg, var(--brand));
  align-items: center;
}
.shop .shop-slide-text {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 18px 26px; max-width: 100%; min-width: 0;
}
.shop .shop-slide.no-img .shop-slide-text { padding: 18px 22px 24px; max-width: 86%; }
.shop .shop-slide-title {
  font-size: 1.25rem; font-weight: 800; line-height: 1.25; text-shadow: 0 1px 8px rgba(0,0,0,.25);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop .shop-slide-sub {
  font-size: .88rem; font-weight: 500; line-height: 1.4; opacity: .95;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop .shop-slide-btn {
  margin-top: 6px; display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: .85rem; font-weight: 700;
}
.shop .shop-dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2;
  display: flex; justify-content: center; gap: 2px; pointer-events: none;
}
.shop .shop-dots button {
  pointer-events: auto; width: 22px; height: 18px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.shop .shop-dots button::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.55);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08); transition: width .2s, background .2s;
}
.shop .shop-dots button.on::before { width: 18px; background: #fff; }

/* ---------- โปรซื้อครบยอด ---------- */
.shop .shop-promo-banner {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px 10px; padding: 0 12px 2px; scrollbar-width: none;
}
.shop .shop-promo-banner::-webkit-scrollbar { display: none; }
.shop .shop-promo-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-strong); font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.shop .shop-promo-pill::before {
  content: "%"; flex: none; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800;
}

/* ---------- การ์ดสินค้า (2 คอลัมน์บนมือถือ ความสูงเท่ากัน) ---------- */
.shop .shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shop .shop-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface); border-radius: var(--shop-radius-card); box-shadow: var(--shop-shadow);
  color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.shop .shop-card:hover { transform: translateY(-2px); box-shadow: var(--shop-shadow-lift); }
.shop .shop-card-link { display: flex; flex-direction: column; flex: 1 1 auto; gap: 4px; color: inherit; text-decoration: none; padding-bottom: 6px; }
.shop .shop-card-img {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-tint), rgba(var(--brand-rgb), .16));
}
.shop .shop-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.shop .shop-card:hover .shop-card-img img { transform: scale(1.03); }
.shop .shop-card-initial { font-size: 2.6rem; font-weight: 800; color: var(--brand-strong); opacity: .6; line-height: 1; }
.shop .shop-card-name {
  padding: 4px 10px 0; font-size: .9rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.4em * 2 + 4px);
}
.shop .shop-card-price {
  padding: 0 10px; margin-top: auto; font-weight: 800; font-size: 1.05rem; color: var(--brand-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop .shop-card-price small { font-weight: 600; color: var(--muted); font-size: .72rem; }
.shop .shop-card-price small:first-child { margin-right: 3px; }
.shop .shop-card-price .shop-card-unit { margin-left: 3px; }
.shop .shop-card-form { margin: 0; }
.shop .shop-card-act {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: calc(100% - 16px); min-height: 38px; margin: 0 8px 8px;
  padding: 0 10px; border: 0; border-radius: 999px; background: var(--chip); color: var(--ink);
  font: inherit; font-size: .85rem; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.shop .shop-card-act.add { background: var(--ink); color: #fff; }
.shop .shop-card-act.add span { font-size: 1.1rem; line-height: 1; margin-top: -2px; }
.shop .shop-card-act.add:hover { background: #000; }
.shop .shop-card-act.disabled { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); cursor: default; }
.shop .shop-card.sold-out .shop-card-img img, .shop .shop-card.sold-out .shop-card-initial { filter: grayscale(.9); opacity: .55; }
.shop .shop-card.sold-out .shop-card-price { color: var(--muted); }
.shop .sold-out-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; padding: 5px 14px; border-radius: 999px;
  background: rgba(31,26,23,.82); color: #fff; font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.shop .shop-promo-badge {
  position: absolute; left: 8px; top: 8px; z-index: 1; max-width: calc(100% - 16px);
  padding: 3px 9px; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb), .3);
}
.shop .shop-promo-badge.inline { position: static; box-shadow: none; flex: none; max-width: 100%; }

/* ---------- หน้าสินค้า ---------- */
.shop .shop-product { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.shop .shop-gallery {
  position: relative; background: var(--surface); border-radius: var(--shop-radius-card); overflow: hidden;
  box-shadow: var(--shop-shadow); min-width: 0;
}
.shop .shop-gallery-track {
  position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  background: var(--surface); scrollbar-width: none; border-radius: 0; overscroll-behavior-x: contain;
}
.shop .shop-gallery-track::-webkit-scrollbar { display: none; }
.shop .shop-gallery-track img {
  flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: start; scroll-snap-stop: always;
  background: var(--surface); display: block;
}
.shop .shop-gallery-empty {
  aspect-ratio: 2 / 1; background: linear-gradient(135deg, var(--brand-tint), rgba(var(--brand-rgb), .16));
  display: grid; place-items: center; font-size: 4.5rem; font-weight: 800; color: var(--brand-strong);
}
.shop .shop-gallery-empty span { opacity: .6; }
.shop .shop-dots.on-image button::before { background: rgba(31,26,23,.25); box-shadow: none; }
.shop .shop-dots.on-image button.on::before { background: var(--ink); }
.shop .shop-gallery-thumbs { display: none; gap: 8px; padding: 8px; overflow-x: auto; margin: 0; }
.shop .shop-gallery-thumbs a { flex: none; border-radius: 12px; }
.shop .shop-gallery-thumbs img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 0; box-shadow: 0 0 0 1px var(--line); }
.shop .shop-gallery-thumbs a.on img { box-shadow: 0 0 0 2px var(--brand); }
.shop .shop-buy {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--surface); border-radius: var(--shop-radius-card); padding: 16px; box-shadow: var(--shop-shadow);
}
.shop .shop-buy-cat {
  align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--chip);
  color: var(--muted); font-size: .78rem; font-weight: 600; text-decoration: none;
}
.shop .shop-buy h1 { font-size: 1.25rem; line-height: 1.35; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.shop .shop-price-big { font-size: 1.6rem; font-weight: 800; color: var(--brand-strong); line-height: 1.2; }
.shop .shop-price-big small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.shop .shop-price-big small:first-child { margin-right: 4px; }
.shop .shop-price-big .per-unit { margin-left: 4px; }
.shop .shop-buy-form { gap: 12px; margin-top: 4px; }
.shop .unit-choices { display: block; border: 0; padding: 0; margin: 0; min-width: 0; }
.shop .unit-choices.single { display: none; }
.shop .unit-choices legend { padding: 0 0 8px; color: var(--muted); font-weight: 700; font-size: .85rem; }
.shop .unit-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shop .unit-choice {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0;
  padding: 10px 14px; border-radius: 16px; min-height: 64px; justify-content: center;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
}
.shop .unit-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.shop .unit-choice span { flex: none; }
.shop .unit-choice .unit-name { font-weight: 700; font-size: .95rem; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop .unit-choice .unit-factor { font-size: .75rem; color: var(--muted); }
.shop .unit-choice strong { font-size: .95rem; color: var(--ink); }
.shop .unit-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.shop .unit-choice:has(input:checked)::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; border-radius: 999px;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.shop .unit-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.shop .unit-choice.disabled { opacity: .45; cursor: not-allowed; }
.shop .shop-desc { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.7; font-size: .95rem; overflow-wrap: anywhere; }

/* ช่องจำนวนแบบ − [ ] + */
.shop .shop-stepper {
  flex: none; display: inline-flex; align-items: center; height: 52px; padding: 4px; border-radius: 999px;
  background: var(--chip);
}
.shop .shop-stepper button {
  width: 40px; height: 44px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: var(--shop-shadow);
}
.shop .shop-stepper input {
  width: 44px; height: 44px; border: 0; background: transparent; text-align: center; color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 700; -moz-appearance: textfield; appearance: textfield;
}
.shop .shop-stepper input::-webkit-outer-spin-button, .shop .shop-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop .shop-stepper input:focus { outline: 2px solid var(--brand); border-radius: 10px; }

/* ---------- ตะกร้า / รายการสินค้า ---------- */
.shop .shop-lines { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.shop .shop-lines li {
  position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px;
  background: var(--surface); border: 0; border-radius: var(--shop-radius-panel); box-shadow: var(--shop-shadow);
}
.shop .shop-lines li.unavailable { box-shadow: 0 0 0 2px var(--danger), var(--shop-shadow); }
.shop .shop-line-img {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-tint), rgba(var(--brand-rgb), .16)); text-decoration: none;
}
.shop .shop-line-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop .shop-line-initial { font-size: 1.6rem; font-weight: 800; color: var(--brand-strong); opacity: .6; }
.shop .shop-line-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shop .shop-line-name {
  color: var(--ink); font-weight: 600; text-decoration: none; line-height: 1.4; font-size: .95rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop .shop-cart-lines .shop-line-name { padding-right: 30px; }
.shop .shop-line-info form { margin: 0; }
.shop .shop-line-info .shop-promo-tag { align-self: flex-start; }
.shop .shop-line-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.shop .shop-line-price { display: flex; flex-direction: column; align-items: flex-end; gap: 0; margin-left: auto; line-height: 1.25; }
.shop .shop-line-price strong { font-size: 1.05rem; font-weight: 800; }
.shop .shop-line-remove { position: absolute; top: 6px; right: 6px; margin: 0; }
.shop .shop-line-remove button {
  width: 34px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.shop .shop-line-remove button:hover { background: var(--danger-soft); color: var(--danger); }
.shop .shop-qtyctl { display: inline-flex; align-items: center; height: 38px; padding: 3px; border-radius: 999px; background: var(--chip); }
.shop .shop-qtyctl form { display: contents; }
.shop .shop-qtyctl button {
  width: 32px; height: 32px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1.15rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.shop .shop-qty { display: contents; }
.shop .shop-qtyctl .shop-qty input {
  width: 44px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent;
  text-align: center; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.shop .shop-qtyctl .shop-qty input::-webkit-outer-spin-button, .shop .shop-qtyctl .shop-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop .shop-qtyctl .shop-qty-save {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; box-shadow: none;
}
.shop .shop-lines.compact { margin: 0; gap: 0; }
.shop .shop-lines.compact li {
  grid-template-columns: 48px minmax(0, 1fr) auto; padding: 10px 0; box-shadow: none; border-radius: 0; border-bottom: 1px solid var(--line);
}
.shop .shop-lines.compact li:last-child { border-bottom: 0; }
.shop .shop-lines.compact .shop-line-img { border-radius: 10px; }
.shop .shop-lines.compact .shop-line-info > span:first-child { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.shop .shop-lines.compact .shop-line-price strong { font-size: .98rem; }

/* ---------- แผง / สรุปยอด ---------- */
.shop .shop-section, .shop .shop-summary {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; margin: 0 0 12px;
  background: var(--surface); border: 0; border-radius: var(--shop-radius-panel); box-shadow: var(--shop-shadow);
}
.shop .shop-section h2, .shop .shop-summary h2 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.shop .shop-step {
  flex: none; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 800;
}
.shop .shop-section p { margin: 0; }
.shop .shop-hint { background: var(--brand-soft); box-shadow: none; font-size: .92rem; line-height: 1.55; }
.shop .shop-hint a { color: var(--brand-strong); font-weight: 700; }
.shop .receipt-row { font-size: .93rem; align-items: flex-start; }
.shop .receipt-row > span:last-child { flex: none; text-align: right; }
.shop .receipt-row.small { font-size: .85rem; color: var(--muted); }
.shop .shop-sum-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.shop .shop-sum-line .shop-was { display: block; }
.shop .receipt-total {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 2px; padding: 12px 0 2px; border: 0; border-top: 1px dashed var(--line); font-weight: 700;
}
.shop .receipt-total strong { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.shop .shop-summary .btn + .btn { margin-top: 2px; }

/* ---------- สั่งซื้อ: วิธีรับสินค้า / ชำระเงิน ---------- */
.shop .ship-option, .shop .pay-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
}
.shop .ship-option:has(input:checked), .shop .pay-option:has(input:checked) {
  border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand);
}
.shop .ship-option input, .shop .pay-option input { accent-color: var(--brand); margin-top: 3px; }
.shop .ship-text { min-width: 0; line-height: 1.4; }
.shop .ship-fee { flex: none; max-width: 40%; font-weight: 800; line-height: 1.3; }
.shop .ship-fee small { font-weight: 500; font-size: .72rem; }
.shop .checkout-form { gap: 0; }
.shop .checkout-form .shop-section > .field + .field { margin-top: 2px; }

/* ---------- หน้าออเดอร์ ---------- */
.shop .order-head { gap: 4px; align-items: flex-start; }
.shop .order-head h1 { font-size: 1.5rem; margin: 0; }
.shop .shop-accounts { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.shop .shop-account { border: 0; border-radius: 18px; background: var(--chip); }
.shop .shop-account img { border-radius: 14px; }
.shop .amount-in { color: var(--brand-strong); }
.shop .upload { border-radius: 16px; }
.shop .timeline li::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .18); }
.shop .status-pill { padding: 3px 12px; font-weight: 600; }

/* ---------- ออเดอร์ของฉัน ---------- */
.shop .shop-orders { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shop .shop-orders a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 14px 16px;
  background: var(--surface); border: 0; border-radius: var(--shop-radius-panel); box-shadow: var(--shop-shadow);
  color: var(--ink); text-decoration: none;
}
.shop .shop-orders a:hover { box-shadow: 0 0 0 1px var(--brand), var(--shop-shadow); }
.shop .shop-orders a > strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.05rem; }
.shop .shop-orders a > .status-pill { justify-self: start; }
.shop .shop-orders a > span:last-child { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- บัญชี / เข้าสู่ระบบ ---------- */
.shop .shop-auth { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.shop .shop-auth .shop-title { margin-bottom: 0; }
.shop .shop-auth > p { margin: 0 2px; }
.shop .shop-auth > .shop-section { margin: 4px 0; }
.shop .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shop .head-actions .btn { flex: 1 1 auto; white-space: nowrap; min-height: 42px; padding: 0 16px; font-size: .9rem; }
.shop .alert { border-radius: 14px; margin-bottom: 10px; }

/* ---------- โปรโมชัน / คูปอง ---------- */
.shop .shop-was { color: var(--muted); font-size: .8rem; font-weight: 500; }
.shop .shop-promo-tag {
  display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-strong); font-size: .72rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.shop .shop-deal {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin: 2px 0; padding: 12px;
  border-radius: 16px; background: var(--brand-tint); border: 1px dashed rgba(var(--brand-rgb), .45);
}
.shop .shop-deal-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.shop .shop-deal-text a { color: var(--brand-strong); font-weight: 700; text-decoration: none; }
.shop .shop-coupon-form { display: flex; gap: 8px; }
.shop .shop-coupon-form input { flex: 1; min-width: 0; min-height: 46px; text-transform: uppercase; letter-spacing: .04em; }
.shop .shop-coupon-form input::placeholder { text-transform: none; letter-spacing: 0; }
.shop .shop-coupon-applied, .shop .shop-coupon-error { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shop .shop-coupon-applied form, .shop .shop-coupon-error form { margin: 0 0 0 auto; }
.shop .shop-coupon-chip {
  padding: 4px 12px; border-radius: 999px; border: 1px dashed var(--brand-strong);
  background: var(--brand-tint); color: var(--brand-strong); font-weight: 700; letter-spacing: .04em;
}
.shop .shop-discount-row .num { color: var(--ok); font-weight: 700; }
.shop .shop-promo-head { margin: 4px 0 0; }
.shop .shop-promo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); }
.shop .shop-promo-list li { display: flex; justify-content: space-between; gap: 12px; }
.shop .shop-coupon-alert { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }

/* ---------- จอเล็กมาก ---------- */
@media (max-width: 360px) {
  .shop .shop-logo { display: none; }
  .shop .shop-grid { gap: 8px; }
  .shop .shop-card-name { padding: 4px 8px 0; font-size: .85rem; }
  .shop .shop-card-price { padding: 0 8px; font-size: .98rem; }
  .shop .unit-pills { grid-template-columns: 1fr; }
  .shop .shop-act-total strong { font-size: 1.05rem; }
}

/* ---------- แท็บเล็ต ---------- */
@media (min-width: 600px) {
  .shop .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .shop .shop-slide { aspect-ratio: 16 / 7; }
  .shop .shop-slide-title { font-size: 1.6rem; }
  .shop .shop-slide-text { padding: 24px 28px 32px; max-width: 70%; }
  .shop .unit-pills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- จอใหญ่: เมนูบน ไม่มีแถบเมนูล่าง แถบปุ่มกลับเข้าไปในเนื้อหา ---------- */
@media (min-width: 761px) {
  .shop { --shop-bar-h: 66px; padding-bottom: 0; }
  .shop:has(.shop-actionbar) { padding-bottom: 0; }
  .shop .shop-bar {
    gap: 16px;
    padding-left: max(24px, calc((100% - 1120px) / 2 + 16px)); padding-right: max(24px, calc((100% - 1120px) / 2 + 16px));
  }
  .shop .shop-brand { font-size: 1.15rem; }
  .shop .shop-logo { width: 40px; height: 40px; border-radius: 12px; }
  .shop .shop-nav { display: flex; }
  .shop .shop-tabbar { display: none; }
  .shop .shop-main { padding: 18px 16px 40px; }
  .shop .shop-announce { max-width: 1088px; margin: 14px auto 0; width: calc(100% - 32px); }
  .shop .shop-searchbar { margin: -18px -16px 12px; padding: 14px 16px; }
  .shop:has(.shop-announce) .shop-searchbar { margin-top: -10px; }
  .shop .shop-cats, .shop .shop-promo-banner { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
  .shop .shop-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
  .shop .shop-slide { aspect-ratio: auto; height: clamp(260px, 30vw, 380px); }
  .shop .shop-title { font-size: 1.5rem; }

  .shop .shop-actionbar {
    position: static; z-index: auto; min-height: 0; padding: 0; margin-top: 4px;
    background: transparent; border: 0; box-shadow: none;
  }
  .shop .shop-summary + .shop-actionbar, .shop .checkout-form > .shop-actionbar {
    padding: 16px; background: var(--surface); border-radius: var(--shop-radius-panel); box-shadow: var(--shop-shadow);
  }
  .shop .shop-product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; }
  .shop .shop-buy { position: sticky; top: calc(var(--shop-top) + 16px); padding: 22px; }
  .shop .shop-buy h1 { font-size: 1.5rem; }
  .shop .shop-gallery-thumbs { display: flex; }
  .shop .shop-gallery .shop-dots { display: none; }
  .shop .shop-gallery-empty { aspect-ratio: 1; }
  .shop .shop-lines li { grid-template-columns: 88px minmax(0, 1fr); }
  .shop .checkout-form, .shop .shop-cart-page { max-width: 760px; }
}
@media (hover: none) {
  .shop .shop-card:hover { transform: none; box-shadow: var(--shop-shadow); }
  .shop .shop-card:hover .shop-card-img img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .shop .shop-slides, .shop .shop-gallery-track { scroll-behavior: auto; }
  .shop .shop-card, .shop .shop-card-img img, .shop .shop-dots button::before { transition: none; }
}

/* รอบ 24: หมวดสินค้าอยู่ในแถบค้นหาที่ติดด้านบน */
.shop .shop-searchbar .shop-cats { margin-top: 10px; margin-bottom: 0; }
