/*!
 * Good Life Pharma — Full CSS (Minimal & Clean: White + Yellow)
 * Single-file stylesheet
 */

/* =============== Reset + Vars =============== */
*,
*::before,
*::after {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1d1d1f;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale
}

:root {
  --brand: #f8d94e;
  --brand-2: #ffe77a;
  --ink: #1d1d1f;
  --muted: #666;
  --bg: #fff;
  --card: #fff;
  --border: #eee;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);
  --danger: #e63946;
  --success: #06d6a0;
  --info: #1f7a8c;
}

/* =============== Typography =============== */
h1,
h2,
h3,
h4 {
  margin: 0 0 .5rem;
  line-height: 1.8
}

h1 {
  font-size: clamp(1.6rem, 2.6vw+1rem, 2.3rem);
  font-weight: 800
}

h2 {
  font-size: clamp(1.25rem, 1.8vw+.6rem, 1.6rem);
  font-weight: 700
}

h3 {
  font-size: 1.1rem;
  font-weight: 700
}

h4 {
  font-size: 1rem;
  font-weight: 700
}

p {
  margin: .25rem 0 .85rem;
  color: var(--ink)
}

small,
.sr {
  font-size: .88rem;
  color: var(--muted)
}

a {
  color: #0b63ce;
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

/* =============== Layout helpers =============== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px
}

.flex {
  display: flex;
  gap: 12px;
  align-items: center
}

.right {
  text-align: right
}

.center {
  text-align: center
}

.hidden {
  display: none !important
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 16px 0
}

/* =============== Header / Nav =============== */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  position: sticky;
  top: 0;
  z-index: 20
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px
}

.logo {
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none
}

.main-nav a {
  margin: 0 10px;
  color: var(--ink);
  font-weight: 600
}

.main-nav a:hover {
  color: #202020;
  text-decoration: none;
  border-bottom: 2px solid var(--brand)
}

/* Header actions (cart/login) */
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center
}

.header-actions .btn,
.header-actions .btn-outline {
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 8px;
  line-height: 1.2
}

/* Mobile menu */
.menu-toggle {
  display: none;
  border: 2px solid var(--brand);
  background: #fff;
  color: #222;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700
}

@media (max-width:768px) {
  .menu-toggle {
    display: inline-block
  }

  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: #fff;
    border-bottom: 3px solid var(--brand);
    padding: 10px 16px
  }

  .main-nav.open {
    display: block
  }

  .main-nav a {
    display: block;
    padding: 10px 0;
    border-top: 1px solid #f2f2f2
  }

  .header-inner {
    position: relative
  }

  .header-actions {
    gap: 2px
  }

  .header-actions .btn,
  .header-actions .btn-outline {
    font-size: 13px;
    padding: 6px 8px
  }
}

/* =============== Buttons =============== */
.btn,
.btn-outline,
.btn-ghost {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all .25s ease;
  cursor: pointer;
  user-select: none
}

.btn {
  background: var(--brand);
  border: 2px solid var(--brand);
  color: #222
}

.btn:hover {
  background: var(--brand-2)
}

.btn:disabled {
  opacity: .6;
  pointer-events: none
}

.btn-outline {
  border: 2px solid var(--brand);
  color: #222;
  background: #fff
}

.btn-outline:hover {
  background: var(--brand)
}

.btn-ghost {
  background: transparent;
  border: 2px dashed var(--brand);
  color: #222
}

.btn-ghost:hover {
  background: #fffdfa
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: .92rem
}

.btn-lg {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 1.05rem
}

/* =============== Forms =============== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s
}

input:focus,
textarea:focus,
select:focus {
  border-color: #ffd54d;
  box-shadow: 0 0 0 3px rgba(248, 217, 78, .25)
}

.qty {
  width: 84px
}

.searchbar {
  display: flex;
  gap: 8px;
  margin: 10px 0
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px
}

/* =============== Cards / Banners / Badges =============== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .03)
}

.card.hover {
  transition: transform .25s, box-shadow .25s
}

.card.hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow)
}

.banner {
  background: #fffbe6;
  border: 1px solid #ffe77a;
  border-radius: 16px;
  padding: 12px
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
  background: #fff
}

.tag {
  display: inline-block;
  background: #eef;
  color: #334;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .85rem;
  margin-top: 10px;
}

.notice {
  padding: 10px;
  background: #fffefa;
  border: 1px solid #ffefb5;
  border-radius: 12px
}

.alert {
  padding: 10px;
  background: #ffe5e5;
  border: 1px solid #ffcaca;
  border-radius: 12px;
  color: #8a1f1f
}

/* =============== Product List / Grid =============== */
.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border)
}

.product-card h3 {
  font-size: 1rem;
  margin: 8px 0 2px
}

.product-card .price {
  color: var(--danger);
  font-weight: 800;
  margin: 4px 0
}

