:root {
  --navy: #0b2e4f;
  --blue: #0e5aa7;
  --blue-600: #0b4f95;
  --teal: #10b981;
  --teal-600: #0d9e6e;
  --accent: #f59e0b;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #14243a;
  --muted: #6b7c93;
  --line: #e3e9f2;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(11, 46, 79, 0.08);
  --shadow-lg: 0 10px 34px rgba(11, 46, 79, 0.14);
  --grad: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, var(--teal) 130%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: transform .06s, box-shadow .2s, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-accent { background: var(--teal); color: #fff; }
.btn-accent:hover { background: var(--teal-600); }
.btn-ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* Header */
.site-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 10px; object-fit: contain; flex: none; background: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 20px; color: var(--navy); letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: 11.5px; }
.search { flex: 1; display: flex; max-width: 560px; }
.search input {
  flex: 1; border: 1.5px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px;
  padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none;
}
.search input:focus { border-color: var(--blue); }
.search button { border: 0; background: var(--blue); color: #fff; padding: 0 16px; border-radius: 0 10px 10px 0; cursor: pointer; font-size: 15px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.hdr-contact { font-weight: 600; color: var(--navy); font-size: 14px; white-space: nowrap; }
.cart-link { position: relative; font-size: 22px; }
.cart-count {
  position: absolute; top: -8px; right: -10px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: grid; place-items: center; padding: 0 4px;
}
.catnav { background: var(--navy); }
.catnav-inner { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px; }
.catnav a { color: #cfe0f2; padding: 11px 14px; font-size: 14px; white-space: nowrap; font-weight: 500; }
.catnav a:hover, .catnav a.active { color: #fff; box-shadow: inset 0 -3px 0 var(--teal); }

/* Hero */
.hero { padding: 18px 16px 0; max-width: 1180px; margin: 0 auto; }
.hero-banner {
  position: relative; display: block; border-radius: 18px; overflow: hidden; min-height: 300px;
  box-shadow: var(--shadow-lg);
}
.hero-banner img { width: 100%; height: 380px; object-fit: cover; }
.hero-default { background: var(--grad); }
.hero-caption { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 0 8%; color: #fff; }
.hero-banner.hero-default .hero-caption { position: static; min-height: 340px; }
.hero-caption h1 { font-size: clamp(26px, 4vw, 44px); margin: 0; text-shadow: 0 2px 14px rgba(0,0,0,.25); max-width: 640px; }
.hero-caption p { font-size: clamp(15px, 2vw, 19px); margin: 0; opacity: .95; max-width: 560px; }
.hero-caption .btn { align-self: flex-start; margin-top: 8px; }

/* Category chips */
.catchips { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 24px; padding-bottom: 4px; }
.chip { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--navy); box-shadow: var(--shadow); }
.chip:hover { border-color: var(--teal); color: var(--teal-600); }

/* Sections */
.section { padding: 34px 16px; }
.section-title { font-size: 24px; color: var(--navy); margin: 0 0 20px; position: relative; padding-left: 14px; }
.section-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: var(--grad); }

/* Product grid */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.pcard { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .12s, box-shadow .2s; display: flex; flex-direction: column; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pcard-link { display: flex; flex-direction: column; flex: 1; }
.pcard-img { position: relative; aspect-ratio: 1/1; background: #eef3f9; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-badge { position: absolute; top: 10px; left: 10px; background: rgba(16,185,129,.95); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.pcard-body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard-name { font-size: 14px; font-weight: 500; margin: 0; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pcard-price { font-size: 19px; font-weight: 800; color: var(--blue); margin-top: auto; }
.pcard-add { margin: 0 12px 12px; padding: 9px 10px; border: 1.5px solid var(--blue); background: #fff; color: var(--blue); border-radius: 9px; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s; }
.pcard-add:hover { background: var(--blue); color: #fff; }
.pcard-add.added { background: var(--teal); border-color: var(--teal); color: #fff; }
.pcard-add .ic { font-size: 15px; }

/* Product page */
.product-page { padding-top: 22px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--blue); }
.product-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: #eef3f9; aspect-ratio: 1/1; box-shadow: var(--shadow); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); cursor: pointer; }
.thumb.active { border-color: var(--blue); }
.product-title { font-size: 24px; color: var(--navy); margin: 0 0 14px; }
.product-price { font-size: 30px; font-weight: 800; color: var(--blue); margin-bottom: 22px; }
.variant-block { margin-bottom: 22px; }
.variant-label { display: block; font-weight: 600; margin-bottom: 10px; }
.variant-options { display: flex; flex-wrap: wrap; gap: 10px; }
.variant-btn { background: #fff; border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 16px; font-size: 14px; cursor: pointer; font-family: inherit; }
.variant-btn.active { border-color: var(--blue); background: #eef5fd; color: var(--blue); font-weight: 600; }
.variant-btn:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.qty-row { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.qty-control { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty-control button { width: 40px; height: 42px; border: 0; background: #f4f7fb; font-size: 20px; cursor: pointer; }
.qty-control input { width: 54px; height: 42px; border: 0; text-align: center; font-size: 16px; font-family: inherit; }
.stock-info { font-size: 13px; color: var(--muted); }
.buy-actions { display: flex; gap: 12px; }
.added-msg { color: var(--teal-600); font-weight: 600; margin-top: 12px; }
.product-section { margin-top: 40px; }
.product-section h2 { font-size: 19px; color: var(--navy); border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.product-desc { white-space: pre-wrap; font-family: inherit; font-size: 15px; color: #33475f; background: #fff; padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); }
.spec-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.spec-table th, .spec-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-table th { background: #f4f7fb; width: 40%; color: var(--navy); font-weight: 600; }

/* Cart */
.cart-item { display: flex; gap: 14px; background: #fff; padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; align-items: center; }
.cart-item img { width: 78px; height: 78px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; font-size: 15px; }
.cart-item-opt { font-size: 13px; color: var(--muted); }
.cart-item-price { color: var(--blue); font-weight: 700; }
.cart-qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.cart-qty button { width: 32px; height: 34px; border: 0; background: #f4f7fb; cursor: pointer; font-size: 16px; }
.cart-qty-input { width: 46px; height: 34px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-size: 15px; font-family: inherit; outline: none; -moz-appearance: textfield; }
.cart-qty-input:focus { background: #eef5fd; }
.cart-qty-input::-webkit-outer-spin-button, .cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-remove { background: none; border: 0; color: #c0392b; cursor: pointer; font-size: 13px; }
.cart-foot { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 8px; }
.cart-foot .total { font-size: 22px; font-weight: 800; color: var(--navy); }

/* Checkout */
.checkout-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.checkout-form { background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.checkout-form h2 { font-size: 17px; color: var(--navy); margin: 22px 0 14px; }
.checkout-form h2:first-child { margin-top: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; color: #33475f; }
.field input, .field textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 15px; font-family: inherit; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-method { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-size: 15px; }
.pay-method:has(input:checked) { border-color: var(--blue); background: #eef5fd; }
.discount-field { margin-top: 18px; }
.discount-row { display: flex; gap: 8px; }
.discount-row input { flex: 1; }
.discount-msg { display: block; margin-top: 6px; font-size: 13px; }
.discount-msg.ok { color: var(--teal-600); }
.discount-msg.err { color: #c0392b; }
.order-summary { background: #fff; padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 90px; }
.order-summary h2 { font-size: 17px; color: var(--navy); margin: 0 0 16px; }
#summary-items { margin-bottom: 12px; }
.sum-item { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; color: #33475f; gap: 8px; }
.summary-line { display: flex; justify-content: space-between; font-size: 14.5px; padding: 7px 0; border-top: 1px solid var(--line); }
.summary-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; color: var(--navy); padding: 12px 0; border-top: 2px solid var(--line); margin-top: 4px; }
.checkout-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; text-align: center; }

/* Pay page */
.pay-page { max-width: 620px; }
.pay-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.pay-head { background: var(--grad); color: #fff; padding: 26px; text-align: center; }
.pay-head h1 { margin: 0 0 6px; font-size: 24px; }
.order-no { opacity: .9; font-size: 14px; }
.pay-amount { font-size: 18px; margin-top: 8px; }
.pay-amount b { font-size: 26px; }
.pay-body { padding: 26px; }
.promptpay-box { text-align: center; border: 2px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.pp-header { font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.pp-qr { width: 260px; max-width: 80%; margin: 0 auto; }
.pp-qr svg { width: 100%; height: auto; }
.pp-amount { font-size: 24px; font-weight: 800; color: var(--blue); margin-top: 10px; }
.bank-box { border: 2px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.bank-box h3 { margin: 0 0 14px; color: var(--navy); }
.bank-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.acc-no { font-size: 18px; letter-spacing: 1px; color: var(--blue); }
.static-qr { width: 220px; margin: 14px auto 0; }
.slip-box { border: 2px dashed var(--blue); border-radius: 14px; padding: 20px; text-align: center; }
.slip-box h3 { margin: 0 0 12px; color: var(--navy); }
.slip-box input[type=file] { margin-bottom: 12px; }
.slip-hint { margin-top: 10px; }
.slip-done { color: var(--teal-600); font-weight: 700; margin-bottom: 12px; }
.cod-note { background: #eef5fd; border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 18px; }

/* Thank you */
.thankyou-page { max-width: 560px; }
.ty-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 40px 30px; text-align: center; }
.ty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 40px; display: grid; place-items: center; margin: 0 auto 18px; }
.ty-card h1 { color: var(--navy); margin: 0 0 8px; }
.ty-lead { color: var(--muted); margin: 0 0 18px; }
.ty-orderno { background: #f4f7fb; border-radius: 10px; padding: 12px; font-size: 15px; margin-bottom: 20px; }
.ty-items { text-align: left; margin-bottom: 14px; }
.ty-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ty-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; color: var(--navy); padding: 12px 0 18px; }
.ty-status { background: #eef5fd; border-radius: 10px; padding: 12px; color: var(--blue-600); font-weight: 600; margin-bottom: 18px; }
.ty-contact { font-size: 14px; color: var(--muted); margin: 20px 0; }
.ty-card .btn { margin: 4px; }

/* Footer */
.site-footer { background: var(--navy); color: #b8cbe0; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 40px 16px 26px; }
.footer-grid h4 { color: #fff; margin: 0 0 12px; font-size: 16px; }
.footer-grid p { margin: 5px 0; font-size: 14px; }
.footer-grid a:hover { color: var(--teal); }
.footer-logo { height: 54px; width: auto; background: #fff; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 16px; font-size: 13px; }

@media (max-width: 560px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pcard-body { padding: 10px 10px 8px; }
  .pcard-name { font-size: 13px; min-height: 2.7em; }
  .pcard-price { font-size: 16px; }
  .pcard-add { font-size: 12px; margin: 0 8px 8px; padding: 8px 6px; gap: 4px; }
  .pcard-add .ic { font-size: 13px; }
}
@media (max-width: 860px) {
  .product-grid { grid-template-columns: 1fr; gap: 22px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hdr-contact { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}
