/* ==========================================================================
   Sand&sun — แลนดิ้งเพจ
   โทนครีมอบอุ่น ตัวหนังสือใหญ่กว่าปกติ เพราะลูกค้าหลักคือผู้หญิง 45-60 ปี
   รูปทุกใบเป็นจัตุรัส 1:1 และมีตัวหนังสือติดอยู่ในรูป จึงห้ามครอปทุกกรณี
   ========================================================================== */

:root {
  --cream:      #FBF7F0;
  --cream-2:    #F4ECE0;
  --white:      #FFFFFF;
  --ink:        #2E2A26;
  --ink-2:      #6B6259;
  --ink-3:      #8C8378;
  --clay:       #9C5B3F;
  --clay-dark:  #7E4630;
  --clay-soft:  #EFE0D4;
  --sage:       #7F8B6D;
  --rose:       #A84A57;
  --line-green: #06C755;
  --hair:       #E5DAC9;

  --wrap:  1200px;
  --gut:   20px;
  --r:     14px;
  --ease:  cubic-bezier(.22,.61,.36,1);
  --bar:   60px;                 /* ความสูงแถบปุ่มลอยบนมือถือ ห้ามเกินนี้ */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
  overflow-x: hidden;            /* กันเลื่อนซ้าย-ขวาบนมือถือ */
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3 { line-height: 1.4; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6.4vw, 54px); }
h2 { font-size: clamp(26px, 4.4vw, 40px); }
h3 { font-size: clamp(18px, 2.2vw, 21px); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--tint { background: var(--cream-2); }

.eyebrow {
  font-size: 15px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--clay); margin: 0 0 12px;
}
.lede { font-size: clamp(17px, 2vw, 19px); color: var(--ink-2); max-width: 62ch; }
.head { margin-bottom: clamp(32px, 4vw, 52px); }

/* เฉพาะโปรแกรมอ่านหน้าจอ */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ลิงก์ข้ามเนื้อหา ซ่อนไว้จนกว่าจะกด Tab ถึง แล้วค่อยโผล่มาเป็นปุ่มขนาดปกติ */
.skip { position: fixed; top: 8px; left: 8px; z-index: 200;
        transform: translateY(-160%); transition: transform .18s var(--ease);
        display: inline-flex; align-items: center; min-height: 48px; padding: 12px 20px;
        background: var(--ink); color: var(--cream); border-radius: 10px;
        font-weight: 600; text-decoration: none; }
.skip:focus-visible { transform: none; }

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 6px;
}

/* ---------------- ปุ่ม ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 14px 28px;
  font: inherit; font-weight: 600; font-size: 18px;
  border: 1.5px solid transparent; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn--line  { background: var(--line-green); color: #fff; }
.btn--line:hover { background: #05b34c; }
.btn--solid { background: var(--clay); color: #fff; }
.btn--solid:hover { background: var(--clay-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }

@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ---------------- หัวเว็บ ---------------- */

.hdr {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid var(--hair);
}
.hdr__in { display: flex; align-items: center; justify-content: space-between;
           gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none;
         min-height: 44px; padding-right: 4px; }
.brand__mark { width: 26px; height: 26px; flex: none; color: var(--clay); }
.brand__name { font-size: 23px; font-weight: 600; letter-spacing: .005em; }
.hdr__acts { display: flex; align-items: center; gap: 10px; }
.hdr__tel {
  display: none; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 600; font-size: 17px; padding: 10px 14px; border-radius: 999px;
}
.hdr__tel svg { width: 20px; height: 20px; color: var(--clay); }
.hdr__tel:hover { background: var(--clay-soft); }
.hdr .btn { min-height: 46px; padding: 10px 20px; font-size: 16px; }
@media (min-width: 720px) { .hdr__tel { display: inline-flex; } }

/* ---------------- แบนเนอร์ ---------------- */
/* รูปคงสัดส่วน 1:1 เดิมเสมอ เพราะมีชื่อแบรนด์กับราคาพิมพ์ติดอยู่ในรูป
   ถ้าครอปให้เป็นแนวนอน ตัวหนังสือในรูปจะหายไป */