/* =============== Product Detail =============== */
.product {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px
}

.product img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border)
}

.product .meta {
  color: var(--muted)
}

/* =============== Tables (Cart / Orders) =============== */
.table {
  width: 100%;
  border-collapse: collapse
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left
}

.table .right {
  text-align: right
}

.table-wrap {
  width: 100%;
  overflow-x: auto
}

.table tr:hover td {
  background: #fffdf3
}

/* =============== Hero / Sections =============== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px 0
}

.section {
  margin: 16px 0
}

.fade-in {
  animation: fadeIn .8s ease both
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* =============== Footer (new) =============== */
.site-footer {
  background: #fff;
  border-top: 3px solid var(--brand);
  margin-top: 40px
}

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
  padding: 26px 0 10px
}

.foot-logo {
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 6px
}

.foot-slogan {
  color: #666;
  margin: 0
}

.foot-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0
}

.foot-list li {
  margin: 6px 0
}

.foot-list a {
  color: #0b63ce;
  text-decoration: none
}

.foot-list a:hover {
  text-decoration: underline
}

/* Warning box */
.foot-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 14px auto;
  padding: 14px 16px;
  border: 1px solid #ffe18a;
  border-radius: 14px;
  background: linear-gradient(0deg, #fffdf2, #fff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .03)
}

.warn-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #222;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08)
}

.foot-warning h5 {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: .2px
}

.foot-warning p {
  margin: 0;
  color: #444
}

.foot-bottom {
  border-top: 1px solid var(--border);
  padding: 12px 0 18px;
  text-align: center;
  color: #777
}

/* =============== Utilities =============== */
.mt-0 {
  margin-top: 0 !important
}

.mt-1 {
  margin-top: 6px !important
}

.mt-2 {
  margin-top: 12px !important
}

.mt-3 {
  margin-top: 18px !important
}

.mt-4 {
  margin-top: 24px !important
}

.mb-0 {
  margin-bottom: 0 !important
}

.mb-1 {
  margin-bottom: 6px !important
}

.mb-2 {
  margin-bottom: 12px !important
}

.mb-3 {
  margin-bottom: 18px !important
}

.mb-4 {
  margin-bottom: 24px !important
}

.w-100 {
  width: 100% !important
}

/* =============== Responsive Tweaks =============== */
@media (max-width:1200px) {
  .container {
    max-width: 1000px
  }
}

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

@media (max-width:900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:768px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px
  }

  .product {
    grid-template-columns: 1fr
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr
  }

  .btn,
  .btn-outline,
  .btn-ghost {
    /* width: 100%; */
    text-align: center
  }

  .logo {
    font-size: 12px
  }

  .hero {
    padding: 12px 0
  }

  .hero h1 {
    font-size: 1.35rem
  }

  .banner {
    font-size: .95rem
  }

  .footer-top {
    grid-template-columns: 1fr
  }
}

@media (max-width:480px) {
  .product-card img {
    height: 140px
  }

  .table th,
  .table td {
    padding: 8px
  }
}

/* ===== Live Chat (floating) ===== */
.glp-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.glp-chat .btn {
  box-shadow: 0 8px 24px rgba(248, 217, 78, .35)
}

.glp-chat-box {
  width: 300px;
  max-height: 60vh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.glp-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border)
}

.glp-chat-log {
  padding: 10px;
  overflow: auto;
  flex: 1;
  background: #fffdfa
}

.glp-line {
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 12px;
  max-width: 80%
}

.glp-line.me {
  background: #f8d94e;
  margin-left: auto;
  color: #222
}

.glp-line.bot {
  background: #eee
}

.glp-chat-form {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border)
}

.glp-chat-form input {
  flex: 1
}

@media (max-width:480px) {
  .glp-chat-box {
    width: 92vw
  }
}


