@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+Thai:wght@400;500;600;700&display=swap');

:root {
  --product-img-bg: 220 10% 96%;
  --background: 0 0% 4%;
  --foreground: 0 0% 96%;
  --card: 0 0% 8%;
  --card-foreground: 0 0% 100%;
  --primary: 22 100% 50%;
  --primary-foreground: 0 0% 100%;
  --secondary: 52 100% 50%;
  --secondary-foreground: 0 0% 34%;
  --muted: 0 0% 10%;
  --muted-foreground: 0 0% 53%;
  --accent: 202 100% 50%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --success: 160 84% 39%;
  --border: 0 0% 16%;
  --input: 0 0% 16%;
  --ring: 22 100% 50%;

  --font-sans: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, "Courier New", monospace;
  --font-heading: "Space Grotesk", "IBM Plex Sans Thai", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, monospace;

  --radius: 0.5rem;
  --radius-button: calc(var(--radius) - 2px);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading) !important;
  margin: 0;
}

p { margin: 0; }

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

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

ul, ol { list-style: none; margin: 0; padding: 0; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}
.brand img {
  height: 26px;
  width: auto;
  object-fit: contain;
}
.brand .wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: hsl(var(--foreground));
  white-space: nowrap;
}
.main-nav {
  display: none;
  align-items: center;
  gap: 32px;
}
.main-nav a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: hsl(var(--foreground) / 0.75);
  transition: color 0.15s;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: hsl(var(--primary));
  transition: width 0.2s;
}
.main-nav a:hover { color: hsl(var(--foreground)); }
.main-nav a:hover::after { width: 100%; }
.main-nav a.active { color: hsl(var(--primary)); }

.header-actions {
  display: none;
  align-items: center;
  gap: 16px;
}
.header-actions a.account-link, .header-actions a.store-link, .header-actions a.admin-link {
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.6);
}
.cart-link {
  position: relative;
  padding: 8px;
  color: hsl(var(--foreground) / 0.75);
  display: inline-flex;
}
.cart-link svg { width: 20px; height: 20px; }
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.btn-shop-now {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: var(--radius-button);
  transition: opacity 0.15s;
  display: inline-block;
}
.btn-shop-now:hover { opacity: 0.9; }

/* EN | TH language switch (partials.js langSwitchHTML) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switch a, .lang-switch span {
  padding: 4px 9px;
  border-radius: 999px;
  line-height: 1.2;
}
.lang-switch a { color: hsl(var(--foreground) / 0.6); transition: color 0.15s; }
.lang-switch a:hover { color: hsl(var(--foreground)); }
.lang-switch span[aria-current] { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: hsl(var(--foreground));
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  border-bottom: 1px solid transparent;
  background: hsl(var(--background));
  transition: max-height 0.25s ease, border-color 0.25s ease;
}
.mobile-nav.open { max-height: 320px; border-bottom-color: hsl(var(--border)); }
.mobile-nav a {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground) / 0.85);
  transition: color 0.15s, background-color 0.15s;
}
.mobile-nav a:hover, .mobile-nav a:active { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mobile-nav a.active { color: hsl(var(--primary)); }
.header-actions a.admin-link, .mobile-nav a.admin-link { color: hsl(var(--primary)); }

@media (min-width: 768px) {
  .main-nav { display: flex; }
  .header-actions { display: flex; }
  /* Hide the whole group: an empty flex item would still take the last slot of space-between. */
  .mobile-actions { display: none; }
  .mobile-nav { display: none !important; }
}
@media (max-width: 767px) {
  .mobile-actions .cart-link { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  border-radius: var(--radius-button);
  transition: all 0.15s;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground) / 0.75);
  font-weight: 500;
}
.btn-outline:hover { border-color: hsl(var(--primary)); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
}
.hero-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.hero-copy { padding: var(--space-6) 0 var(--space-5); }
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 24px;
}
.hero h1 .accent { color: hsl(var(--primary)); }
.hero p.lede {
  font-size: 17px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  margin-bottom: 40px;
  max-width: 480px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }

