/* Self-hosted fonts (subset to the latin + khmer ranges this site actually
   uses — en/km only). Each is the variable-weight file, so one file per
   family/style covers every weight the CSS asks for. Source Sans 3 and Noto
   Sans Khmer are preloaded in <head> since they're the default body font for
   the two supported languages; Pacifico/Metal are footer-only accents and
   load lazily. */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Sans Khmer";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/noto-sans-khmer-khmer.woff2") format("woff2");
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Pacifico";
  font-style: normal;
  font-weight: 400;
  /* swap, not optional — these aren't preloaded, so `optional` misses its
     ~100ms window on a cold cache and the fallback sticks for the whole view */
  font-display: swap;
  src: url("/fonts/pacifico-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Metal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/metal-khmer.woff2") format("woff2");
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

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

/* ── Design tokens ─────────────────────────────────────────────────
   Single source of truth for color, status, and radius. Pages should
   reference these vars rather than hardcoding hex values. */
:root {
  /* Brand / actions */
  --primary: #cc8a6c;
  --primary-hover: #b06f52;
  --primary-rgb:
    204, 138, 108; /* keep in sync with --primary, for tinted shadows/overlays */

  /* Text */
  --text: #111;
  --text-soft: #374151;
  --text-muted: #6b7280;

  /* Surfaces */
  --surface: #fff;
  --bg: #f9f9f9;
  --bg-subtle: #f5f5f5;

  /* Borders */
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --divider: #f0f0f0;

  /* Status */
  --success-bg: #e6f4ea;
  --success-fg: #1e7e34;
  --error-bg: #fdecea;
  --error-fg: #c0392b;

  /* Radius */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Footer — terracotta top into warm charcoal */
  --footer-top: var(--primary);
  --footer-bottom: #333;

  /* Engraved footer text — matches the logo ink (#4a4a4a) */
  --footer-ink: #4a4a4a;
  --footer-ink-rgb: 74, 74, 74;

  /* Signature / script accent — swap the first name to restyle */
  --font-script: "Pacifico", cursive;
  --font-script-km: "Metal", cursive;

  /* Dropdown chevron — the native select arrow is replaced site-wide so its
     distance from the right edge is ours to control. Change it here and every
     dropdown follows. */
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  --select-arrow-muted: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  --select-arrow-inset: 0.75rem; /* gap between the chevron and the right edge */
}

body {
  font-family: "Source Sans 3", "Noto Sans Khmer", "Optima", "Candara", sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

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

/* ── Dropdowns ─────────────────────────────────────────────────────
   One look for every <select> on the site. Width is deliberately left
   out so pages can size their own (full-width forms vs. inline toolbar
   filters). Two rules for page CSS overriding anything here:
     • use `background-color`, never the `background` shorthand — the
       shorthand wipes out the chevron
     • if you change `padding`, keep room on the right for the chevron */
select {
  padding: 0.55rem 2.25rem 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background-color: var(--surface);
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right var(--select-arrow-inset) center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

select:focus {
  outline: none;
  border-color: var(--text-muted);
}

select:disabled {
  background-color: var(--bg-subtle);
  background-image: var(--select-arrow-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── Banner carousel ──────────────────────────────────────────── */
.banner-carousel {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  margin-bottom: 2rem;
  background: #1a1a1a;
}

.banner-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.banner-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.65s ease;
  display: block;
  text-decoration: none;
}

.banner-slide.active {
  opacity: 1;
}

.banner-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.15) 55%,
    transparent 100%
  );
}

.banner-text {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 2.5rem 2.5rem;
  z-index: 1;
  max-width: 560px;
}

.banner-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.banner-subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.1rem;
  margin: 0;
}

.banner-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.15s;
  padding: 0;
}
.banner-btn:hover {
  background: #fff;
}
.banner-btn--prev {
  left: 14px;
}
.banner-btn--next {
  right: 14px;
}

.banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.banner-dot.active {
  background: #fff;
}

@media (max-width: 600px) {
  .banner-carousel {
    height: 220px;
  }
  .banner-title {
    font-size: 1.3rem;
  }
  .banner-subtitle {
    font-size: 0.9rem;
  }
  .banner-text {
    padding: 1.25rem 1.25rem;
  }
}

/* Content column matches .header-inner exactly: 1200px box with 1.5rem side
   gutters, so page content always lines up with the header logo and nav */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
}

/* ── Flash sale price display ─────────────────────────────────────── */
.price-sale {
  color: #e53935;
  font-weight: 700;
}
.price-original {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.85em;
  margin-left: 0.35rem;
}

/* Real text that screen readers and search engines read, but that does not
   appear on screen. Used for page headings on layouts (the homepage, the
   product page) whose design has no room for a visible <h1>. Clipped rather
   than display:none — hidden elements are skipped by both. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Pill tabs ────────────────────────────────────────────────────────────
   One tab strip for all three portals: the vendor and admin subnavs and both
   second-level rows under them. Pills rather than underlines because pills
   wrap. An underline row seats its active border on the container's border by
   pulling itself down 2px, and the moment the strip runs to two lines that
   pull lands the underline on the row below — which six tabs do on any phone.
   Same shape at every width, so the navigation does not change as the window
   narrows. Change it here and every portal follows.

   Components set their own outer spacing: the two top-level subnavs sit in a
   wrapper that already has padding, the second-level rows sit inside <main>. */
.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.pill-tabs a {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: #fff;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
}

.pill-tabs a:hover {
  color: #111;
  border-color: var(--border-strong);
}

.pill-tabs a.active {
  background-color: #111;
  border-color: #111;
  color: #fff;
  font-weight: 600;
}