/* ===== Contact page: mobile tune-up ===== */
@media (max-width: 430px) {

  /* ทำให้คอลัมน์ซ้อนกันทีละบล็อค */
  .contact-grid,
  .grid-contact,
  .grid {
    /* เลือก class grid ที่ใช้ใน contact.php ของคุณ */
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* กล่องการ์ดทั้งสองฝั่งให้ขอบมน/เงาบางและ padding น้อยลง */
  .card {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  /* หัวข้อใหญ่ให้เล็กลงนิดเพื่อไม่กินบรรทัด */
  h1,
  .h1 {
    font-size: 28px;
    line-height: 1.8;
  }

  h2,
  .h2 {
    font-size: 22px;
    line-height: 1.25;
  }

  h3,
  .h3 {
    font-size: 18px;
  }

  /* ฟอร์ม: ช่องให้สูง ~44px เพื่อแตะง่าย และไม่ zoom (>=16px) */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select {
    height: 44px;
    font-size: 16px;
    /* กัน iOS zoom */
    padding: 10px 12px;
    border-radius: 12px;
  }

  textarea {
    min-height: 120px;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  label {
    display: block;
    margin-bottom: 6px;
  }

  /* แถวฟอร์มหลายคอลัมน์ -> เป็นคอลัมน์เดียว */
  .form-row,
  .form-row-3 {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* สรุปช่องทางด่วนด้านขวาให้ระยะบรรทัดโปร่ง */
  .contact-quick p,
  .contact-quick li {
    line-height: 1.5;
  }

  /* แผนที่: ทำให้ responsive, โค้งมุม, ไม่ล้นขอบ */
  .map-wrap iframe {
    width: 100% !important;
    height: 260px !important;
    border: 0;
    border-radius: 14px;
  }

  .map-wrap {
    overflow: hidden;
    border-radius: 14px;
  }

  /* ปุ่ม */
  .btn,
  .btn-outline {
    padding: 10px 14px;
    font-size: 16px;
  }
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60
}

.modal.hidden {
  display: none
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  padding: 20px;
  max-width: 520px;
  width: 92%
}

.wheel-wrap {
  display: flex;
  justify-content: center
}

.wheel {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 8px solid #F7D24C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #fff
}

.wheel.spinning {
  animation: spin 1.6s ease-out
}

@keyframes spin {
  from {
    transform: rotate(0)
  }

  to {
    transform: rotate(1080deg)
  }
}


.header-actions .btn,
.btn,
.btn-outline {
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}

/* #openSpin {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
} */


.btn-icon {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
}



/* ===== Gift Claw Machine ===== */
.machine-wrap {
  display: flex;
  justify-content: center;
  margin-top: 10px
}

.machine {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 2px solid #F7D24C;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
  padding: 14px;
  position: relative;
  overflow: hidden
}

.rail {
  height: 6px;
  background: #F7D24C;
  border-radius: 3px;
  margin: 6px 6px 14px 6px;
  position: relative
}

.claw {
  width: 34px;
  height: 34px;
  background: linear-gradient(#fff, #f6f6f6);
  border: 2px solid #222;
  border-radius: 6px;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);   /* ให้อยู่กลางจริง */
  transition: left .6s ease, transform .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.claw .arm {
  position: absolute;
  bottom: -10px;
  width: 2px;
  height: 18px;
  background: #222
}

.claw .arm.left {
  transform: rotate(-25deg);
  left: 8px
}

.claw .arm.right {
  transform: rotate(25deg);
  right: 8px
}

.claw .grab {
  position: absolute;
  bottom: -18px;
  width: 22px;
  height: 6px;
  background: #222;
  border-radius: 3px
}

/* สายพาน + กล่องของขวัญ */
.belt {
  background: #fff7cf;
  border: 2px dashed #f0cc4e;
  border-radius: 12px;
  padding: 10px;
  overflow: hidden
}

.gift-row {
  display: flex;
  gap: 12px;
  will-change: transform
}

.gift {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #F7D24C;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .06)
}

.gift::before {
  content: "🎁";
  font-size: 28px;
  position: absolute;
  top: 6px
}

.gift span {
  font-size: 12px;
  max-width: 78px;
  text-align: center;
  padding: 0 6px;
  margin-top: 20px;
  color: #333
}

/* แอนิเมชันตอนคีบ */
.machine.picking .claw {
  animation: clawDown 1.2s ease forwards
}

@keyframes clawDown {
  0% {
    transform: translateY(0)
  }

  40% {
    transform: translateY(120px)
  }

  60% {
    transform: translateY(120px)
  }

  100% {
    transform: translateY(0)
  }
}

.gift.pick {
  animation: pickUp .9s ease forwards
}

@keyframes pickUp {
  0% {
    transform: translateY(0)
  }

  40% {
    transform: translateY(-16px) scale(1.02)
  }

  100% {
    transform: translateY(0)
  }
}

/* ปุ่มไอคอนเปิดโมดัลแบบกลม */
#openSpin {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

#openSpin i {
  font-size: 16px
}

/* Responsive */
@media (max-width:480px) {
  .gift {
    width: 72px;
    height: 72px
  }

  .gift span {
    font-size: 11px
  }
}


.coupon-card {
  border:2px dashed #f0cc4e;
  background:#fff9e6;
  border-radius:14px;
  padding:12px;
  margin-top:10px;
}
.coupon-head { font-size:16px; margin-bottom:6px; }
.coupon-body { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.coupon-code {
  font-size:16px;
  background:#fff;
  border:1px solid #f0cc4e;
  padding:6px 10px;
  border-radius:8px;
  display:inline-block;
}
.coupon-foot { color:#7a5d00; margin-top:6px; font-size:13px; }
.coupon-actions { margin-top:8px; text-align:right; }


/* แถวคูปอง + เลือกซื้อเพิ่ม ให้อยู่บรรทัดเดียว */
.coupon-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:12px;
}

/* ฟอร์มคูปองเป็น flex ภายใน */
.coupon-form{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1;                 /* ให้กินพื้นที่ที่เหลือ */
  min-width:0;            /* กัน overflow ใน flex */
}

/* override สไตล์เดิมที่ width:100% */
.coupon-form input[type="text"]{
  flex:1;
  width:auto !important;  /* สำคัญ: บังคับไม่ให้เต็มบรรทัด */
  min-width:180px;        /* ป้องกันพับ */
}

/* ไม่ให้ปุ่ม/ลิงก์ขึ้นบรรทัดใหม่ */
.coupon-row .btn-outline{
  white-space:nowrap;
}




/* ===== Coupon tables: responsive ===== */
.table.coupons { width: 100%; border-collapse: collapse; }
.table.coupons th, .table.coupons td { padding: 10px 12px; vertical-align: top; }

/* ปุ่ม/โค้ดอ่านง่าย */
code.coupon-code { font-size: 15px; word-break: break-all; }

/* Badge กลมๆ */
.badge { display:inline-block; padding:6px 10px; border-radius:999px; background:#eee; }
.badge.success{ background:#e6f7ea; color:#0a7a2a; }
.badge.warning{ background:#fff6d7; color:#8a6d00; }
.badge.danger { background:#ffe4e4; color:#a40000; }

/* การ์ดคูปองให้ขอบเหลืองนิดๆ */
.coupon-card-row { border:2px solid #f3d24e; border-radius:16px; padding:12px; margin-bottom:12px; background:#fff; }

/* ===== Mobile breakpoint ===== */
@media (max-width: 640px){
  /* ซ่อนหัวตาราง แล้วเปลี่ยนแต่ละ <tr> เป็นการ์ด */
  .table.coupons thead { display:none; }

  .table.coupons tr { display:block; }
  .table.coupons tr + tr { margin-top:12px; }

  .table.coupons td { 
    display:block; 
    padding:6px 0; 
    border:none; 
  }

  /* จัด layout เป็นบล็อก 2 คอลัมน์แนวตั้งสวยๆ */
  .coupon-card-row { display:grid; gap:8px; 
    grid-template-columns: 1fr auto; 
    align-items:center;
  }

  /* โค้ด + ปุ่มคัดลอก */
  .coupon-head { grid-column: 1 / -1; display:flex; align-items:center; gap:8px; }
  .coupon-head .copy { white-space:nowrap; }

  /* เงื่อนไข/ช่วงเวลา */
  .coupon-cond, .coupon-period { color:#555; font-size:14px; }

  /* สถานะ + ปุ่มไปตะกร้า ขยายกว้างเต็มแถวในจอเล็ก */
  .coupon-status { justify-self:start; }
  .coupon-actions { grid-column: 1 / -1; }
  .coupon-actions .btn-outline { width:100%; text-align:center; }
}

/* จอเล็กมาก: กันปุ่มขึ้นบรรทัดใหม่แปลกๆ */
@media (max-width: 380px){
  .coupon-head { flex-direction:column; align-items:flex-start; }
  .coupon-head .copy { width:100%; text-align:center; }
}


/* Landing */
.lp-hero{
  background: radial-gradient(1200px 400px at 50% -100px,#fff7c8,transparent),
              linear-gradient(#fffef7,#ffffff);
  border-bottom: 2px solid #f0cc4e;
}
.lp-hero-inner{
  max-width:1100px; margin:0 auto; padding:36px 16px 22px;
  text-align:center;
}
.lp-badge{ display:inline-block; background:#ffeb7a; border:2px solid #f0cc4e; padding:4px 10px; border-radius:999px; margin-bottom:8px; }
.lp-hero h1{ font-size:32px; margin:6px 0; }
.lp-hero .hl{ color:#a36b00; background:#fff0b3; padding:0 6px; border-radius:8px; }
.lp-cta{ display:flex; gap:10px; justify-content:center; margin-top:10px; }
.lp-usps{ display:flex; gap:14px; justify-content:center; margin-top:12px; flex-wrap:wrap; color:#333; }

.lp-strip{ background:#fff9e6; border-top:1px dashed #f0cc4e; border-bottom:1px dashed #f0cc4e; }
.lp-strip .container{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 16px; }
.lp-count{ font-variant-numeric: tabular-nums; }

.lp-cats h2, .lp-recs h2, .lp-testis h2, .lp-faq h2{ margin:14px 0 8px; }
.lp-cat-grid{ display:grid; gap:10px; grid-template-columns: repeat(5,1fr); }
.lp-cat{ display:flex; flex-direction:column; align-items:center; gap:6px; border:1px solid #eee; padding:10px; border-radius:12px; background:#fff; transition:box-shadow .2s; }
.lp-cat:hover{ box-shadow:0 6px 20px rgba(0,0,0,.06); }
.lp-cat-icon{ font-size:24px; }
.lp-cat-name{ text-align:center; }

.lp-head{ display:flex; justify-content:space-between; align-items:center; margin-top:4px; }

.lp-coupon{ margin-top:16px; }
.lp-coupon-card{
  display:grid; grid-template-columns:1fr auto; gap:12px;
  border:2px dashed #f0cc4e; background:#fff9e6; border-radius:16px; padding:14px;
}
.lp-coupon-right{ display:flex; align-items:center; }
.lp-stamp{ border:2px solid #f0cc4e; color:#6a4c00; padding:10px 12px; border-radius:12px; background:#ffeb7a; font-weight:700; }

.lp-testi-grid{ display:grid; gap:10px; grid-template-columns: repeat(3,1fr); }
.lp-testi{ border:1px solid #eee; border-radius:12px; padding:12px; background:#fff; }

.lp-faq details{ border:1px solid #eee; border-radius:12px; padding:10px 12px; background:#fff; margin-bottom:8px; }
.lp-faq summary{ cursor:pointer; }

.lp-final-cta{ background:#fff9e6; border-top:2px solid #f0cc4e; margin-top:18px; }
.lp-final-cta .container{ text-align:center; padding:18px 16px; }
.lp-final-cta h2{ margin:0 0 6px; }

@media (max-width: 992px){
  .lp-cat-grid{ grid-template-columns: repeat(3,1fr); }
  .lp-testi-grid{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px){
  .lp-hero h1{ font-size:26px; }
  .lp-cat-grid{ grid-template-columns: repeat(2,1fr); }
  .lp-cta{ flex-direction:column; }
  .lp-testi-grid{ grid-template-columns: 1fr; }
  .lp-coupon-card{ grid-template-columns: 1fr; }
}

/* ===== Product cards: รูปเท่ากัน เรียบร้อย ===== */

/* กริดสินค้าให้ยืดหยุ่นและเว้นช่องสวย ๆ */
.product-grid{
  display:grid;
  gap:14px;
  grid-template-columns:repeat(auto-fill, minmax(220px,1fr));
}

/* การ์ดสินค้า */
.product-card{
  display:block;
  border:1px solid #eee;
  border-radius:14px;
  background:#fff;
  padding:10px;
  transition:box-shadow .2s ease;
}
.product-card:hover{ box-shadow:0 6px 20px rgba(0,0,0,.06); }

/* กล่องรูป: คุมอัตราส่วน + ตัดส่วนเกิน */
.product-card .thumb{
  position:relative;
  aspect-ratio: 4 / 3;          /* ปรับเป็น 1/1 ถ้าอยากเป็นสี่เหลี่ยมจัตุรัส */
  overflow:hidden;
  border-radius:10px;
  background:#fafafa;
}

/* รูป: เติมเต็มกล่องอย่างสวย */
.product-card .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;             /* ใช้ contain ถ้าต้องการเห็นทั้งภาพ */
  display:block;
}

/* ป้ายแนะนำ */
.badge-recommend{
  position:absolute; top:8px; left:8px;
  background:#ffeb7a; color:#6a4c00;
  border:2px solid #f0cc4e;
  padding:2px 8px; border-radius:999px; font-size:12px;
}

/* ชื่อ/ราคา ให้ตัดบรรทัดพอดี ไม่ดันการ์ดยาวเกิน */
.product-card .title{
  margin-top:8px;
  font-size:15px; line-height:1.35;
  min-height:2.7em;             /* สูงสำหรับ 2 บรรทัด */
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
/* จอเล็ก: ให้กริดเหลือ 2 คอลัมน์ */
@media (max-width:640px){
  .product-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

/* ซ่อน add-to-cart สำหรับ Rx ถ้าเผลอใส่ class rx */
.rx-only { display:none !important; }



/* ===== Header modern clean ===== */
.site-header{
  position: sticky; top:0; z-index:50;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.header-inner{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.logo{
  display:flex; align-items:center; gap:10px;
  font-weight: 900;
  font-size: 18px;
  text-decoration:none;
  color:#111;
}
.logo .logo-mark{
  width:36px; height:36px; border-radius:12px;
  display:grid; place-items:center;
  background: linear-gradient(180deg, #ffe77a, #f8d94e);
  border:1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 20px rgba(248,217,78,.25);
}

.header-actions{
  display:flex; align-items:center; gap:10px;
}

/* icon buttons: เล็ก เรียบ เท่ากัน */
.icon-btn{
  width:40px; height:40px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  color:#111;
  text-decoration:none;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.icon-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(0,0,0,.10);
  background: rgba(248,217,78,.18);
}
.icon-btn i{ font-size: 16px; }

.icon-btn.danger:hover{ background: rgba(239,68,68,.10); }

/* cart badge */
.cart-btn{ position:relative; }
.cart-badge{
  position:absolute;
  top:-6px; right:-6px;
  min-width:18px; height:18px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #fff;
}

/* ซ่อน main-nav บนมือถือ แล้วให้ไปเปิดเป็น dropdown */
@media (max-width: 768px){
  .main-nav{ display:none; }
}

/* Desktop: แสดง nav */
@media (min-width: 769px){
  #menuToggle{ display:none; } /* ปิดปุ่ม hamburger บน desktop */
  .main-nav{ display:flex !important; gap:6px; align-items:center; }
}




/* ===== Landing Deals Modern ===== */
.lp-deals .lp-head{
  display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.lp-deals .lp-head .mini{ color:#6a4c00; font-weight:800; }
.lp-deals .link{ font-weight:800; }

.deal-card{
  border:1px solid #eee;
  border-radius:16px;
  background:#fff;
  padding:10px;
  box-shadow:0 10px 22px rgba(0,0,0,.04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.deal-card:hover{
  transform: translateY(-4px);
  box-shadow:0 14px 30px rgba(0,0,0,.08);
}
.deal-card a{ color:inherit; text-decoration:none; display:block; }

.deal-card .thumb{
  position:relative;
  aspect-ratio: 4/3;
  overflow:hidden;
  border-radius:12px;
  background:#fafafa;
}
.deal-card .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

.deal-card .badge-deal{
  position:absolute; left:10px; top:10px;
  background: linear-gradient(180deg,#ff6b6b,#ef4444);
  color:#fff; font-weight:900; font-size:12px;
  padding:5px 10px; border-radius:999px;
  box-shadow:0 10px 20px rgba(239,68,68,.25);
}
.deal-card .title{
  margin-top:10px;
  font-weight:900;
  font-size:15px; line-height:1.35;
  min-height:2.7em;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.deal-card .price{
  display:flex; align-items:baseline; gap:8px;
  margin-top:6px;
}
.deal-card .price b{ font-size:16px; }
.deal-card .compare{
  font-size:13px;
  opacity:.55;
  text-decoration:line-through;
}

.deal-bar{
  height:8px;
  background:#f3f4f6;
  border-radius:999px;
  overflow:hidden;
  margin-top:10px;
}
.deal-fill{
  height:8px;
  background: linear-gradient(90deg,#f59e0b,#f8d94e);
}

.badge-pres{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  background:#fff6d7;
  color:#8a6d00;
  font-weight:900;
  font-size:12px;
  border:1px solid rgba(0,0,0,.06);
}



.coupon-grid{
  display:grid;
  gap:14px;
}

.coupon-card{
  display:flex;
  justify-content:space-between;
  align-items:center;

  padding:16px;
  border-radius:12px;

  border:1px solid #eee;
  background:#fff;

  box-shadow:0 6px 14px rgba(0,0,0,.05);
}

.coupon-code{
  font-weight:900;
  font-size:18px;
  letter-spacing:1px;
}

.coupon-cond{
  margin-top:4px;
  color:#555;
}

.coupon-expire{
  font-size:12px;
  margin-top:6px;
  color:#888;
}

.coupon-right{
  display:flex;
  gap:8px;
}

.coupon-card .btn{
  padding:6px 12px;
}



/* =========================
   COUPON UI (Shopee-style)
   Prefix: cp-
   ========================= */

:root{
  --cp-brand: #f8d94e;
  --cp-ink:#1d1d1f;
  --cp-muted:#6b7280;
  --cp-border:#e5e7eb;
  --cp-bg:#ffffff;
  --cp-soft:#fff7cf;
  --cp-danger:#ef4444;
  --cp-success:#16a34a;
  --cp-warning:#f59e0b;
  --cp-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.cp-wrap{ margin-top:10px; }
.cp-topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 14px;
  border:1px solid var(--cp-border);
  border-radius:16px;
  background: linear-gradient(180deg,#fffdf3,#ffffff);
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
}
.cp-title{
  display:flex; align-items:center; gap:10px;
}
.cp-title .cp-dot{
  width:36px; height:36px; border-radius:12px;
  background: var(--cp-brand);
  display:grid; place-items:center;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.10);
  font-weight:900;
}
.cp-title h1{ margin:0; font-size:20px; line-height:1.2; }
.cp-sub{ color:var(--cp-muted); font-size:13px; margin-top:2px; }

.cp-tabs{
  display:flex; gap:8px; flex-wrap:wrap;
}
.cp-tab{
  border:1px solid var(--cp-border);
  background:#fff;
  border-radius:999px;
  padding:7px 10px;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.cp-tab.active{
  background: var(--cp-brand);
  border-color: var(--cp-brand);
}

.cp-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
  margin-top:14px;
}
@media (max-width: 900px){
  .cp-grid{ grid-template-columns: 1fr; }
}

/* Coupon Card */
.cp-card{
  position:relative;
  display:flex;
  min-height:140px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--cp-border);
  background: var(--cp-bg);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cp-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--cp-shadow);
}

/* left band (discount) */
.cp-band{
  width:120px;
  background: linear-gradient(180deg, #fff3b0, #ffe77a);
  border-right:1px dashed rgba(0,0,0,.15);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:12px 10px;
  position:relative;
}
.cp-band:before,
.cp-band:after{
  content:"";
  position:absolute;
  right:-10px;
  width:20px; height:20px;
  background: #fff;
  border:1px solid var(--cp-border);
  border-radius:50%;
}
.cp-band:before{ top:18px; }
.cp-band:after{ bottom:18px; }
.cp-off{
  font-weight:900;
  font-size:22px;
  letter-spacing:.3px;
  color:#7a5200;
  line-height:1.05;
  text-align:center;
}
.cp-off small{
  display:block;
  font-size:12px;
  font-weight:800;
  color:#7a5200;
  opacity:.9;
}

/* body */
.cp-body{
  flex:1;
  padding:14px 14px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cp-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.cp-code{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  letter-spacing:.8px;
  font-size:16px;
  padding:6px 10px;
  border-radius:12px;
  background:#fffdf3;
  border:1px solid #ffe18a;
  width: fit-content;
}
.cp-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  border:1px solid var(--cp-border);
  background:#fff;
  color:#444;
  white-space:nowrap;
}
.cp-pill.success{ background:#e9f8ee; color:#116b2a; border-color:#bfe9c9; }
.cp-pill.warning{ background:#fff6d7; color:#7a5d00; border-color:#ffe18a; }
.cp-pill.danger{ background:#ffe4e4; color:#8b0000; border-color:#ffcaca; }

.cp-desc{
  color:#444;
  font-size:13.5px;
  line-height:1.45;
}
.cp-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  color:var(--cp-muted);
  font-size:12px;
}
.cp-meta b{ color:#444; }

.cp-actions{
  margin-top:auto;
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.cp-btn{
  display:inline-flex;
  align-items:center;
  gap:7px;
  border-radius:12px;
  padding:8px 10px;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  border:1px solid var(--cp-border);
  background:#fff;
  color:#222;
  text-decoration:none;
}
.cp-btn:hover{ background:#fffdf3; }
.cp-btn.primary{
  background: var(--cp-brand);
  border-color: var(--cp-brand);
}
.cp-btn.primary:hover{ filter: brightness(1.02); }
.cp-btn:disabled{
  opacity:.55; cursor:not-allowed;
}

/* countdown */
.cp-countdown{
  font-variant-numeric: tabular-nums;
  font-weight:900;
  color:#7a5200;
}

/* section headers */
.cp-h2{
  margin-top:18px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.cp-h2 h2{ margin:0; font-size:16px; }
.cp-h2 .sr{ margin:0; }

/* history table make nicer */
.cp-table{
  margin-top:10px;
  border:1px solid var(--cp-border);
  border-radius:14px;
  overflow:hidden;
}
.cp-table .table{ margin:0; }
.cp-table .table th{ background:#fffdf3; }

/* toast */
.cp-toast{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:999;
  min-width: 220px;
  max-width: 320px;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--cp-border);
  background:#fff;
  box-shadow: var(--cp-shadow);
  display:none;
}
.cp-toast.show{ display:block; }
.cp-toast .t1{ font-weight:900; margin:0 0 2px; }
.cp-toast .t2{ margin:0; color:var(--cp-muted); font-size:13px; }

/* mobile tighten */
@media (max-width: 480px){
  .cp-band{ width:108px; }
  .cp-card{ min-height:132px; }
  .cp-actions{ justify-content:flex-start; }
}



/* =============================
   CART COUPON UI
============================= */

.cart-coupon-box{
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  margin-top:14px;
  background:#fffdf3;
}

.cart-coupon-row{
  display:flex;
  gap:8px;
  align-items:center;
}

.cart-coupon-row input{
  flex:1;
  padding:10px;
  border-radius:10px;
  border:1px solid #ddd;
}

.cart-coupon-applied{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:#fff;
  border:1px dashed #f8d94e;
  border-radius:12px;
  padding:10px 12px;
}

.cart-coupon-code{
  font-weight:900;
  letter-spacing:1px;
}

.cart-coupon-discount{
  color:#16a34a;
  font-weight:700;
}

.cart-coupon-remove{
  font-size:12px;
  cursor:pointer;
}

.cart-summary{
  border:1px solid #eee;
  border-radius:14px;
  padding:16px;
  background:#fff;
}

.cart-summary-row{
  display:flex;
  justify-content:space-between;
  margin:6px 0;
}

.cart-summary-total{
  font-size:18px;
  font-weight:900;
}

.cart-coupon-suggest{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.cart-coupon-chip{
  border:1px solid #ddd;
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-size:12px;
}

.cart-coupon-chip:hover{
  background:#f8d94e;
}


/* ===== Cart Modern UI (scoped) ===== */
.cart-page h1{margin:10px 0 14px;}
.cart-layout{display:grid; grid-template-columns: 1.3fr .7fr; gap:14px; align-items:start;}
@media (max-width: 980px){ .cart-layout{grid-template-columns: 1fr;} }

.cart-panel{border:1px solid #eee; border-radius:14px; background:#fff; box-shadow: 0 8px 22px rgba(0,0,0,.04);}
.cart-panel .hd{padding:14px 14px 10px; border-bottom:1px solid #f2f2f2; display:flex; justify-content:space-between; align-items:center; gap:10px;}
.cart-panel .hd h3{margin:0; font-size:16px;}
.cart-panel .bd{padding:12px 14px;}
.cart-panel .ft{padding:12px 14px; border-top:1px solid #f2f2f2;}

.cart-items{display:flex; flex-direction:column; gap:10px;}
.cart-item{display:grid; grid-template-columns: 1fr auto; gap:10px; border:1px solid #f1f1f1; border-radius:12px; padding:12px; background:#fff;}
.cart-item:hover{border-color:#e9e9e9; box-shadow:0 8px 18px rgba(0,0,0,.04);}
.cart-item .left{min-width:0;}
.cart-item .name{display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-weight:800;}
.cart-item .meta{margin-top:6px; display:flex; gap:10px; flex-wrap:wrap; color:#666; font-size:13px;}
.cart-item .price b{font-size:15px;}
.cart-item .compare{opacity:.55; text-decoration:line-through; margin-left:6px;}
.cart-item .qtypill{display:inline-flex; align-items:center; gap:8px; background:#f7f7f7; border:1px solid #eee; border-radius:999px; padding:6px 10px; font-size:13px;}
.cart-item .right{text-align:right; display:flex; flex-direction:column; align-items:flex-end; gap:8px;}
.cart-item .sum{font-weight:900; font-size:16px;}
.cart-item .actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end;}

.badge-flash{display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:800;
  background:#fff1f2; color:#9f1239; border:1px solid #ffe4e6;}
.badge-flash i{font-size:12px;}

.cart-actions-row{display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:space-between;}
/* ===== Fix: coupon chip not overlap input ===== */
.coupon-box{
  display:flex;
  flex-direction:column;
  gap:10px;
  width:100%;
}

/* ให้ฟอร์มกว้างเต็ม และจัด layout แนวนอน */
.coupon-form{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;              /* จอแคบให้ขึ้นบรรทัด */
  width:100%;
  position:relative;
  z-index:1;
}

.coupon-form input{
  flex:1 1 220px;              /* ยืดได้ + มี min width */
  width:100%;
  min-width:0;                 /* สำคัญใน flex กันล้น */
  padding:12px 12px;
  border-radius:12px;
}

/* ชิปต้อง “ไม่ลอย” */
.coupon-chip{
  position:static !important;  /* กัน absolute จาก css เก่า */
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  margin:0;
  z-index:0;
}

/* ปุ่มกากบาทไม่ให้ดัน layout แปลก */
.coupon-chip form{ margin:0; }
.coupon-chip .btn-ghost{
  flex:0 0 auto;
}

/* ถ้าหน้าจอเล็กมาก ปุ่มใช้คูปองให้เต็มบรรทัด */
@media (max-width: 520px){
  .coupon-form button{ width:100%; }
}
.coupon-chip{display:flex; gap:10px; align-items:center; flex-wrap:wrap; background:#fff7db; border:1px solid #f5e7a6; padding:10px 12px; border-radius:12px;}
.coupon-chip code{font-weight:900; padding:3px 8px; border-radius:10px; background:#fff; border:1px solid #eee;}
.coupon-chip .mini{font-size:13px; color:#6b7280;}
.btn-ghost{background:transparent; border:1px solid #e9e9e9; padding:8px 10px; border-radius:12px; cursor:pointer;}
.btn-danger-lite{background:#fff1f2; border:1px solid #ffe4e6; color:#9f1239;}
.btn-danger-lite:hover{filter:brightness(.98);}

.summary-lines{display:flex; flex-direction:column; gap:8px; font-size:14px;}
.sum-row{display:flex; justify-content:space-between; gap:10px;}
.sum-row strong{font-size:18px;}
.sum-sub{color:#6b7280; font-size:13px;}
.hr{height:1px; background:#f2f2f2; margin:10px 0;}

.empty-cart{padding:22px; text-align:center; color:#666;}
.empty-cart .big{font-size:18px; font-weight:900; color:#111; margin-bottom:6px;}