/* Hero slideshow: square photos crossfade; dots jump to a slide (index.html script) */
.hero-media { margin-bottom: var(--space-5); }
.hero-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: var(--space-2);
}
.hero-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hero-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--foreground) / 0.45);
  transition: background 0.2s, transform 0.2s;
}
.hero-dot[aria-current="true"]::before { background: hsl(var(--primary)); transform: scale(1.25); }
.hero-dot:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 0; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; align-items: center; }
  .hero-copy { padding: 80px 64px 80px 0; }
  .hero-copy .eyebrow { margin-bottom: 32px; }
  .hero h1 { font-size: 64px; margin-bottom: 32px; }
  .hero p.lede { line-height: 1.75; margin-bottom: 48px; }
  /* Photo a little smaller than its half so it sits level with the copy block */
  .hero-media { margin: 48px 0; width: 100%; max-width: 520px; justify-self: end; position: relative; }
  .hero-dots { position: absolute; top: 100%; left: 0; right: 0; }
}
@media (min-width: 1280px) {
  .hero h1 { font-size: 72px; }
}

/* ---------- Capability strip ---------- */
.strip {
  background: hsl(var(--muted));
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  overflow: hidden;
}
.strip-inner {
  padding: 20px 24px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  row-gap: 12px;
}
.strip-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: hsl(var(--foreground) / 0.8);
  white-space: nowrap;
}
.strip-dot {
  margin: 0 20px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: hsl(var(--primary));
  flex-shrink: 0;
}
.strip-item:last-child .strip-dot { display: none; }

/* ---------- Section headers ---------- */
.section { padding: 56px 0; }
.section.border-top { border-top: 1px solid hsl(var(--border)); }
@media (min-width: 768px) { .section { padding: 96px 0; } }
.section-head {
  margin-bottom: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section h2 {
  font-size: 32px;
  font-weight: 700;
}
.view-all {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.6);
}
@media (min-width: 768px) {
  .section h2 { font-size: 36px; }
  .view-all { display: inline-flex; }
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: hsl(var(--border));
}
@media (min-width: 640px) { .product-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: 1fr 1fr 1fr; } }

.product-card {
  background: hsl(var(--card));
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px hsl(0 0% 0% / 0.4); }
.product-thumb {
  position: relative;
  aspect-ratio: 1/1;
  background: hsl(var(--product-img-bg));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-thumb svg {
  width: 46%;
  height: 46%;
  transition: transform 0.3s;
}
.product-card:hover .product-thumb svg { transform: scale(1.08); }
.product-body { padding: 20px; }
.product-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.product-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: hsl(var(--card-foreground));
  margin-bottom: 4px;
}
.product-material {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
}
.product-price {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--primary));
  white-space: nowrap;
}
.product-underline {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 0;
  background: hsl(var(--primary));
  transition: width 0.2s;
}
.product-card:hover .product-underline { width: 100%; }

/* ---------- Differentiators ---------- */
.diff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: hsl(var(--border));
}
@media (min-width: 768px) { .diff-grid { grid-template-columns: 1fr 1fr 1fr; } }
/* Text lines up with the section heading: no outer indent, only side padding between columns. */
.diff-card { background: hsl(var(--muted)); padding: 24px 0; }
.diff-card:first-child { padding-top: 0; }
@media (min-width: 768px) {
  .diff-card { padding: 4px 32px; }
  .diff-card:first-child { padding-left: 0; }
  .diff-card:last-child { padding-right: 0; }
}
.diff-number {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: hsl(var(--primary));
  margin-bottom: 24px;
}
.diff-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.diff-card p { font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }

/* ---------- Our work gallery (home) ---------- */
.work-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.work-grid li {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.work-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 768px) { .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); } }
@media (min-width: 1024px) { .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- CTA ---------- */
.cta-block { max-width: 640px; }
.cta-block h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}
.cta-block p { font-size: 16px; color: hsl(var(--muted-foreground)); margin-bottom: 40px; }
@media (min-width: 768px) { .cta-block h2 { font-size: 48px; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand a.logo-lockup { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-brand a.logo-lockup img { height: 24px; width: auto; }
.footer-brand a.logo-lockup .wordmark { font-family: var(--font-heading); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; color: hsl(var(--foreground)); }
.footer-brand p { font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); max-width: 320px; }
.footer-brand p + p { margin-top: 8px; }
.footer-brand .tag { margin-top: 16px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.footer-col p.head {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  margin-bottom: 16px;
}
.footer-col nav { display: flex; flex-direction: column; gap: 12px; }
.footer-col nav a { font-size: 14px; color: hsl(var(--muted-foreground)); transition: color 0.15s; }
.footer-col nav a:hover { color: #fff; }
.footer-social a { display: inline-flex; align-items: center; gap: 10px; }
.footer-social svg { width: 18px; height: 18px; flex-shrink: 0; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-bottom p { font-size: 12px; color: hsl(var(--muted-foreground)); }
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { font-size: 12px; color: hsl(var(--muted-foreground)); transition: color 0.15s; }
.footer-legal a:hover { color: #fff; }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; align-items: center; } }

/* ---------- Generic page header (non-home pages) ---------- */
.page-hero {
  padding: 48px 0 var(--space-5);
  border-bottom: 1px solid hsl(var(--border));
}
.page-hero .eyebrow { margin-bottom: 16px; }
.page-hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 16px; }
.page-hero p { font-size: 16px; color: hsl(var(--muted-foreground)); max-width: 560px; line-height: 1.6; }
@media (min-width: 768px) { .page-hero { padding: 80px 0 var(--space-6); } .page-hero h1 { font-size: 52px; } }
/* Shop: category chips live in the hero, so trim the gaps around them */
.shop-hero { padding-bottom: var(--space-4); }
.shop-hero .filter-bar { margin: var(--space-4) 0 0; }
.shop-section { padding-top: var(--space-5); }
@media (min-width: 768px) { .shop-hero { padding: 56px 0 var(--space-5); } .shop-section { padding-top: var(--space-5); } }

/* ---------- Filter bar (shop) ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.filter-chip {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  color: hsl(var(--foreground) / 0.7);
  background: transparent;
  transition: all 0.15s;
}
.filter-chip:hover { border-color: hsl(var(--primary)); }
.filter-chip.active {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 64px 0;
}
/* min-width: 0 lets a long thumbnail strip scroll inside its column instead of widening the page */
.product-detail > * { min-width: 0; }
@media (min-width: 900px) { .product-detail { grid-template-columns: 1fr 1fr; gap: 64px; } }
.pd-image {
  aspect-ratio: 1/1;
  background: hsl(var(--product-img-bg));
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-image svg { width: 55%; height: 55%; }
/* Product gallery */
.pd-gallery { display: flex; flex-direction: column; gap: 12px; }
.pd-gallery .pd-image { position: relative; overflow: hidden; border-radius: var(--radius); }
.pd-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: hsl(var(--background) / 0.7); color: hsl(var(--foreground));
  font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.pd-nav:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.pd-prev { left: 12px; }
.pd-next { right: 12px; }
.pd-count {
  position: absolute; right: 12px; bottom: 12px;
  font-size: 12px; padding: 4px 8px; border-radius: 999px;
  background: hsl(var(--background) / 0.7); color: hsl(var(--foreground));
}
.pd-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pd-thumb {
  flex: none; width: 72px; height: 72px; padding: 0; border-radius: var(--radius-button);
  border: 2px solid transparent; background: hsl(var(--product-img-bg)); overflow: hidden;
  opacity: 0.6; transition: opacity 0.15s, border-color 0.15s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb:hover { opacity: 1; }
.pd-thumb.is-active { opacity: 1; border-color: hsl(var(--primary)); }
.pd-info .eyebrow { margin-bottom: 12px; }
.pd-info h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.pd-price { font-size: 24px; font-weight: 700; color: hsl(var(--primary)); margin-bottom: 24px; }
.pd-desc { font-size: 15px; line-height: 1.7; color: hsl(var(--muted-foreground)); margin-bottom: 32px; }
.pd-meta { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.pd-details { margin-top: 32px; padding-top: 32px; border-top: 1px solid hsl(var(--border)); }
.pd-meta-row { display: flex; justify-content: flex-start; gap: 24px; font-size: 13px; padding: 12px 0; border-bottom: 1px solid hsl(var(--border)); }
.pd-meta-row span:first-child { flex: none; width: 140px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.pd-meta-row span:last-child { text-align: left; }
.pd-meta-row ul { display: flex; flex-direction: column; gap: 4px; text-align: left; }
/* Multi-line specs (lists) always sit under their label; single values do so only on phones */
.pd-meta-row.pd-meta-stack { flex-direction: column; gap: 8px; }
@media (max-width: 480px) { .pd-meta-row { flex-direction: column; gap: 6px; } }
.pd-meta-row li::before, .pd-desc-list li::before { content: "•"; color: hsl(var(--primary)); margin-right: 8px; }
.pd-desc-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
/* Product options (variants) */
.pd-options { display: flex; flex-direction: column; gap: 24px; margin-bottom: 32px; }
.pd-option-name {
  font-family: var(--font-heading); font-size: 16px; font-weight: 600;
  margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px;
}
.pd-option-pick { font-family: var(--font-sans); font-size: 13px; font-weight: 400; color: hsl(var(--muted-foreground)); }
.pd-option.is-missing .pd-option-pick::before { content: "Choose one"; color: hsl(var(--destructive)); }
.pd-option-values { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-chip {
  min-width: 96px; padding: 13px 20px; font-size: 14px; font-family: inherit; text-align: center;
  border: 1.5px solid hsl(var(--border)); border-radius: var(--radius-button);
  background: transparent; color: hsl(var(--foreground) / 0.85);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pd-chip:hover { border-color: hsl(var(--primary) / 0.7); }
.pd-chip.is-selected { border-color: hsl(var(--primary)); background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); font-weight: 600; }
.pd-option.is-missing .pd-chip, .pd-option.is-missing .pd-swatch { border-color: hsl(var(--destructive) / 0.6); }
/* Colour groups: circular swatches */
.pd-option.is-swatch .pd-option-values { gap: 12px; }
.pd-swatch {
  width: 40px; height: 40px; padding: 3px; border-radius: 50%;
  border: 1.5px solid hsl(var(--border)); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}
.pd-swatch span { width: 100%; height: 100%; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px hsl(0 0% 0% / 0.25); }
.pd-swatch:hover { border-color: hsl(var(--primary) / 0.7); transform: scale(1.06); }
.pd-swatch.is-selected { border-color: hsl(var(--primary)); border-width: 2px; }
/* Variant with no stock for this value given the other choices (still clickable, shows "Sold out"). */
.pd-chip.is-unavailable { opacity: 0.45; text-decoration: line-through; border-style: dashed; }
.pd-swatch.is-unavailable { opacity: 0.35; }
#add-to-cart-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cart-item-options { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.order-line-options { display: block; font-size: 12px; color: hsl(var(--muted-foreground)); }
.pd-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qty-input {
  display: flex;
  align-items: center;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-button);
}
.qty-input button {
  background: none; border: none; color: hsl(var(--foreground)); width: 40px; height: 44px; font-size: 16px;
}
.qty-input input {
  width: 48px; text-align: center; background: none; border: none; color: hsl(var(--foreground));
  font-family: var(--font-sans); font-size: 14px;
}
.add-msg { font-size: 13px; color: hsl(var(--success)); display: none; margin-top: 12px; }
.add-msg.show { display: block; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 640px; }
@media (min-width: 640px) { .form-grid.two-col { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 500; color: hsl(var(--foreground) / 0.8); }
.field input, .field select, .field textarea {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-button);
  padding: 12px 14px;
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 14px;
}
.field input, .field select, .field textarea { transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.field-file {
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius-button);
  padding: 32px 16px;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  display: block;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.field-file:hover, .field-file.is-dragover { border-color: hsl(var(--primary)); background: hsl(var(--primary) / 0.05); }
.field-file:focus-within { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.field-file.has-file { border-style: solid; }
.field-file-name { margin-top: 12px; color: hsl(var(--foreground)); word-break: break-all; }
.field-file-name:empty { display: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.form-note { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 8px; }
.field input.is-invalid { border-color: hsl(var(--destructive)); }
.pw-rules { margin-top: 4px; }
.pw-rules-title { font-size: 13px; font-weight: 500; color: hsl(var(--foreground) / 0.8); margin-bottom: 8px; }
.pw-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-rules li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: hsl(var(--muted-foreground)); transition: color 0.15s; }
.pw-rule-mark {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid hsl(var(--border));
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.pw-rule-mark::after {
  content: ""; width: 5px; height: 9px; margin-top: -2px;
  border: solid transparent; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pw-rules li.is-ok { color: hsl(var(--success)); }
.pw-rules li.is-ok .pw-rule-mark { border-color: hsl(var(--success)); background: hsl(var(--success) / 0.12); }
.pw-rules li.is-ok .pw-rule-mark::after { border-color: hsl(var(--success)); }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid hsl(var(--border)); }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: hsl(var(--foreground));
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q .plus { font-size: 20px; color: hsl(var(--primary)); transition: transform 0.2s; flex-shrink: 0; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-a p { font-size: 14px; line-height: 1.7; color: hsl(var(--muted-foreground)); padding-bottom: 24px; max-width: 700px; }
.faq-item.open .faq-a { max-height: 300px; }

/* ---------- Cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; }
/* Mobile: thumb + name on the first row, qty / line total / remove on a full-width second row */
.cart-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px 16px; align-items: center; padding: 20px 0; border-bottom: 1px solid hsl(var(--border)); }
.cart-thumb { width: 64px; height: 64px; background: hsl(var(--product-img-bg)); display: flex; align-items: center; justify-content: center; }
.cart-thumb svg { width: 60%; height: 60%; }
.cart-item-name { font-family: var(--font-heading); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.cart-item-material { font-size: 12px; color: hsl(var(--muted-foreground)); }
.cart-item-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@media (min-width: 640px) {
  .cart-row { grid-template-columns: 64px 1fr auto; }
  .cart-item-actions { grid-column: auto; justify-content: flex-start; }
}
.cart-remove { font-size: 12px; color: hsl(var(--destructive)); background: none; border: none; }
.cart-summary { max-width: 360px; margin-left: auto; padding-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 14px; color: hsl(var(--muted-foreground)); }
.cart-summary-row.total { font-size: 18px; font-weight: 700; color: hsl(var(--foreground)); padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.cart-ship-note { font-size: 12px; color: hsl(var(--primary)); margin-top: -4px; }
.cart-ship-to { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.cart-ship-to select { flex: 1; min-width: 0; max-width: 220px; background: hsl(var(--card)); border: 1px solid hsl(var(--input)); border-radius: var(--radius-button); color: hsl(var(--foreground)); padding: 8px 12px; font-family: inherit; font-size: 14px; }
.cart-ship-to select:focus { outline: none; border-color: hsl(var(--ring)); }
.cart-duties-note { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: -4px; }
.empty-state { text-align: center; padding: 96px 0; color: hsl(var(--muted-foreground)); }
.empty-state p { margin-bottom: 24px; }

/* ---------- Materials table ---------- */
.materials-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: hsl(var(--border)); }
@media (min-width: 768px) { .materials-grid { grid-template-columns: 1fr 1fr; } }
.material-card { background: hsl(var(--muted)); padding: 28px; }
.material-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: hsl(var(--primary)); }
.material-card p { font-size: 14px; color: hsl(var(--muted-foreground)); line-height: 1.6; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }

/* ---------- Async status / loading ---------- */
.grid-status { color: hsl(var(--muted-foreground)); font-size: 14px; padding: 24px 0; }
/* Reserve space while async content loads so the footer does not jump (CLS) */
.product-detail, .product-grid { min-height: 320px; }

/* ---------- Product images (when real photos exist) ---------- */
.product-thumb img, .cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.pd-image img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- Legal pages (privacy.html / terms.html) ---------- */
.legal { max-width: 760px; font-size: 15px; line-height: 1.8; color: hsl(var(--muted-foreground)); }
.legal h2 { color: hsl(var(--foreground)); font-size: 20px; margin: var(--space-5) 0 var(--space-3); }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal ul { margin-bottom: var(--space-3); }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: var(--space-1); }
.legal a { color: hsl(var(--primary)); }
.legal .placeholder { color: hsl(var(--primary)); font-style: italic; }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 420px; margin: 0 auto; }
.auth-wrap .form-grid { max-width: 100%; }
.auth-alt { margin-top: 24px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.auth-alt a { color: hsl(var(--primary)); }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-button);
  transition: border-color 0.15s, background-color 0.15s;
}
.btn-google:hover { border-color: hsl(var(--foreground) / 0.4); background: hsl(var(--muted)); }
.btn-google:disabled { opacity: 0.6; cursor: default; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: hsl(var(--border));
}

/* ---------- Account / order history ---------- */
.account-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 40px; }
.order-card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.order-status { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.order-status.paid { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.order-status.fulfilled { background: hsl(var(--accent) / 0.15); color: hsl(var(--accent)); }
.order-status.cancelled { background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }
.order-status.low { background: hsl(var(--secondary) / 0.15); color: hsl(var(--secondary)); }
.order-line { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: hsl(var(--muted-foreground)); }
.order-total { display: flex; justify-content: space-between; font-weight: 600; margin-top: 12px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.order-address { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 24px; margin-top: 16px; font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.order-address strong { color: hsl(var(--foreground)); }

/* ---------- Admin dashboard (site/admin/) ---------- */
.admin-header .header-inner { flex-wrap: wrap; height: auto; min-height: 64px; padding-top: 8px; padding-bottom: 8px; row-gap: 4px; }
.admin-header .header-actions { display: flex; }
.admin-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: hsl(var(--primary)); border: 1px solid hsl(var(--primary) / 0.5); border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.admin-nav { display: flex; gap: var(--space-4); order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
.admin-nav a { font-size: 14px; font-weight: 500; color: hsl(var(--foreground) / 0.75); white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; }
.admin-nav a:hover { color: hsl(var(--foreground)); }
.admin-nav a.active { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); }
@media (min-width: 900px) {
  .admin-header .header-inner { flex-wrap: nowrap; }
  .admin-nav { order: 0; width: auto; overflow: visible; padding-bottom: 0; }
}
.btn-sm { padding: 8px 14px; font-size: 13px; }

.admin-page { padding: var(--space-5) 0 var(--space-6); }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.admin-head h1 { font-size: 28px; font-weight: 700; }
.admin-head .grid-status { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-bottom: var(--space-5); }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { display: block; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: var(--space-4); text-decoration: none; color: inherit; transition: border-color 0.15s; }
.stat-card:hover { border-color: hsl(var(--primary)); }
.stat-card .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: hsl(var(--muted-foreground)); margin-bottom: 8px; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 32px; font-weight: 700; line-height: 1; }
.stat-card .stat-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 8px; }
#visit-stats .stat-card:hover { border-color: hsl(var(--border)); }

/* Admin analytics (Overview → Visitors) */
.an-panel { position: relative; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: var(--space-4); margin-bottom: var(--space-3); min-width: 0; }
.an-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-3); }
.an-panel-head h3 { font-size: 16px; font-weight: 600; }
.an-panel .muted { font-size: 12px; color: hsl(var(--muted-foreground)); }
.an-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-bottom: var(--space-5); }
.an-grid .an-panel { margin-bottom: 0; }
@media (min-width: 1024px) { .an-grid { grid-template-columns: 3fr 2fr; } }
/* 30 daily columns: 2px gap between bars, 4px rounded tops anchored to the baseline */
.an-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid hsl(var(--border)); }
.an-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; background: none; cursor: default; }
.an-col-bar { display: block; width: 100%; background: hsl(var(--primary)); border-radius: 4px 4px 0 0; transition: opacity 0.15s; }
.an-chart:hover .an-col-bar { opacity: 0.45; }
.an-chart .an-col:hover .an-col-bar, .an-col:focus-visible .an-col-bar { opacity: 1; }
.an-col:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }
.an-axis { display: flex; justify-content: space-between; font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 8px; }
.an-tip { position: absolute; top: 44px; transform: translateX(-50%); background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-button); padding: 8px 12px; font-size: 12px; line-height: 1.5; white-space: nowrap; pointer-events: none; z-index: 2; }
.an-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.an-table th, .an-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid hsl(var(--border)); }
.an-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); font-weight: 500; }
.an-table th:first-child, .an-table td:first-child { padding-left: 0; }
.an-table tbody tr:last-child td { border-bottom: none; }
.an-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.an-table a:hover { color: hsl(var(--primary)); }
.an-bars { display: flex; flex-direction: column; gap: 10px; }
.an-bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.an-bar-label { color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-track { height: 8px; background: hsl(var(--muted)); border-radius: 4px; overflow: hidden; }
.an-bar-fill { display: block; height: 100%; background: hsl(var(--primary)); border-radius: 4px; }
.an-bar-value { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 479px) { .an-bar-row { grid-template-columns: 104px 1fr auto; gap: 8px; } }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); align-items: center; }
.admin-toolbar .field { flex-direction: row; align-items: center; gap: 8px; }
.admin-toolbar input, .admin-toolbar select { background: hsl(var(--card)); border: 1px solid hsl(var(--input)); border-radius: var(--radius-button); color: hsl(var(--foreground)); padding: 8px 12px; font-family: inherit; font-size: 14px; }
.admin-toolbar input:focus, .admin-toolbar select:focus { outline: none; border-color: hsl(var(--ring)); }
.filter-chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--foreground) / 0.75); cursor: pointer; font-family: inherit; }

