@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Sarabun:wght@300;400;500;700&display=swap');

:root {
  /* Cream & Emerald Luxury Palette */
  --emerald:      #1B5E3B;
  --emerald-mid:  #2A7A50;
  --emerald-light:#3D9966;
  --gold:         #B8965A;
  --gold-light:   #D4B078;
  --cream:        #FAF6F0;
  --cream-dark:   #F0E8DC;
  --cream-mid:    #EDE3D5;
  --ivory:        #FFFDF9;
  --ink:          #1C1410;
  --ink-mid:      #3D2B1A;
  --muted:        #7A6250;
  --line:         rgba(27, 94, 59, 0.12);
  --line-gold:    rgba(184, 150, 90, 0.22);
  --shadow:       0 20px 60px rgba(27, 59, 39, 0.10);
  --shadow-sm:    0 6px 20px rgba(27, 59, 39, 0.08);
  --radius:       4px;
  --radius-lg:    8px;
  --container:    min(1140px, calc(100% - 48px));

  /* Legacy aliases kept for compatibility */
  --red:          #B83232;
  --orange:       #C07830;
  --green:        var(--emerald);
  --pink:         var(--gold);
  --lime:         var(--gold-light);
  --soft-green:   rgba(27, 94, 59, 0.07);
  --soft-blue:    rgba(27, 94, 59, 0.05);
  --soft-pink:    rgba(184, 150, 90, 0.10);
  --yellow:       var(--gold-light);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Sarabun", "Tahoma", sans-serif;
  font-weight: 400;
  background: var(--cream);
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Accessibility ───────────────────────────── */
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--emerald);
  color: #fff;
  padding: 10px 14px;
  font-family: "Sarabun", sans-serif;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Header / Nav ───────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-gold);
  background: rgba(250, 246, 240, 0.96);
  backdrop-filter: blur(20px);
}

.nav {
  width: var(--container);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  object-fit: cover;
  object-position: center;
  background: var(--cream);
  box-shadow: 0 4px 16px rgba(184, 150, 90, 0.20);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-family: "Cormorant Garamond", "Sarabun", serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.brand small {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-menu a {
  display: inline-flex;
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--ink-mid);
  transition: color 0.2s, background 0.2s;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: var(--soft-green);
  color: var(--emerald);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--line-gold);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--emerald);
}

/* ── Hero ───────────────────────────────────── */
.hero {
  position: relative;
  min-height: 700px;
  display: grid;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: top center;
  z-index: -3;
}

.hero-overlay {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(28, 20, 16, 0.90), rgba(28, 20, 16, 0.30) 50%, rgba(28, 20, 16, 0.06)),
    linear-gradient(0deg, rgba(28, 20, 16, 0.92), rgba(28, 20, 16, 0.05) 54%);
}

.hero-content {
  width: var(--container);
  margin: 0 auto;
  padding: 160px 0 72px;
  color: #fff;
}

/* ── Eyebrow ─────────────────────────────────── */
.eyebrow {
  margin: 0 0 10px;
  color: var(--emerald);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--gold-light);
}

/* ── Typography ──────────────────────────────── */
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  font-family: "Cormorant Garamond", "Sarabun", serif;
  font-weight: 300;
  letter-spacing: 0.02em;
}

h1 {
  max-width: 760px;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.24);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
}

h3 {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero-copy {
  max-width: 580px;
  margin: 20px 0 32px;
  font-size: 1.12rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Buttons ──────────────────────────────────── */
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 12px 24px;
  color: #fff;
  font-family: "Sarabun", sans-serif;
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s, box-shadow 0.18s;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.button-line {
  background: var(--emerald);
}

.button-line:hover {
  background: var(--emerald-mid);
}

.button-call {
  background: linear-gradient(135deg, var(--ink-mid), var(--ink));
  border: 1px solid rgba(255,255,255,0.12);
}

.button-map {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.60);
  color: #fff;
}

.button-map:hover {
  background: rgba(255,255,255,0.10);
}

/* ── Sections ─────────────────────────────────── */
.section {
  padding: 96px 0;
  background: var(--ivory);
}

.section-light {
  background: var(--cream);
}

.section-inner {
  width: var(--container);
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

/* ── Product Cards ───────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.product-card,
.menu-group {
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background: var(--ivory);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s, transform 0.22s;
}

.product-card:hover,
.menu-group:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-card {
  padding: 20px;
}

.product-card h3 {
  margin-top: 14px;
  color: var(--ink);
}

.product-card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin: 8px 0 12px;
}

.product-card strong {
  color: var(--emerald);
  font-size: 1.05rem;
  font-weight: 700;
}

.product-image {
  width: 100%;
  height: 160px;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center;
}

/* ── Menu ───────────────────────────────────── */
.menu-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.menu-group {
  padding: 24px 26px;
}

.menu-group h3 {
  color: var(--emerald);
  border-bottom: 1px solid var(--line-gold);
  padding-bottom: 12px;
  margin-bottom: 0;
}

.menu-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.menu-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  font-size: 0.96rem;
}

.menu-list span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.menu-icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line-gold);
  font-size: 0.95rem;
}