.hero { background: var(--cream); border-bottom: 1px solid var(--hair); }
.hero__grid { display: grid; }
.hero__media { position: relative; order: -1; }
.hero__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.hero__body { padding: clamp(32px, 6vw, 40px) var(--gut) clamp(44px, 7vw, 56px); }
.hero__sub { font-size: clamp(17px, 2vw, 19px); color: var(--ink-2);
             margin: 18px 0 0; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px;
  padding-top: 22px; border-top: 1px solid var(--hair);
  font-size: 16px; color: var(--ink-2);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 18px; height: 18px; color: var(--clay); flex: none; }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1fr 1fr; align-items: center; }
  .hero__media { order: 0; }
  .hero__body {
    padding: 72px clamp(40px, 5vw, 72px) 72px
             max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut)));
    /* จัดให้ตัวหนังสือตรงกับขอบ .wrap ของส่วนอื่น */
    padding-left: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut)));
    padding-right: clamp(32px, 4vw, 64px);
  }
}

/* ---------------- จุดเด่น ---------------- */

.feats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 480px) { .feats { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 768px) { .feats { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

.feat {
  background: var(--white); border-radius: var(--r);
  padding: clamp(18px, 2.4vw, 26px);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.feat:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(46,42,38,.07); }
.feat__ico { width: 30px; height: 30px; color: var(--clay); margin-bottom: 14px; }
.feat h3 { margin-bottom: 6px; }
.feat p { font-size: 16px; color: var(--ink-2); line-height: 1.65; }
@media (prefers-reduced-motion: reduce) { .feat:hover { transform: none; } }

/* ---------------- เกี่ยวกับร้าน ---------------- */

.about { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1fr; } }
.about__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r); }
.about__body p { color: var(--ink-2); }
.about__body h2 { color: var(--ink); margin-bottom: 20px; }

/* ---------------- คอลเลกชัน ---------------- */

.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (min-width: 480px)  { .grid { gap: 14px; } }
@media (min-width: 768px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 24px; } }

/* การ์ดสินค้า: รูปไม่มีกรอบ ไม่มีเงา ไม่มีเส้นขอบ ใช้ระยะห่างแยกกันตามกติกา */
.card { display: flex; flex-direction: column; height: 100%; }
.card__btn {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in; border-radius: var(--r); overflow: hidden;
  transition: transform .2s var(--ease);
}
.card__btn img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card:hover .card__btn { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .card:hover .card__btn { transform: none; } }

.card__body { padding: 12px 2px 0; display: flex; flex-direction: column; flex: 1; }
/* กันที่ไว้สองบรรทัดเสมอ ราคาของการ์ดในแถวเดียวกันจะได้อยู่ระดับเดียวกัน */
.card__name { font-size: clamp(15px, 1.7vw, 17px); font-weight: 600; line-height: 1.45;
              margin: 0; min-height: calc(2 * 1.45em); }
.card__meta { font-size: 15px; color: var(--ink-3); margin: 5px 0 0; line-height: 1.55; }
.card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
               margin: 9px 0 10px; }
.card__now  { font-size: clamp(17px, 2vw, 19px); font-weight: 700; }
.card__was  { font-size: 16px; color: var(--ink-3); text-decoration: line-through; }
.card__now--sale { color: var(--rose); }
.card__ask  { font-size: 15px; font-weight: 600; color: var(--clay); }
.card__stock {
  /* ดันลงล่างสุดของการ์ด ป้ายของทุกใบในแถวจะได้อยู่ระดับเดียวกัน */
  display: inline-block; align-self: flex-start; margin-top: auto; padding: 3px 11px;
  font-size: 14px; font-weight: 600; border-radius: 999px;
  background: var(--clay-soft); color: var(--clay-dark);
}

/* ---------------- ติดต่อ ---------------- */

.contact { display: grid; gap: clamp(24px, 3vw, 40px); }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; align-items: start; } }