.admin-table-wrap { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); font-weight: 500; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr { cursor: pointer; transition: background 0.1s; }
.admin-table tbody tr:hover { background: hsl(var(--muted)); }
.admin-table tbody tr.unread td:first-child { font-weight: 600; box-shadow: inset 3px 0 0 hsl(var(--primary)); }
.admin-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-table th.num { text-align: right; }
.admin-table .muted { color: hsl(var(--muted-foreground)); font-size: 13px; }
.admin-table select { background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: var(--radius-button); color: hsl(var(--foreground)); padding: 6px 8px; font-family: inherit; font-size: 13px; }
.admin-table .thumb { width: 44px; height: 44px; border-radius: var(--radius-button); background: hsl(var(--product-img-bg)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.admin-table .thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-table .thumb svg { width: 24px; height: 24px; }

/* Detail drawer (slides in from the right on wide screens, full width on mobile). */
.drawer-backdrop { position: fixed; inset: 0; background: hsl(0 0% 0% / 0.6); z-index: 90; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 560px; background: hsl(var(--background)); border-left: 1px solid hsl(var(--border)); z-index: 100; transform: translateX(100%); transition: transform 0.2s ease; overflow-y: auto; padding: var(--space-4); }
.drawer.open { transform: translateX(0); }
.drawer-backdrop.open { display: block; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.drawer-head h2 { font-size: 20px; font-weight: 700; }
.drawer-close { background: none; border: 1px solid hsl(var(--border)); color: hsl(var(--foreground)); border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; line-height: 1; }
.drawer .form-grid { max-width: none; }
.drawer .form-grid.two .field { min-width: 0; }
@media (min-width: 480px) { .drawer .form-grid.two { grid-template-columns: 1fr 1fr; } }
.drawer .form-grid.two .span-2 { grid-column: 1 / -1; }
.drawer-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid hsl(var(--border)); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; font-size: 14px; margin-bottom: var(--space-4); }
.kv dt { color: hsl(var(--muted-foreground)); }
.kv dd { margin: 0; word-break: break-word; }
.pre { white-space: pre-wrap; font-size: 14px; line-height: 1.6; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: var(--space-3); }
.btn-danger { background: transparent; color: hsl(var(--destructive)); border: 1px solid hsl(var(--destructive) / 0.5); }
.btn-danger:hover { background: hsl(var(--destructive) / 0.1); }

.admin-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: hsl(var(--card)); color: hsl(var(--foreground)); border: 1px solid hsl(var(--success)); border-radius: var(--radius); padding: 12px 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 200; }
.admin-toast.show { opacity: 1; transform: translate(-50%, 0); }
.admin-toast.error { border-color: hsl(var(--destructive)); }

/* ---------- Stock / sold out ---------- */
.product-thumb { position: relative; }
.sold-out-badge { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: hsl(var(--background) / 0.9); color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); }
.product-card.sold-out .product-thumb svg, .product-card.sold-out .product-thumb img { opacity: 0.35; }
.product-card.sold-out .product-price { color: hsl(var(--muted-foreground)); }
.pd-sold-out { cursor: not-allowed; opacity: 0.6; }
.pd-low-stock { color: hsl(var(--secondary)); margin-top: 12px; }
.cart-row.sold-out .cart-thumb, .cart-row.sold-out .qty-input, .cart-row.sold-out .product-price { opacity: 0.4; }
.cart-row.sold-out .qty-input button { pointer-events: none; }
.cart-stock-warn { color: hsl(var(--secondary)); margin-top: 4px; }
.cart-row.sold-out .cart-stock-warn { color: hsl(var(--destructive)); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Admin: product options editor */
/* Admin product options (Shopee-style groups) + variant price/stock table */
.opt-groups { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.opt-group { background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.opt-group-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.og-remove, .og-value-remove { background: none; border: 0; color: hsl(var(--muted-foreground)); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.og-remove:hover, .og-value-remove:hover { color: hsl(var(--destructive)); }
.og-name { width: 100%; max-width: 320px; }
.og-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.og-value-row { display: flex; align-items: center; gap: 4px; }
.og-value-row input { flex: 1; min-width: 0; }
.variant-block { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.variant-title { font-weight: 700; margin: 0; }
.variant-bulk { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; }
.variant-bulk input { min-width: 0; }
.variant-scroll { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
.variant-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.variant-table th, .variant-table td { padding: 8px; border-bottom: 1px solid hsl(var(--border)); text-align: left; white-space: nowrap; }
.variant-table th { font-weight: 600; background: hsl(var(--muted)); }
.variant-table td.v-group { border-right: 1px solid hsl(var(--border)); vertical-align: middle; font-weight: 600; }
.variant-table input { width: 100%; min-width: 90px; }
.variant-table .req { color: hsl(var(--destructive)); }
.variant-table tr.is-invalid input { border-color: hsl(var(--destructive)); }
@media (max-width: 640px) { .variant-bulk { grid-template-columns: 1fr 1fr; } }

/* Admin product gallery editor */
.gallery-edit { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.gallery-item { position: relative; width: 96px; height: 96px; border-radius: var(--radius); background: hsl(var(--product-img-bg)); overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item.empty svg { width: 40px; height: 40px; }
.gallery-main, .gallery-new { position: absolute; top: 4px; font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 999px; color: #fff; }
.gallery-main { left: 4px; background: hsl(var(--primary)); }
.gallery-new { right: 4px; background: hsl(0 0% 0% / 0.65); }
.gallery-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; background: hsl(0 0% 0% / 0.6); }
.gallery-actions button { flex: 1; background: none; border: 0; color: #fff; font-size: 14px; padding: 4px 0; cursor: pointer; }
.gallery-actions button:hover:not(:disabled), .gallery-actions button:focus-visible { background: hsl(0 0% 100% / 0.18); }
.gallery-actions button:disabled { opacity: 0.3; cursor: default; }
@media (max-width: 480px) { .gallery-item { width: 84px; height: 84px; } }

/* Admin settings (store_settings editor) */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); max-width: 720px; }
.settings-card { min-width: 0; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: var(--space-4); display: flex; flex-direction: column; gap: 16px; }
.settings-card .field input { min-width: 0; width: 100%; }
.settings-card h2 { font-size: 20px; font-weight: 700; margin: 0; }
.settings-card .hint { font-size: 13px; color: hsl(var(--muted-foreground)); margin: 0; }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.settings-preview { background: hsl(var(--muted)); border-radius: var(--radius-button); padding: 10px 12px; font-size: 14px; margin: 0; }
.settings-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-foot .hint { margin-right: auto; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 6px; }
.settings-warn { background: hsl(var(--primary) / 0.12); border: 1px solid hsl(var(--primary) / 0.4); border-radius: var(--radius-button); padding: 10px 12px; font-size: 13px; margin: 0; }
.settings-warn[hidden] { display: none; }
.zone-list { display: flex; flex-direction: column; gap: 12px; }
.zone-row { border: 1px solid hsl(var(--border)); border-radius: var(--radius-button); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.zone-head { display: flex; align-items: flex-end; gap: 12px; }
.zone-head strong { margin-right: auto; align-self: center; }
.zone-fee { width: 140px; }
.zone-row .field input { min-width: 0; width: 100%; }
.cat-row input, .cat-add input { flex: 1; min-width: 0; background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: var(--radius-button); color: hsl(var(--foreground)); padding: 8px 12px; font-family: inherit; font-size: 14px; }
.cat-row input:focus, .cat-add input:focus { outline: none; border-color: hsl(var(--ring)); }
.cat-row input.is-invalid, .cat-add input.is-invalid { border-color: hsl(var(--destructive)); }
.cat-count { font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; min-width: 72px; text-align: right; }
.cat-btn { background: none; border: 1px solid hsl(var(--border)); border-radius: var(--radius-button); color: hsl(var(--foreground)); width: 32px; height: 32px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.cat-btn:hover:not(:disabled) { border-color: hsl(var(--primary)); }
.cat-btn.remove:hover { color: hsl(var(--destructive)); border-color: hsl(var(--destructive)); }
.cat-btn:disabled { opacity: 0.3; cursor: default; }
.cat-add { display: flex; gap: 8px; }
@media (max-width: 480px) {
  .settings-row { grid-template-columns: minmax(0, 1fr); }
  .cat-count { min-width: 0; }
  .cat-count-word { display: none; }
  .cat-btn { width: 28px; }
}

/* ---------- Thai pages (/th/) ---------- */
/* Letter-spacing pulls Thai vowel and tone marks away from their consonants; Thai text also
   needs a little more line height than the Latin type scale. The wordmark stays as designed. */
html[lang="th"] body *:not(.wordmark) { letter-spacing: normal; }
html[lang="th"] body { line-height: 1.7; }
/* Thai tone marks sit above and vowels below the line, so tight Latin heading line-heights
   (hero h1 is 1.05) make the lines touch. */
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { line-height: 1.4; }