.menu-list strong {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 6px;
  min-width: max-content;
  color: var(--ink-mid);
  font-weight: 600;
}

.menu-list del {
  color: var(--muted);
  font-weight: 400;
  text-decoration-thickness: 1px;
}

.menu-list ins {
  color: var(--emerald);
  text-decoration: none;
}

/* ── Promotions ──────────────────────────────── */
.section-promo {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 20%, rgba(184, 150, 90, 0.10), transparent 36%),
    linear-gradient(135deg, var(--cream-dark) 0%, var(--cream) 100%);
  border-block: 1px solid var(--line-gold);
}

.section-promo .eyebrow {
  color: var(--gold);
}

.promo-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
}

.promo-layout p {
  max-width: 600px;
  margin: 16px 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.delivery-logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
}

.delivery-card {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background: var(--ivory);
  box-shadow: 0 10px 28px rgba(184, 150, 90, 0.10);
  padding: 14px;
  transition: box-shadow 0.2s;
}

.delivery-card:hover {
  box-shadow: 0 16px 36px rgba(184, 150, 90, 0.18);
}

.delivery-card img {
  width: 110px;
  max-height: 68px;
  object-fit: contain;
}

/* ── Reviews ──────────────────────────────────── */
.review-controls {
  display: flex;
  gap: 8px;
}

.review-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  color: var(--emerald);
  background: var(--ivory);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.review-button:hover,
.review-button:focus-visible {
  color: #fff;
  background: var(--emerald);
}

.review-slider {
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background: var(--ivory);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.review-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.review-track::-webkit-scrollbar {
  display: none;
}

.review-slide {
  flex: 0 0 calc((100% - 36px) / 3);
  margin: 0;
  display: flex;
  justify-content: center;
  scroll-snap-align: start;
}

.review-slide img {
  width: 100%;
  max-height: 720px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--ivory);
  box-shadow: 0 12px 36px rgba(27, 59, 39, 0.10);
}

.review-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.review-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--line-gold);
  cursor: pointer;
  padding: 0;
  transition: width 0.2s, background 0.2s;
}

.review-dot.is-active {
  width: 26px;
  border-radius: 999px;
  background: var(--emerald);
}

/* ── About ───────────────────────────────────── */
.about-layout,
.map-layout {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  align-items: center;
  gap: 56px;
}

.about-layout p {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 16px 0;
}

.about-layout img {
  width: 100%;
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-mid);
  font-size: 0.97rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
}

/* ── Map ─────────────────────────────────────── */
.section-map {
  background: var(--cream-dark);
}

address {
  margin-top: 18px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.97rem;
  line-height: 1.8;
}

address a {
  color: var(--emerald);
  border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}

address a:hover {
  color: var(--emerald-mid);
}

iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ── Footer ──────────────────────────────────── */
.footer {
  padding: 64px 0 28px;
  color: var(--cream);
  background: linear-gradient(150deg, #0D2E1C 0%, var(--ink) 100%);
  border-top: 1px solid rgba(184, 150, 90, 0.18);
}

.footer .eyebrow {
  color: var(--gold-light);
}

.footer h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.footer-inner {
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}

.footer p {
  margin-bottom: 0;
  color: rgba(250, 246, 240, 0.70);
  font-size: 0.97rem;
}

.contact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.contact-list li,
.contact-list a {
  display: block;
  border-radius: var(--radius);
  background: rgba(250, 246, 240, 0.06);
  border: 1px solid rgba(184, 150, 90, 0.14);
  padding: 11px 16px;
  color: var(--cream);
  transition: background 0.2s;
}

.contact-list a:hover {
  background: rgba(184, 150, 90, 0.12);
}

.contact-list li:has(a) {
  padding: 0;
  background: transparent;
  border: none;
}

.copyright {
  width: var(--container);
  margin: 40px auto 0;
  font-size: 0.84rem;
  color: rgba(250, 246, 240, 0.40);
  letter-spacing: 0.06em;
  border-top: 1px solid rgba(184, 150, 90, 0.10);
  padding-top: 20px;
}

/* ── Popup ───────────────────────────────────── */
.welcome-popup[hidden] {
  display: none;
}

.welcome-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.welcome-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 20, 16, 0.70);
  backdrop-filter: blur(6px);
}

.welcome-popup-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background: var(--ivory);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.welcome-popup-dialog img {
  width: 100%;
  max-height: min(76vh, 560px);
  object-fit: contain;
  background: var(--ivory);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  color: var(--ink);
  background: var(--ivory);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
}

body.popup-open {
  overflow: hidden;
}

/* ── Responsive: Tablet ──────────────────────── */
@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 84px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line-gold);
    border-radius: var(--radius-lg);
    background: var(--ivory);
    padding: 10px;
    box-shadow: var(--shadow);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    width: 100%;
  }

  .hero {
    min-height: 620px;
  }

  .product-grid,
  .menu-layout,
  .promo-layout,
  .about-layout,
  .map-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .delivery-logos {
    grid-template-columns: repeat(3, 1fr);
  }

  .review-slide {
    flex-basis: calc((100% - 18px) / 2);
  }
}

/* ── Responsive: Mobile ──────────────────────── */
@media (max-width: 640px) {
  :root {
    --container: min(100% - 24px, 1140px);
  }

  .nav {
    min-height: 66px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 580px;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(28, 20, 16, 0.94), rgba(28, 20, 16, 0.50)),
      linear-gradient(0deg, rgba(28, 20, 16, 0.94), rgba(28, 20, 16, 0.14) 60%);
  }

  .hero-content {
    padding-bottom: 48px;
  }

  h1 {
    font-size: 2.6rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .section {
    padding: 64px 0;
  }

  .section-heading {
    display: block;
  }

  .review-controls {
    margin-top: 16px;
  }

  .review-slider {
    padding: 14px;
  }

  .review-slide img {
    max-height: 600px;
  }

  .review-slide {
    flex-basis: 100%;
  }

  .hero-actions,
  .delivery-logos {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
    text-align: center;
  }
}

/* ── Order / Cart ────────────────────────────── */
.section-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.menu-list li.menu-item {
  align-items: center;
  gap: 10px;
}

.menu-item-name {
  flex: 1 1 auto;
}

.add-to-cart {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  background: var(--cream);
  color: var(--emerald);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1;
  padding: 0;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.add-to-cart:hover,
.add-to-cart:focus-visible {
  background: var(--emerald);
  color: #fff;
}

.add-to-cart.is-added {
  background: var(--emerald);
  color: #fff;
  transform: scale(1.12);
}

/* Floating cart button */
.cart-fab[hidden] {
  display: none;
}

.cart-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid rgba(184, 150, 90, 0.35);
  border-radius: 999px;
  background: var(--emerald);
  color: #fff;
  padding: 0 20px;
  font-family: "Sarabun", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(27, 59, 39, 0.32);
  transition: transform 0.18s, box-shadow 0.18s;
}

.cart-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(27, 59, 39, 0.38);
}

.cart-fab-icon {
  font-size: 1.15rem;
}

.cart-fab-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--ink);
  padding: 0 7px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Cart drawer */
.cart[hidden] {
  display: none;
}

.cart {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 20, 16, 0.62);
  backdrop-filter: blur(4px);
}

.cart-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-gold);
  background: var(--ivory);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.24);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-gold);
  padding: 20px 22px;
}

.cart-header h2 {
  font-size: 1.6rem;
}

.cart-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0;
}

.cart-close:hover {
  background: var(--cream-dark);
}

.cart-empty {
  margin: 0;
  padding: 48px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
}

