:root{
  --brand-300:#93c5fd;
  --brand-500:#3b82f6;
  --ink:#0f172a;
  --muted:#64748b;
  --bg:#ffffff;
  --card-shadow:0 4px 16px rgba(0,0,0,.06);
}

*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:system-ui,Segoe UI,Arial,Helvetica,sans-serif}
.container{max-width:1200px;margin:0 auto;padding:0 16px}

/* Topbar */
.topbar{background:#fff;border-bottom:1px solid #e5e7eb}
.topbar__inner{display:flex;gap:16px;justify-content:flex-end;padding:8px 0}
.topbar__link{font-size:14px;color:#475569;text-decoration:none}
.topbar__link:hover{text-decoration:underline}

/* Header */
.header{display:flex;align-items:center;justify-content:space-between;padding:12px 0}
.logo__box{display:flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:8px;background:#e5e7eb;color:#111;font-weight:700}
.search{position:relative;width:520px;max-width:65vw}
.search__input{width:100%;padding:10px 40px 10px 14px;border:1px solid #e5e7eb;border-radius:999px;outline:none}
.search__input:focus{box-shadow:0 0 0 3px rgba(59,130,246,.2)}
.search__icon{position:absolute;right:12px;top:50%;transform:translateY(-50%);opacity:.5}

/* Banner */
.banner{background:var(--brand-300);color:#fff}
.banner__title{margin:0;padding:24px 0;font-size:28px;font-weight:700}

/* Sections */
.section{padding:24px 0}
.section__title{margin:0 0 12px}

/* Category Row */
.cat-row{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;}
.cat{background:#fff;border-radius:16px;box-shadow:var(--card-shadow);padding:16px;text-align:center;text-decoration:none;color:inherit}
.cat__img{width:64px;height:64px;margin:0 auto 8px;border-radius:999px;background:#f1f5f9}
.cat__name{font-size:14px}

/* Product Cards */
.card-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1.5px solid #b1d2fb; /* 💙 ฟ้าอ่อน (#bfdbfe = Tailwind blue-200) */
}

.card__img{width:100%;aspect-ratio:1/1;background:#ffffff;border-radius:8px}
.card__name{font-size:14px;line-height:1.35;height:38px;overflow:hidden}
.card__price{color:#1d4ed8;font-weight:700}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:999px;background:var(--brand-500);color:#fff;text-decoration:none;border:none;cursor:pointer}
.btn:hover{filter:brightness(.95)}

/* About + Footer */
.about{color:var(--muted)}
.footer{margin-top:40px;background:var(--brand-300);color:#fff}
.footer .container{padding:24px 0}

/* Floating Chat */
.float-chat{
  position:fixed;right:20px;bottom:20px;width:52px;height:52px;
  background:#22c55e;color:#fff;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 24px rgba(0,0,0,.2);text-decoration:none;font-weight:700
}

/* Responsive */
@media (max-width:1024px){
  .cat-row{grid-template-columns:repeat(3,1fr)}
  .card-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:640px){
  .search{display:none}
  .banner__title{font-size:22px;padding:32px 0}
  .cat-row{grid-template-columns:repeat(2,1fr)}
  .card-grid{grid-template-columns:1fr}
}

/* หมวดหมู่หน้า Home */
.cat-row{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px 24px;        /* row-gap / column-gap */
}

/* ให้การ์ดกินพื้นที่ทั้งคอลัมน์ ไม่ fix width */
.cat-row .cat{ width: 100%; display: block; }
@media (max-width: 900px){
  .cat-row{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px){
  .cat-row{ grid-template-columns: 1fr; }
}


/* ===== Category Page ===== */
.breadcrumb{background:#fff;border-bottom:1px solid #e5e7eb}
.breadcrumb .container{padding:10px 0;font-size:14px;color:#64748b}
.breadcrumb b{color:#0f172a}

.category-layout{display:grid;grid-template-columns:280px 1fr;gap:24px;padding:24px 0}
.filter-card{background:#fff;border-radius:16px;box-shadow:var(--card-shadow);padding:16px}
.select{width:100%;display:flex;align-items:center;justify-content:space-between;
  padding:10px 12px;border:1px solid #bfdbfe;border-radius:10px;background:#f8fbff;color:#0f172a}
.select + .select{margin-top:12px}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* การ์ดสินค้า */
.product-card {
  width: 200px; /* อยากเล็กลง/ใหญ่ขึ้น ปรับเลขนี้ได้ */
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 12px;
  position: relative;
}

/* กรอบรูปสินค้า – คุมความสูงด้วย height แทน padding-top */
.product-card .img {
  position: relative;
  width: 100%;
  height: 200px;        /* <<< ตัวนี้แหละที่คุม “ความสูงกรอบสีขาว” */
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
}

/* รูปด้านใน ให้ย่อ/ขยายอยู่ในกรอบ */
.product-card .img a.open-detail {
  position: absolute;
  inset: 0;
  background-size: contain;     /* ให้รูปไม่ล้นกรอบ */
  background-position: center;
  background-repeat: no-repeat;
}


.product-card .name{font-size:14px;min-height:40px}
.product-card .price{color:#1d4ed8;font-weight:700}
.cart-fab{position:absolute;right:12px;top:50%;transform:translateY(-50%);
  width:40px;height:40px;border-radius:999px;background:#93c5fd;display:flex;align-items:center;justify-content:center}

/* Responsive */
@media (max-width:1024px){
  .category-layout{grid-template-columns:1fr}
  .product-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:640px){
  .product-grid{grid-template-columns:1fr}
}

/* ===== Product Card (updated) ===== */
/* กรอบรูปเป็นจุดอ้างอิงตำแหน่งให้ปุ่ม */
.product-card .img{
  position: relative !important;
  aspect-ratio: 3/4;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;

  /* กันการจัดกึ่งกลางจากสไตล์อื่น */
  display: block !important;
  align-items: unset !important;
  justify-content: unset !important;
}

/* ปุ่มตะกร้า — ตรึงมุมขวาล่างของรูป */
.cart-fab{
  position: absolute !important;
  right: 10px !important;
  bottom: 10px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;

  width: 44px; height: 44px; border-radius: 999px;
  background: #3f88d0; border: 1.5px solid #ffffff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;

  /* เอฟเฟกต์แสงนุ่ม ๆ เมื่อ hover */
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: box-shadow .15s ease, filter .15s ease; /* ไม่มี transform */
}

.cart-fab:hover{
  box-shadow: 0 0 0 3px rgba(63,136,208,.18), 0 4px 10px rgba(0,0,0,.12);
  filter: brightness(1.03);
}

.cart-fab:active{ transform: none !important; }
.cart-fab svg{ width:20px; height:20px; stroke:#fff; }

/* กล่องการ์ด + เส้นขอบฟ้า */
.product-card{
  background:#fff;
  border:1px solid #93c5fd;
  border-radius:16px;
  box-shadow:0 4px 16px rgba(0,0,0,.04);
  padding:14px;
}


/* ชื่อ/ราคาเดิมตามสไตล์ */
.product-card .name{font-size:14px; min-height:40px}
.product-card .price{color:#1d4ed8; font-weight:700}

/* ===== Product Detail Page ===== */
.product-layout{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:32px;
  padding:32px 0;
  align-items:flex-start;
}

.product-img .img-box{
  background:#fff;
  border:1px solid #93c5fd;
  border-radius:12px;
  width:100%;
  aspect-ratio:1/1;
  display:flex;
  align-items:center;
  justify-content:center;
}

.product-img img{
  max-width:80%;
  max-height:80%;
}

.product-info h2{
  font-size:22px;
  color:#2563eb;
  margin:0 0 8px;
}

#product-code{
  margin-bottom:4px;
  color:#334155;
}

#product-price{
  color:#1d4ed8;
  font-weight:700;
  font-size:20px;
  margin-bottom:12px;
}

/* ตัวเลือกสินค้า */
.option-group{
  margin:12px 0;
}
.option-group .label{
  font-weight:600;
  color:#334155;
  margin-bottom:4px;
}
.option{
  display:inline-block;
  margin:4px;
  padding:6px 10px;
  border:1px solid #3b82f6;
  border-radius:8px;
  cursor:pointer;
  color:#2563eb;
  background:#fff;
}
.option.active{
  background:#3b82f6;
  color:#fff;
}

/* ปุ่มจำนวน + เพิ่มตะกร้า */
.quantity-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
}
.quantity-row input{
  width:64px;
  text-align:center;
  border:1px solid #cbd5e1;
  border-radius:6px;
  height:36px;
}
.quantity-row button{
  border:none;
  cursor:pointer;
  background:#fff;
  border:1px solid #3b82f6;
  border-radius:6px;
  width:36px;
  height:36px;
  font-size:20px;
  color:#3b82f6;
}
.btn-add{
  background:#3b82f6;
  color:#fff;
  border:none;
  border-radius:6px;
  padding:10px 20px;
  font-weight:600;
}
.btn-add:hover{
  background:#2563eb;
}

/* รายละเอียดสินค้า */
.bg-lightblue{background:#3b82f6;color:#fff;}
.desc-text{background:#fff;color:#0f172a;padding:16px;border-radius:12px;}
@media(max-width:768px){
  .product-layout{grid-template-columns:1fr;}
}

/* ให้กรอบรูปเป็นจุดอ้างอิงของตำแหน่ง */
.product-card .img{
  position: relative;
  aspect-ratio: 3/4;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* เลเยอร์ลิงก์คลุมพื้นที่รูปทั้งหมด */
.open-detail{
  position:absolute; inset:0;         /* top/right/bottom/left = 0 */
  display:block;
  border-radius:12px;
}

/* ปุ่มตะกร้าอยู่บนสุด ไม่โดนลิงก์บัง */
.cart-fab{ position:absolute; right:10px; bottom:10px; z-index:2; }

/* ลิงก์ชื่อสินค้าให้หน้าตาเหมือนข้อความธรรมดา */
.link-name{ color:inherit; text-decoration:none; display:block; }
.link-name:hover{ text-decoration:underline; }

/* ===== Layout ด้านบน (ซ้าย-ขวา) ===== */
.product-layout{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:32px;
  padding:32px 0;
  align-items:flex-start;
}
.product-img .img-box{
  background:#fff;
  border:1px solid #93c5fd;
  border-radius:12px;
  width:100%;
  aspect-ratio:1/1;
  display:flex; align-items:center; justify-content:center;
}
.product-img img{ max-width:80%; max-height:80%; }

/* ===== การ์ดข้อความด้านขวา (ให้เหมือนภาพที่สอง) ===== */
.product-info .info-card{
  background:#f3f8ff;            /* ฟ้าอ่อน */
  border:1px solid #bfdbfe;      /* เส้นขอบฟ้าอ่อน */
  border-radius:20px;            /* มุมมน */
  padding:24px 28px;
  box-shadow:0 2px 8px rgba(2, 62, 138, .05);
}

/* ชื่อสินค้า – ใหญ่ ชัด น้ำเงิน */
.prod-title{
  margin:0 0 8px;
  font-size:32px;                /* ปรับตามภาพดีไซน์ */
  line-height:1.25;
  font-weight:700;
  color:#2b6fda;
}

/* รหัสสินค้า */
.prod-meta{ color:#334155; margin-bottom:6px; }
.prod-meta .label{ color:#334155; margin-right:6px; font-weight:600; }

/* ราคา */
.prod-price{
  color:#0f172a;
  font-weight:700;
  font-size:24px;
  margin:10px 0 16px;
}

/* ตัวเลือก (ถ้ามี) */
.option-group{ margin:12px 0 6px; }
.option-group .label{ font-weight:600; color:#334155; margin-bottom:4px; display:block; }
.option{
  display:inline-block; margin:4px; padding:6px 10px;
  border:1px solid #3b82f6; border-radius:8px; cursor:pointer;
  color:#2563eb; background:#fff;
}
.option.active{ background:#3b82f6; color:#fff; }

/* แถวสั่งซื้อ: จำนวน + ปุ่ม */
.buy-row{ display:flex; align-items:center; gap:12px; margin-top:8px; }

/* กล่องจำนวน: รูปแบบเม็ดแคปซูล */
.qty-group{
  display:inline-flex; align-items:center;
  height:44px; background:#fff;
  border:1px solid #dbeafe; border-radius:10px; overflow:hidden;
}
.qty-group button{
  width:44px; height:44px; border:0; background:transparent;
  color:#2563eb; font-size:22px; cursor:pointer;
}
.qty-group input{
  width:68px; height:44px; border:0; outline:none; text-align:center; font-size:16px;
}

/* ปุ่มเพิ่มใส่ตะกร้า */
.btn-primary{
  background:#3b82f6; color:#fff; border:0; border-radius:10px;
  height:44px; padding:0 20px; font-weight:600; cursor:pointer;
}
.btn-primary:hover{ background:#2563eb; }

/* ส่วนรายละเอียดด้านล่าง */
.bg-lightblue{ background:#3b82f6; color:#fff; }
.desc-text{ background:#fff; color:#0f172a; padding:16px; border-radius:12px; }

@media (max-width: 1024px){
  .product-layout{ grid-template-columns:1fr; }
}

/* ===== Header Cart ===== */
.header-cart{
  margin-left:12px; padding:8px 12px; border:1px solid #dbeafe;
  background:#fff; border-radius:10px; cursor:pointer;
}
.badge{
  background:#ef4444; color:#fff; border-radius:999px;
  padding:2px 8px; font-size:12px; margin-left:6px;
}

/* ===== Cart Drawer ===== */
.overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.35);
  opacity:0; pointer-events:none; transition:.2s;
  z-index:50;
}
.overlay.show{ opacity:1; pointer-events:auto; }

.cart-drawer{
  position:fixed; top:0; right:0; height:100vh; width:min(420px,100%);
  background:#fff; box-shadow:-8px 0 24px rgba(0,0,0,.15);
  transform:translateX(100%); transition:.25s; z-index:60; display:flex; flex-direction:column;
}
.cart-drawer.show{ transform:none; }

.cart-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px; border-bottom:1px solid #e5e7eb; background:#f8fafc;
}
.icon-btn{ border:0; background:transparent; cursor:pointer; font-size:20px; }

.cart-items{ padding:12px 16px; overflow:auto; flex:1; }

.cart-thumb{ width:64px; height:64px; background:#f1f5f9; border:1px solid #e5e7eb; border-radius:8px; }

.item-name{ font-weight:600; color:#0f172a; }
.item-option{ color:#64748b; font-size:12px; }
.item-price{ color:#1d4ed8; font-weight:700; margin-top:2px; }

.qty-ctrl{ display:inline-flex; border:1px solid #dbeafe; border-radius:8px; overflow:hidden; }
.qty-ctrl button{ width:32px; height:32px; border:0; background:#fff; color:#2563eb; font-size:18px; cursor:pointer; }
.qty-ctrl input{ width:50px; height:32px; border:0; text-align:center; }

.del-btn{ border:0; background:transparent; color:#ef4444; cursor:pointer; }

.cart-footer{ padding:16px; border-top:1px solid #e5e7eb; background:#fff; }
.cart-total{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.w-full{ width:100%; }



/* =========================
   THEME TOKENS (ถ้ายังไม่มี)
   ========================= */
:root{
  --brand:#3f88d0;
  --brand-600:#2f77c5;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e6edf7;
  --card:#f6f9ff;
  --success:#16a34a;
  --danger:#e11d48;
}

/* ปุ่มหลักให้สอดคล้องทั้งเว็บ */
.btn-primary{
  display:inline-flex; align-items:center; justify-content:center;
  height:52px; padding:0 22px; border:none; border-radius:14px;
  background:var(--brand); color:#fff; font-weight:800; font-size:18px;
  box-shadow:0 8px 20px rgba(63,136,208,.25); cursor:pointer;
}
.btn-primary:hover{ background:var(--brand-600); }

/* ปุ่มรอง (เส้นกรอบ) */
.btn-outline{
  display:inline-flex; align-items:center; justify-content:center;
  height:46px; padding:0 18px; border-radius:12px;
  border:1.5px solid var(--brand); color:var(--brand); background:#fff;
  font-weight:700;
}

/* อินพุตพื้นฐาน (เผื่อไม่ได้สไตล์) */
.input, .textarea, .select, input[type=text], textarea, select{
  width:100%; border:1px solid var(--line); border-radius:12px;
  background:#fff; padding:14px 12px; font-size:16px; outline:none;
}
.textarea, textarea{ min-height:120px; resize:vertical; }

/* =========================
   STEP INDICATOR (1-2-3)
   ========================= */
.steps{
  display:flex; gap:24px; align-items:center; margin:8px 0 20px;
}
.step{ display:flex; align-items:center; gap:10px; color:var(--muted); font-weight:700; }
.step__badge{
  width:32px; height:32px; border-radius:999px; display:grid; place-items:center;
  background:#e7f1ff; color:var(--brand); font-weight:800;
}
.step--active{ color:var(--ink); }
.step--active .step__badge{ background:var(--brand); color:#fff; }

/* =========================
   CHECKOUT – LAYOUT
   ========================= */
.checkout-grid{
  display:grid; grid-template-columns: 1fr 520px; gap:28px; margin-top:8px;
}
.form-card label{ display:block; font-weight:800; color:var(--ink); margin:16px 0 8px; font-size:18px; }
.form-card .help{ color:var(--muted); font-size:13px; margin-top:4px; }

/* การ์ดสรุปขวา */
.summary-card{
  background:#fff; border:1px solid var(--line); border-radius:18px; overflow:hidden;
}
.summary-card__head{ padding:18px 20px; background:var(--card); }
.summary-title{ font-size:28px; font-weight:900; color:var(--ink); }

.summary-items{ background:#fff; border-top:1px solid var(--line); }
.order-item{
  display:grid; grid-template-columns: 96px 1fr auto; gap:16px;
  align-items:center; padding:16px 20px; border-bottom:1px solid var(--line);
}
.order-item:last-child{ border-bottom:none; }

.order-item .thumb{
  width:96px; height:96px; border:1.5px solid #9ec3ff; border-radius:12px;
  background:#fff; display:grid; place-items:center; color:#9aa9c8;
}
.order-item .info .name{ color:#1e3a8a; font-weight:800; font-size:18px; line-height:1.2; }
.order-item .info .opt{ color:var(--muted); margin-top:4px; font-size:14px; }
.order-item .info .qty{ margin-top:6px; color:#0b5394; font-weight:700; }

.order-item .price{ color:#0b5394; font-weight:800; font-size:18px; }

/* กล่องรวมราคา + ปุ่มไปชำระเงิน */
.summary-footer{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px; background:#fff; border-top:1px solid var(--line);
}
.total-box{
  display:grid; gap:6px; color:var(--ink); font-weight:700; font-size:16px;
}
.total-row{ display:flex; justify-content:space-between; gap:14px; }
.total-row .label{ color:var(--muted); }
.total-row .val{ color:#0b5394; font-weight:900; }
.total-row.grand .label{ color:#0b5394; }
.total-row.grand .val{ color:#0b5394; font-size:20px; }

/* =========================
   PAYMENT (Step 2)
   ========================= */
.pay-wrap{ display:grid; grid-template-columns: 1fr; gap:22px; }
.pay-box{
  border:1px solid var(--line); border-radius:18px; background:#fff; padding:22px;
}
.pay-title{ font-size:24px; font-weight:900; color:var(--ink); margin-bottom:10px; }

.qr-area{
  border:2px dashed #b7cdf7; border-radius:16px; height:320px;
  display:grid; place-items:center; background:#fafcff; color:#7a90c4; font-weight:700;
}
.pay-meta{ display:flex; justify-content:space-between; margin-top:14px; color:var(--muted); }

/* ปุ่มย้อน/ถัดไป (ถ้ามี) */
.pay-actions{ display:flex; gap:12px; justify-content:flex-end; margin-top:16px; }

/* =========================
   SUCCESS (Step 3)
   ========================= */
.success-wrap{ display:grid; place-items:center; padding:28px 0; }
.success-card{
  max-width:720px; width:100%; background:#fff; border:1px solid var(--line);
  border-radius:20px; padding:32px; text-align:center;
}
.success-icon{
  width:84px; height:84px; border-radius:999px; margin:0 auto 16px;
  background:rgba(22,163,74,.1); color:var(--success); display:grid; place-items:center;
  font-size:42px; font-weight:900;
}
.success-title{ font-size:32px; font-weight:900; color:var(--success); }
.order-code{ margin-top:8px; font-weight:800; color:#0b5394; }

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1024px){
  .checkout-grid{ grid-template-columns: 1fr; }
  .summary-footer{ flex-direction:column; align-items:flex-start; gap:14px; }
  .btn-primary{ width:100%; height:56px; font-size:20px; }
}

/* ---------- Stepper (Checkout / Payment / Success) ---------- */
.stepper{
  display:flex;
  justify-content:center;    /* << จัดกลางแนวนอน */
  align-items:center;
  gap:40px;                  /* ระยะห่างระหว่างขั้น */
  margin:24px auto 12px;
  max-width:980px;           /* กำหนดขอบเขตให้ดูเป็นแถวกลาง */
}

.step{
  display:flex;
  align-items:center;
  gap:12px;
  color:#64748b;             /* สีตัวอักษรปกติ */
  font-weight:600;
  font-size:1.05rem;
  white-space:nowrap;        /* กันตัดบรรทัด */
}

/* วงกลมเลขลำดับ */
.step::before{
  content: attr(data-step);  /* รับค่าเลขจาก data-step ใน HTML */
  width:34px;
  height:34px;
  border-radius:999px;
  background:#e8effa;
  display:grid;
  place-items:center;
  color:#3b82f6;
  font-weight:700;
  box-shadow:0 1px 0 rgba(0,0,0,.04) inset;
}

/* สถานะ current step */
.step.active{
  color:#0f172a;
}
.step.active::before{
  background:#3b82f6;
  color:#fff;
}

/* (ถ้าต้องการไฮไลต์เวลาชี้) */
.step:hover{ color:#0f172a; }
.step:hover::before{ box-shadow:0 0 0 3px rgba(59,130,246,.15); }

/* ---------- Success Page ---------- */
.success-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 70vh;
  gap: 16px;
  padding: 40px 16px;
}

.success-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #ecfdf5; /* สีพื้นอ่อน */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16a34a; /* สีเขียวหลัก */
  font-size: 58px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}


.success-title {
  color: #16a34a;
  font-size: 1.8rem;
  font-weight: 700;
}

.success-text {
  color: #1e293b;
  font-size: 1rem;
  margin-bottom: 20px;
}

.success-btn {
  font-size: 1.05rem;
  padding: 12px 28px;
  border-radius: 8px;
  background-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 8px rgba(37,99,235,0.25);
  transition: 0.2s;
}

.success-btn:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(37,99,235,0.3);
}

/* ===== Header icons (ตะกร้า + สถานะ) ===== */
.header-icons { display:flex; align-items:center; gap:16px; }
.header-icon {
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border:1px solid #e5e7eb; border-radius:12px;
  background:#fff; color:#0f172a; text-decoration:none;
}
.header-icon .badge {
  min-width:20px; height:20px; padding:0 6px;
  display:inline-flex; align-items:center; justify-content:center;
  background:#ef4444; color:#fff; border-radius:999px; font-size:12px; font-weight:700;
}
.icon-transport { font-size:18px; }

/* ===== Orders page ===== */
.order-container { margin-top:20px; }
.order-title-bar {
  background:#4ea0ea; color:#fff; padding:16px 20px;
  border-radius:12px; font-size:28px; font-weight:700;
}
.order-list { display:flex; flex-direction:column; gap:20px; margin-top:16px; }

.order-card {
  border:1px solid #cbd5e1; border-radius:12px; background:#fff;
  padding:16px; box-shadow:0 2px 6px rgba(15,23,42,.05);
}
.order-card__grid {
  display:grid; grid-template-columns:1fr 1fr; gap:10px;
}
.order-section-title {
  font-size:22px; color:#0f172a; font-weight:600;
  border-bottom:2px solid #0f172a;padding-bottom:10px; margin:1px 0 1px;
}
.order-items { display:flex; flex-direction:column; gap:14px; }
.order-item {
  display:grid; grid-template-columns:100px 1fr 120px; gap:16px;
  align-items:center; padding:8px 0; border-bottom:1px dashed #e2e8f0;
}
.order-thumb { width:100px; height:90px; background:transparent; border:1px solid #e2e8f0; border-radius:8px; }
.order-name { font-size:20px; color:#2563eb; font-weight:700; }
.order-option { color:#64748b; margin-top:4px; font-size:14px; }
.order-price { color:#0f172a; font-weight:600; text-align:right; }

.order-address { white-space:pre-line; line-height:1.7; font-size:20px; }

.order-total {
  display:flex; justify-content:space-between; align-items:center;
  font-size:28px; color:#0f172a; font-weight:800; margin-top:12px;
}

.order-status-row {
  margin-top:12px; display:flex; justify-content:flex-end; align-items:center; gap:12px;
}
.status-pill {
  padding:10px 16px; border-radius:999px; font-weight:800; font-size:28px;
}
.status--pending   { background:#fee2e2; color:#b91c1c; }
.status--packed    { background:#fef3c7; color:#a16207; }
.status--shipped   { background:#dcfce7; color:#166534; }
.status--delivered { background:#e0e7ff; color:#1e3a8a; }

.btn-tracking {
  padding:10px 16px; border-radius:10px; background:#dbeafe; color:#1e3a8a;
  font-weight:700; border:0; cursor:pointer;
}

/* ปุ่มหลักใช้ร่วม */
.btn-primary {
  display:inline-flex; align-items:center; justify-content:center;
  padding:12px 20px; border-radius:14px; background:#155bd5; color:#fff; font-weight:700;
  border:none; cursor:pointer; text-decoration:none;
}
.btn-primary:hover { filter:brightness(.95); }

/* ลิสต์ตัวหนังสือ/ตัวเลขให้ใหญ่ตามภาพ */
.order-card .order-name { font-size:28px; }
.order-card .order-option { font-size:22px; }
.order-card .order-price { font-size:28px; }

/* ===== Orders page (ปรับใหม่) ===== */
.order-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px 20px;
  margin:18px 0;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}

.order-head{ margin-bottom:10px; }
.order-title{ font-size:20px; font-weight:700; color:#0f172a; }
.order-id{ font-size:14px; color:#64748b; margin-top:4px; }

.order-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:30px;
  margin-top:12px;
  border-top:1px solid #e5e7eb;
  padding-top:12px;
}

.order-items .item{
  display:flex; gap:14px; padding:12px 0; border-bottom:1px dashed #e5e7eb;
}
.order-items .thumb{
  width:92px; height:92px; background:#eef2ff; border-radius:10px; flex:0 0 92px;
}
.order-items .name{
  font-size:18px; line-height:1.35; color:#1d4ed8; font-weight:600;
}
.order-items .price{ font-size:18px; font-weight:700; color:#0f172a; margin-left:auto; }

.order-total{
  display:flex; justify-content:flex-end; gap:10px; padding-top:12px;
  font-size:20px; font-weight:800; color:#0f172a;
}

.ship-title{ font-size:20px; font-weight:800; color:#0f172a; margin-bottom:10px; }
.ship-name{ font-size:16px; color:#0f172a; margin-bottom:6px; }
.ship-addr{ font-size:16px; color:#0f172a; }

.order-footer{
  display:flex; align-items:center; justify-content:space-between;
  border-top:1px solid #e5e7eb; padding-top:12px; margin-top:14px;
}

/* ป้ายสถานะ (ย้ายมาล่างซ้าย + เล็กลง) */
.status-badge{
  font-size:14px; font-weight:700; border-radius:999px; padding:6px 12px;
  display:inline-flex; align-items:center; gap:8px;
}
.status-pending{ background:#fee2e2; color:#991b1b; }     /* บริษัทยังไม่จัดส่ง */
.status-shipping{ background:#dbeafe; color:#1d4ed8; }    /* จัดส่งแล้ว */
.status-delivered{ background:#dcfce7; color:#166534; }   /* จัดส่งสำเร็จ */

/* หมายเลขพัสดุ (ถ้ามี) อยู่ขวาล่าง */
.track-no{ font-size:14px; color:#334155; background:#f1f5f9; padding:6px 10px; border-radius:8px; }

/* ส่วนจัดเลย์เอาต์ของสินค้ากับที่อยู่ */
.order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* แบ่งครึ่งซ้าย-ขวา */
  gap: 24px;
  align-items: start; /* ค่าปกติ */
}

/* ✅ เพิ่มบรรทัดนี้เพื่อให้หัวข้อสองฝั่งอยู่ระดับเดียวกัน */
.order-grid > section {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* จัดให้อยู่บนสุดเท่ากัน */
}

/* ปรับ margin ด้านบนของหัวข้อให้เท่ากันเป๊ะ */
.order-section-title,
.ship-title {
  margin-top: 0;
  padding-top: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}


/* ---------- Auth Section ---------- */
.auth-card {
  max-width: 520px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.auth-tabs .tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.auth-tabs .tab.active {
  background: #eaf1ff;
  border-color: #c7dbff;
  color: #1d4ed8;
}
.auth-form { display: none; }
.auth-form.show { display: block; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.form-group label {
  color: #334155;
  font-weight: 600;
}
.form-group input {
  height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
}
.form-group input:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.btn-primary {
  display: inline-block;
  background: #165ef0;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}
.w-full { width: 100%; }

.auth-msg {
  margin-top: 10px;
  font-size: 14px;
  color: #64748b;
}
.auth-msg.ok { color: #16a34a; }
.auth-msg.err { color: #dc2626; }

/* topbar auth inline */
.auth-inline { display: flex; gap: 14px; align-items: center; }
.link-btn { background: none; border: none; color: #2563eb; cursor: pointer; padding: 0; }
.hello { color: #0f172a; }

.btn-disabled { opacity: .55; cursor: not-allowed; }


/* ปุ่มหลักทั้งหมด */
.btn-primary {
  display: inline-flex;           /* ใช้ flex แทน inline-block */
  align-items: center;            /* จัดแนวตั้งให้อยู่กลาง */
  justify-content: center;        /* จัดแนวนอนให้อยู่กลาง */
  text-align: center;
  background-color: #2563eb;      /* สีหลักของปุ่ม (blue) */
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;             /* ปรับ padding ให้พอดี */
  line-height: 1;                 /* ป้องกันข้อความล้น */
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;          /* ลบขีดเส้นใต้กรณีเป็น <a> */
}

.btn-primary:hover {
  background-color: #1e4ed8;
}

/* ปุ่มที่อยู่ใน container เต็มความกว้าง เช่นใน Drawer หรือ success page */
.btn-primary.w-full {
  width: 100%;
}

/* ข้อความเตือนใน checkout */
.form-error {
  margin-top: 10px;
  color: #ef4444;         /* แดง */
  font-size: 14px;
}

/* ไฮไลท์ฟิลด์ที่ผิดพลาด */
.input--invalid,
.input--invalid:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}

/* ปรับสีลิงก์สินค้าให้เป็นสีดำตลอด */
.card__name a,
.card__name {
  color: #000;               /* สีดำปกติ */
  text-decoration: none;     /* เอาเส้นใต้ลิงก์ออก */
}

.card__name a:visited {
  color: #000;               /* สีดำแม้จะเคยคลิกแล้ว */
}

.card__name a:hover {
  color: #1d4ed8;            /* (ทางเลือก) สีตอน hover เป็นฟ้า */
}


.card__name, .card__name:visited { color:#000; text-decoration:none; }

/* ---- Admin link colors ---- */
.admin-link,
.admin-link:link,
.admin-link:visited {
  color: var(--fg);                /* ให้เป็นสีตัวอักษรหลัก (ดำ/เทาเข้ม) */
  text-decoration: none;           /* ตัดเส้นใต้ */
}

.admin-link:hover {
  color: var(--primary);           /* เปลี่ยนเป็นฟ้าตอน hover */
  text-decoration: none;
}

.admin-link.is-active {
  color: var(--primary-600);       /* สีฟ้าเข้มตอนอยู่หน้านั้น */
  font-weight: 700;
}

/* รูปสินค้าในหน้า product */
.product-img .img-box{
  border-radius:16px;
  border:1px solid #c4ddff;
  padding:24px;
  background:#fff;
}

.product-img .img-box img {
  width: auto;
  height: auto;
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.thumb-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

/* Breadcrumb ใหม่ */
.breadcrumb {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.breadcrumb__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
  color: #4b5563;
}

.breadcrumb-text b {
  font-weight: 600;
}

/* ปุ่มย้อนกลับสไตล์ pill */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #dbeafe;
  color: #2563eb;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.back-link__icon {
  font-size: 16px;
  line-height: 1;
}

.back-link:hover {
  background: #e0ecff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

/* พื้นหลังโซนรายละเอียดให้เบาลง */
.section.bg-lightblue {
  background: #f3f4ff;
  padding: 32px 0 40px;
}


/* กล่องรายละเอียดสินค้า */
.product-desc-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  width: 100%;         /* กว้างเต็ม */
  box-shadow: var(--card-shadow);
  margin-top: 16px;
}

/* พื้นหลังโซนรายละเอียด เอาสีออก + ให้ชิด footer */
.product-layout + .section.bg-lightblue {
  background: none;
  padding: 16px 0 0;
}

/* กล่องรายละเอียดสินค้า ชิดซ้าย กว้างเท่ากับ container */
.product-desc-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  width: 100%;
  box-shadow: var(--card-shadow);
}

/* หัวข้อกับตัวหนังสือด้านในกล่อง */
.product-desc-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 10px;
}

.product-desc-text {
  font-size: 14px;
  line-height: 1.8;
  color: #4b5563;
  white-space: pre-line;
}

/* cart drawer styles */
.cart-item {
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px 8px;
  border-bottom:1px solid #f1f5f9;
}
.cart-thumb {
  width:56px;
  height:56px;
  border-radius:8px;
  overflow:hidden;
  flex:0 0 56px;
  background:#f8fafc;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cart-thumb img {
  width:100%;
  height:100%;
  object-fit:cover; /* หรือ 'contain' ถ้าอยากเห็นทั้งรูป */
  display:block;
}
.cart-main { flex:1; }
/* ===== cart qty control (replace existing) ===== */
/* === cart drawer: compact qty control (replace previous rules) === */
.cart-actions {
  display:flex;
  align-items:center;
  gap:12px; /* ระยะระหว่างกลุ่มปุ่มกับปุ่มลบ */
}

/* container ของปุ่ม - input เป็นกล่องเดียวกัน */
.qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e6eefc; /* ขอบบางรอบกลุ่ม */
  padding: 2px;              /* เว้นขอบเล็กน้อย */
  box-shadow: 0 1px 2px rgba(13,38,76,0.03);
}

/* ปุ่ม + / - แบบเรียบ ไม่มีขอบหนา */
.qty-ctrl button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: none;               /* เอาขอบปุ่มออก */
  background: transparent;    /* เป็นพื้นใส ให้กล่องเป็นตัวเน้น */
  color: #1e40af;             /* สีน้ำเงิน */
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, transform 0.06s ease;
}

/* hover / active effect เล็กๆ */
.qty-ctrl button:hover { background: rgba(59,130,246,0.06); }
.qty-ctrl button:active { transform: translateY(1px); }

/* ช่องเลขตรงกลาง ให้เล็กและเรียบ (ไม่มี border รอบ ๆ เพื่อให้กล่องเดียวกันดูเรียบร้อย) */
.qty-ctrl input.qty {
  width: 48px;             /* แคบลง */
  height: 34px;
  text-align: center;
  padding: 0;
  border: none;            /* ปิดขอบภายใน (กล่องรอบนอกเป็นขอบ) */
  outline: none;
  font-size: 15px;
  color: #0f172a;
  background: transparent;
}

/* ปุ่มลบรายการ (✕) ให้เล็กลง ไม่ดึงความสนใจ */
.del-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  line-height: 1;
}

/* responsive: ปรับเมื่อจอเล็ก */
@media (max-width: 420px) {
  .qty-ctrl button { width: 30px; height: 30px; font-size: 16px; }
  .qty-ctrl input.qty { width: 44px; height: 30px; font-size: 14px; }
}
.pay-grid { display:grid; grid-template-columns: 1fr 360px; gap:24px; align-items:start; margin-top:18px; }
.pay-box { background:#fff; border-radius:12px; padding:20px; box-shadow:0 4px 14px rgba(13,38,76,0.03); }
.qr-box { height:140px; background:#f8fafc; border-radius:8px; display:flex; align-items:center; justify-content:center; color:#6b7280; font-weight:600; }

.pay-summary { background:#fff; border-radius:12px; padding:18px; box-shadow:0 4px 14px rgba(13,38,76,0.03); }
.order-item { display:flex; gap:12px; align-items:center; padding:12px 0; border-bottom:1px dashed #eef2ff; }
.order-thumb {
  width:56px;
  height:56px;
  background-color:#f8fafc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.order-name { font-weight:700; color:#0f172a; }
.order-price { margin-left:auto; font-weight:700; color:#0f172a; }
.order-total { margin-top:12px; font-weight:600; text-align:right; }




.pay-summary {
  background: #fff;
  padding: 20px 24px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(20,40,80,0.06);
  width: 100%;
}

.pay-summary h3,
.summary-title {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef3f8;
  font-size: 18px;
  font-weight: 700;
}

/* item row */
.summary-items .order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.summary-items .order-thumb {
  width: 58px;
  height: 58px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  background-color: #f3f4f6;
}

.summary-items .order-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.summary-items .order-option {
  font-size: 13px;
  color: #95a2b3;
}

/* ----------------------------- */
/* TOTAL BOX (RIGHT COLUMN) FIX */
/* ----------------------------- */
.order-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eef3f8;
}

.order-total div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 15px;
}

.order-total .grand {
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* ===== Checkout / Pay-summary harmonize ===== */
.checkout-grid.container {
  /* center main grid like payment page */
  max-width: 1180px;
  margin: 28px auto;
  padding-left: 0;
  padding-right: 0;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
  margin-top: 28px;
}

/* left form card styling (same visual as payment left box) */
.form-card {
  background: #fff;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(20,40,80,0.04);
}

/* pay-summary card (right) */
.pay-summary {
  background: #fff;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(20,40,80,0.06);
}

/* title/head */
.pay-summary h3 {
  margin: 0 0 8px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f6fb;
  font-size: 18px;
}

/* list of items inside summary (make items look like payment) */
.pay-summary__items,
#orderItems.pay-summary__items {
  padding: 8px 0 0 0;
}

/* each order item (thumbnail + meta + price) */
.pay-summary__items .order-item,
#orderItems .order-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid #f3f6fb;
}

/* thumbnail box */
.pay-summary__items .order-thumb,
#orderItems .order-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background-color: #f3f4f6;
  background-size: cover;
  background-position: center;
  flex: 0 0 56px;
}

/* name area */
.pay-summary__items .order-name,
#orderItems .order-name {
  font-weight: 700;
  color: #0f172a;
}

/* small option / qty text */
.pay-summary__items .order-option,
#orderItems .order-option {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 4px;
}

/* price on right */
.pay-summary__items .order-price,
#orderItems .order-price {
  margin-left: auto;
  font-weight: 700;
  color: #0f172a;
}

/* order total rows - use flex so label/value won't smash together */
.order-total {
  margin-top: 16px;
  padding-top: 6px;
}
.order-total .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  color: #334155;
}
.order-total .row .label { flex: 1; }
.order-total .row .val { flex: 0; font-weight: 700; color: #0f172a; }
.order-total .row.grand { font-weight: 800; font-size: 18px; }

/* prevent text wrapping inside each label/value pair (avoid broken layouts) */
.order-total .row .label,
.order-total .row .val {
  white-space: nowrap;
}

/* responsive: single column under 920px */
@media (max-width: 920px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .pay-summary { margin-top: 16px; }
  .pay-summary__items .order-item { padding-left: 0; padding-right: 0; }
}

/* small helper for left form two columns */
.two-cols { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:8px; }

/* ensure the form-card inputs have same visual padding as payment page */
.form-card .input, .form-card .textarea, .form-card .select {
  background: #fbfdff;
  border: 1px solid #eef3f9;
  padding: 12px 14px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* fix any unexpected global rule that forces letter-spacing/transform for currency chars */
.pay-summary, .form-card {
  letter-spacing: normal;
  word-break: normal;
}

/* ===== FIX SUMMARY PRICE ALIGNMENT ===== */

/* ทำให้ 3 ค่า (ค่าสินค้า / ค่าจัดส่ง / รวมทั้งหมด) อยู่คนละบรรทัด */
.price-summary {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: #374151;
}

.price-row.total {
  font-weight: 700;
  font-size: 18px;
  color: #0f172a;
}

/* ปรับ order summary box ให้เหมือน payment */
.pay-summary,
.summary-card {
  background: #fff;
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(20,40,80,0.06);
}

/* ปรับหัวข้อ */
.pay-summary h3,
.summary-card h3 {
  font-size: 20px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f2f6fb;
}


/* ===== Variant box style ===== */
.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.variant-box {
  position: relative;
  cursor: pointer;
}

/* ซ่อน radio จริง */
.variant-box input[type="radio"] {
  display: none;
}

/* กล่องตัวเลือก */
.variant-label {
  display: inline-block;
  padding: 8px 14px;
  border: 1.5px solid #cfd9ff;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 14px;
  transition: all 0.2s ease;
  user-select: none;
}

/* hover */
.variant-box:hover .variant-label {
  border-color: #4f6df5;
}

/* ตอนเลือกแล้ว */
.variant-box input[type="radio"]:checked + .variant-label {
  background: #4f6df5;
  color: #fff;
  border-color: #4f6df5;
  box-shadow: 0 4px 10px rgba(79, 109, 245, 0.25);
}




/*เพิ่มเติม QR code*/
/* ===== PROMPTPAY QR CARD ===== */
.qr-card {
  margin: 20px 0;
  padding: 24px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.qr-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
}

.qr-header img {
  height: 28px;
}

#qrContainer img {
  width: 240px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

.card__img{
  width:100%;
  aspect-ratio: 1 / 1;          
  border-radius:12px;

  background-size: cover !important;   
  background-position: center;
  background-repeat: no-repeat;

  background-color:#f8fafc;
}

.price-inbox {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1d4ed8;
}

.btn-line {
  display: block;
  text-align: center;
  background: #06c755;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  background: #fff;
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 1001;
}

.cart-drawer.show {
  transform: translateX(0);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 1000;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}


/* FIX: product info card spacing */
.product-info .info-card {
  padding: 22px 24px;
  border-radius: 18px;
}

/* แถวปุ่มสั่งซื้อ */
.buy-row{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ปุ่ม LINE (สินค้าราคาสอบถาม) */
.buy-row .btn-line{
  order: -1;          /* ดันปุ่ม LINE ไปซ้ายสุด */
}

.buy-row {
  justify-content: flex-start;
}

.btn-line {
  display: inline-flex;        /* ใช้ flex */
  align-items: center;         /* กลางแนวตั้ง */
  justify-content: flex-start; /* ชิดซ้าย */
  white-space: nowrap;         /* ❗ ห้ามตัดบรรทัด */
  text-align: left;

  padding: 12px 20px;
  gap: 6px;
}

.btn-line br {
  display: none !important;
}

/* ===== DESKTOP HEADER LOCK ===== */
@media (min-width: 769px) {
  header.header.container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 !important;
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* =========================
   DESKTOP SAFETY RESET
   ========================= */

/* ซ่อน mobile category strip บน desktop */
.mobile-only {
  display: none !important;
}

/* ป้องกัน category-strip หลุด layout บน desktop */
.category-strip {
  display: none !important;
}

/* desktop ใช้ cat-row แบบเดิมเท่านั้น */
.cat-row {
  display: grid;
}

/* ===== HOME CATEGORY (DESKTOP FINAL FIX) ===== */
@media (min-width: 769px) {
  .category-grid-desktop {
    display: block !important;
    margin-bottom: 32px;
  }

  .category-grid-desktop .cat-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 24px;
  }

  .category-grid-desktop .cat {
    width: 100%;
  }
}

/* ===== HOME DESKTOP ===== */
.home-grid{
  max-width:1280px;
  margin:24px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:24px;
}

.sidecats{ display:block; }

.category-grid-desktop{
  display:block;
  margin-bottom:32px;
}

.cat-row{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px 24px;
}

.home-grid{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:24px;
  align-items:start;   /* ⭐ ตัวนี้ */
}

.sidecats{
  align-self:start;
  margin-top:0 !important;
}

.home-grid{
  max-width:1280px;
  margin:24px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:24px;
  align-items:start;
}

.sidecats{
  align-self:start;
}

.category-grid-desktop{
  margin-bottom:32px;
}

.cat-row{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px 24px;
}

.home-grid {
  align-items: start;
}

.sidecats {
  position: sticky;
  top: 24px;
}

.order-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background-color: #f3f4f6;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 60px;
}

.order-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:8px;
  display:block;
}