.info { display: grid; gap: 4px; margin: 0; }
.info__row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 0; border-bottom: 1px solid var(--hair);
}
.info__row:last-child { border-bottom: 0; }
.info__ico { width: 22px; height: 22px; color: var(--clay); flex: none; margin-top: 4px; }
.info__k { font-size: 15px; color: var(--ink-3); margin: 0 0 2px; }
.info__v { font-size: 17px; font-weight: 600; margin: 0; text-decoration: none; word-break: break-word; }
/* ลิงก์ที่กดได้ต้องสูงอย่างน้อย 44px ให้นิ้วกดโดนง่าย */
a.info__v { display: inline-flex; align-items: center; min-height: 44px; }
a.info__v:hover { color: var(--clay); text-decoration: underline; }

.cta-stack { display: grid; gap: 12px; align-content: start; }
.cta-stack .btn { width: 100%; }

.social { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.social a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; min-height: 52px; border-radius: 999px;
  background: var(--white); text-decoration: none; font-weight: 600; font-size: 16px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.social a:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(46,42,38,.08); }
.social svg { width: 24px; height: 24px; flex: none; }
@media (prefers-reduced-motion: reduce) { .social a:hover { transform: none; } }

/* ---------------- ท้ายหน้า ---------------- */

.ftr { background: var(--ink); color: var(--cream); padding: 44px 0; }
.ftr__in { display: grid; gap: 14px; }
.ftr__name { font-size: 21px; font-weight: 600; }
.ftr p { color: #C9C0B4; font-size: 16px; margin: 0; }
.ftr a { color: #C9C0B4; display: inline-flex; align-items: center; min-height: 44px; }
.ftr__by { font-size: 15px; color: #8E857A; margin-top: 8px; }

/* ---------------- ปุ่มลอยบนมือถือ ---------------- */

.dock {
  position: fixed; inset: auto 0 0 0; z-index: 70;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--cream) 94%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--hair);
}
.dock .btn { min-height: 46px; font-size: 16px; padding: 9px 14px; }
@media (min-width: 900px) { .dock { display: none; } }
@media (max-width: 899px) { body { padding-bottom: var(--bar); } }

/* ---------------- กล่องดูรูปใหญ่ ---------------- */

.lb {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(30,26,22,.92);
  opacity: 0; visibility: hidden; transition: opacity .22s var(--ease), visibility .22s;
}
.lb[data-open='1'] { opacity: 1; visibility: visible; }
.lb__fig { margin: 0; max-width: min(92vw, 720px); text-align: center; }
.lb__fig img {
  width: 100%; height: auto; border-radius: 10px;
  max-height: 76vh; object-fit: contain;   /* คงสัดส่วนเดิม ไม่ครอป */
}
.lb__cap { color: #EDE4D8; font-size: 16px; margin-top: 14px; line-height: 1.6; }
.lb__cap b { display: block; font-size: 18px; color: #fff; }
.lb__x {
  position: absolute; top: 14px; right: 14px;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff;
}
.lb__x:hover { background: rgba(255,255,255,.26); }
.lb__x svg { width: 24px; height: 24px; }
.lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff;
}
.lb__nav:hover { background: rgba(255,255,255,.26); }
.lb__nav svg { width: 26px; height: 26px; }
.lb__nav--prev { left: 10px; }
.lb__nav--next { right: 10px; }
@media (min-width: 720px) { .lb__nav--prev { left: 24px; } .lb__nav--next { right: 24px; } }

/* ---------------- อนิเมชันตอนเลื่อนถึง ---------------- */
/* ขยับขึ้น 20px พร้อมจางเข้า เล่นครั้งเดียว ไม่เล่นซ้ำ */

/* ซ่อนไว้ก่อนเฉพาะเมื่อ app.js ทำงานแล้วเท่านั้น
   ถ้าสคริปต์โหลดไม่ขึ้น เนื้อหาจะแสดงตามปกติ ไม่หายไปทั้งหน้า */
.reveal-on .reveal { opacity: 0; transform: translateY(20px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
}