.cart-empty[hidden] {
  display: none;
}

.cart-empty span {
  display: block;
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--gold);
}

.cart-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cart-body[hidden] {
  display: none;
}

.cart-items {
  margin: 0;
  padding: 8px 22px;
  list-style: none;
}

.cart-items:empty {
  padding: 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.cart-item-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line-gold);
  font-size: 1.05rem;
}

.cart-item-name {
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.35;
}

.cart-item-price {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  background: var(--cream);
  padding: 3px;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--emerald);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
}

.cart-qty button:hover {
  background: var(--ivory);
}

.cart-qty output {
  min-width: 22px;
  text-align: center;
  font-size: 0.94rem;
  font-weight: 600;
}

.cart-footer {
  border-top: 1px solid var(--line-gold);
  background: var(--cream);
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 1rem;
}

.cart-total strong {
  color: var(--emerald);
  font-size: 1.35rem;
  font-weight: 700;
}

.cart-note {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.cart-actions {
  display: grid;
  gap: 8px;
}

.cart-actions .button {
  width: 100%;
}

.button-ghost {
  background: transparent;
  border: 1.5px solid var(--line-gold);
  color: var(--emerald);
  box-shadow: none;
}

.button-ghost:hover {
  background: var(--soft-green);
  box-shadow: none;
}

.cart-clear {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Sarabun", sans-serif;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-clear:hover {
  color: var(--red);
}

body.cart-open {
  overflow: hidden;
}

/* Toast */
.toast[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 100;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  padding: 11px 22px;
  font-size: 0.9rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  animation: toast-in 0.22s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@media (max-width: 640px) {
  .cart {
    align-items: flex-end;
  }

  .cart-dialog {
    width: 100%;
    height: auto;
    max-height: 90vh;
    border-left: 0;
    border-top: 1px solid var(--line-gold);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .cart-fab {
    right: 14px;
    bottom: 14px;
  }

  .cart-fab-text {
    display: none;
  }

  .cart-actions .button {
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cart-fab,
  .add-to-cart,
  .toast {
    transition: none;
    animation: none;
  }
}

/* ── Checkout form ───────────────────────────── */
.cart-form[hidden] {
  display: none;
}

.cart-form {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line-gold);
  margin-top: 8px;
  padding: 20px 22px 4px;
}

.cart-form h3 {
  margin: 0;
  color: var(--emerald);
  font-size: 1.05rem;
}

.cart-field {
  display: grid;
  gap: 6px;
}

.cart-field > span {
  color: var(--ink-mid);
  font-size: 0.88rem;
  font-weight: 500;
}

.cart-field em {
  color: var(--red);
  font-style: normal;
}

.cart-field input,
.cart-field textarea {
  width: 100%;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--ink);
  padding: 11px 13px;
  font-family: "Sarabun", sans-serif;
  font-size: 0.96rem;
  line-height: 1.6;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.cart-field textarea {
  resize: vertical;
  min-height: 62px;
}

.cart-field input:focus,
.cart-field textarea:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--soft-green);
  outline: none;
}

.cart-field.is-invalid input,
.cart-field.is-invalid textarea {
  border-color: var(--red);
}

.cart-field-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cart-error[hidden] {
  display: none;
}

.cart-error {
  margin: 0;
  border-radius: var(--radius);
  background: rgba(184, 50, 50, 0.08);
  color: var(--red);
  padding: 10px 13px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.cart-footer[hidden] {
  display: none;
}

.button[aria-disabled="true"],
.button:disabled {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

/* Success panel */
.cart-success[hidden] {
  display: none;
}

.cart-success {
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 40px 26px;
}

.cart-success-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 0 6px;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--emerald);
  font-size: 1.9rem;
  line-height: 1;
}

.cart-success h3 {
  color: var(--emerald);
  font-size: 1.35rem;
}

.cart-success p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.cart-success-id strong {
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: 0.06em;
}

.cart-success .button {
  width: 100%;
  max-width: 300px;
}

.cart-success .button-line {
  margin-top: 12px;
}

/* ตอนเปิดตะกร้า ย้าย toast ขึ้นบน ไม่ให้ทับปุ่มยืนยันสั่งซื้อ */
body.cart-open .toast {
  top: 20px;
  bottom: auto;
}
