/* KNT design system: tokens, base styles, header, footer and shared components.
   Used by every storefront page; page-only styles go in css/<page>.css.
   Palette "Clean Stainless"; every text/background pair meets WCAG AA. See docs/architecture.md. */

:root {
  --c-bg: #f7f9fb;
  --c-surface: #ffffff;
  --c-subtle: #f1f4f8;
  --c-text: #0f172a;
  --c-muted: #5b6678;
  --c-border: #e2e8f0;
  --c-input: #6b7686;
  --c-primary: #b91c1c;
  --c-primary-hover: #991b1b;
  --c-primary-tint: #fef2f2;
  --c-link: #1d4ed8;
  --c-link-hover: #1e3a8a;
  --c-price: #b91c1c;
  --c-ok: #15803d;
  --c-ok-bg: #dcfce7;
  --c-warn: #92400e;
  --c-warn-bg: #fef3c7;
  --c-error: #b91c1c;
  --c-error-bg: #fee2e2;
  --c-info: #1e3a8a;
  --c-info-bg: #e0e7ff;
  --c-line: #05843f;
  --c-line-hover: #046c34;
  --c-footer-bg: #0f172a;
  --c-footer-text: #cbd5e1;
  --c-footer-head: #ffffff;
  --c-footer-line: #1e293b;
  --font: "Prompt", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.16);
  --container: 1240px;
  --gutter: 24px;
  --header-h: 0px;
}

/* ---------- Base ---------- */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

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

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--c-link);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--c-link-hover);
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 600;
}

ul, ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--c-link);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Long content blocks per language */
html[lang="th"] [data-lang="en"],
html[lang="en"] [data-lang="th"] {
  display: none !important;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack > * + * { margin-top: var(--stack, 12px); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, 10px); align-items: center; }
.muted { color: var(--c-muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--c-text);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Page structure ---------- */

.section {
  padding-block: 36px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 24px;
}

.section-head a {
  font-weight: 500;
}

.page-head {
  padding-block: 24px 8px;
}

.page-title {
  font-size: 28px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding-top: 16px;
  font-size: 14px;
  color: var(--c-muted);
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--c-muted);
}

.breadcrumbs [aria-current] {
  color: var(--c-text);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--c-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--c-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--c-surface);
  border-color: var(--c-input);
  color: var(--c-text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--c-subtle);
  color: var(--c-text);
}

.btn-outline-primary {
  background: var(--c-primary-tint);
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.btn-outline-primary:hover:not(:disabled) {
  background: #fee2e2;
  color: var(--c-primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--c-link);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--c-subtle);
}

.btn-line {
  background: var(--c-line);
  color: #fff;
}

.btn-line:hover:not(:disabled) {
  background: var(--c-line-hover);
  color: #fff;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 17px;
}

.btn-block {
  width: 100%;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field + .field,
.field-row + .field,
.field + .field-row,
.field-row + .field-row {
  margin-top: 16px;
}

.field label,
.field .label,
.field legend {
  font-weight: 500;
  font-size: 15px;
}

.field .optional {
  font-weight: 400;
  color: var(--c-muted);
}

.field-hint {
  font-size: 14px;
  color: var(--c-muted);
}

.field-error {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-error);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.field-row > .field + .field {
  margin-top: 0;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--c-input);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--c-link);
  outline-offset: 0;
  border-color: var(--c-link);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border: 2px solid var(--c-error);
}

input[readonly] {
  background: var(--c-subtle);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--c-primary);
  flex: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding-block: 10px;
  cursor: pointer;
}

.check input {
  margin-top: 2px;
}

fieldset {
  border: 0;
  min-width: 0;
}

.choice-cards {
  display: grid;
  gap: 10px;
}

.choice-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--c-input);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border: 2px solid var(--c-primary);
  padding: 13px 15px;
  background: var(--c-primary-tint);
}

.choice-card:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.choice-card strong {
  display: block;
  font-weight: 500;
}

.choice-card small {
  display: block;
  color: var(--c-muted);
  font-size: 14px;
}

.error-summary {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 2px solid var(--c-error);
  border-radius: var(--radius);
  background: var(--c-surface);
}

.error-summary:focus {
  outline: 3px solid var(--c-link);
  outline-offset: 2px;
}

.error-summary h2 {
  margin-bottom: 8px;
  font-size: 17px;
  color: var(--c-error);
}

.error-summary ul {
  list-style: disc;
  padding-left: 20px;
}

.error-summary a {
  color: var(--c-error);
  font-weight: 500;
}

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--c-input);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.qty-stepper button {
  width: 44px;
  min-height: 44px;
  border: 0;
  background: var(--c-subtle);
  font-size: 20px;
  line-height: 1;
}

.qty-stepper button:hover:not(:disabled) {
  background: var(--c-border);
}

.qty-stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-stepper input {
  width: 64px !important;
  min-height: 44px;
  border: 0 !important;
  border-inline: 1px solid var(--c-border) !important;
  border-radius: 0 !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Feedback ---------- */

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 4px solid currentColor;
  font-size: 15px;
}

.alert-info { background: var(--c-info-bg); color: var(--c-info); }
.alert-success { background: var(--c-ok-bg); color: #166534; }
.alert-warn { background: var(--c-warn-bg); color: var(--c-warn); }
.alert-error { background: var(--c-error-bg); color: #991b1b; }

.alert a {
  color: inherit;
  font-weight: 500;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--c-muted);
}

.empty-state .btn {
  margin-top: 16px;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eef1f5 25%, #e4e8ee 50%, #eef1f5 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s infinite;
}

@keyframes skeleton {
  to { background-position: -200% 0; }
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--c-text);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 15px;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toast-action {
  flex: none;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font-weight: 600;
}

.toast-success { background: #14532d; }
.toast-error { background: #7f1d1d; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---------- Data display ---------- */

.card {
  padding: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

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

.table th {
  background: var(--c-subtle);
  font-weight: 500;
  font-size: 14px;
  color: var(--c-muted);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

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

.spec-table th {
  width: 35%;
  background: var(--c-subtle);
  font-weight: 500;
  color: var(--c-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c-subtle);
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.badge-primary { background: var(--c-primary); color: #fff; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip[data-status="placed"] { background: var(--c-warn-bg); color: var(--c-warn); }
.status-chip[data-status="awaiting_payment"] { background: #ffedd5; color: #9a3412; }
.status-chip[data-status="checking_payment"] { background: var(--c-info-bg); color: var(--c-info); }
.status-chip[data-status="paid"] { background: #e0f4f7; color: #0b5c6b; }
.status-chip[data-status="ready_for_pickup"] { background: #ede9fe; color: #5b21b6; }
.status-chip[data-status="completed"] { background: var(--c-ok-bg); color: #166534; }
.status-chip[data-status="cancelled"] { background: #e2e8f0; color: #334155; }
.status-chip[data-status="draft"] { background: var(--c-error-bg); color: var(--c-error); }

.availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.availability::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.availability[data-state="in_stock"] { color: var(--c-ok); }
.availability[data-state="low"] { color: #9a3412; }
.availability[data-state="out"] { color: var(--c-muted); }
.availability[data-state="ships_in"],
.availability[data-state="made_to_order"],
.availability[data-state="import"] { color: var(--c-info); }

/* ---------- Order timeline (order-status.timelineHtml) ---------- */

.timeline {
  display: grid;
  gap: 0;
}

.timeline-step {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 18px 30px;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--c-input);
  border-radius: 50%;
  background: var(--c-surface);
}

.timeline-step::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--c-border);
}

.timeline-step:last-child::after {
  display: none;
}

.timeline-step[data-state="done"]::before {
  border-color: var(--c-ok);
  background: var(--c-ok);
}

.timeline-step[data-state="current"]::before {
  border-color: var(--c-primary);
  background: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-tint);
}

.timeline-step[data-state="cancelled"]::before {
  border-color: #334155;
  background: #334155;
}

.timeline-step[data-state="upcoming"] .timeline-label {
  color: var(--c-muted);
}

.timeline-step[data-state="current"] .timeline-label {
  font-weight: 600;
}

.timeline-date,
.timeline-note {
  font-size: 13.5px;
  color: var(--c-muted);
}

/* ---------- Prices ---------- */

.price {
  color: var(--c-price);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-note {
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 400;
}

.price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.totals {
  display: grid;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.totals .totals-grand {
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
  font-size: 19px;
  font-weight: 600;
}

/* ---------- Product cards (catalog.productCardHtml) ---------- */

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

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow);
}

.product-card-media {
  position: relative;
  display: block;
  flex: none;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
}

/* Absolutely placed so a photo's own size can never stretch the square. */
.product-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
}

.product-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}

.product-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}

.product-card-cat {
  color: var(--c-muted);
  font-size: 13px;
}

.product-card-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.product-card-title a {
  color: var(--c-text);
  text-decoration: none;
}

.product-card-title a:hover {
  color: var(--c-link);
  text-decoration: underline;
}

.product-card-model {
  color: var(--c-muted);
  font-size: 13px;
}

.product-card .price {
  font-size: 19px;
}

.product-card-actions {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
}

.product-card-actions .btn {
  width: 100%;
}

/* ---------- Tabs ---------- */

.tabs [role="tablist"] {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
}

.tabs [role="tab"] {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--c-muted);
  font-weight: 500;
  white-space: nowrap;
}

.tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--c-primary);
  color: var(--c-text);
}

.tabs [role="tabpanel"] {
  padding-top: 18px;
}

/* ---------- Dialogs & drawers ---------- */

.dialog {
  width: min(92vw, 520px);
  max-height: 90vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 0;
}

.dialog-header h2 {
  font-size: 20px;
}

.dialog-body {
  padding: 16px 20px;
}

.dialog-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-text);
}

.icon-button:hover {
  background: var(--c-subtle);
}

.drawer {
  width: min(88vw, 380px);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0 auto 0 0;
  border-radius: 0;
}

/* ---------- Header: utility bar ---------- */

.site-header {
  position: relative;
  z-index: 50;
  background: var(--c-surface);
}

.utility-bar {
  background: var(--c-subtle);
  border-bottom: 1px solid var(--c-border);
  font-size: 13.5px;
}

.utility-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  min-height: 38px;
}

.utility-group {
  display: flex;
  align-items: center;
  gap: 4px 16px;
}

.utility-link,
.utility-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: #1e293b;
  text-decoration: none;
}

.utility-link:hover {
  color: var(--c-link);
  text-decoration: underline;
}

.utility-link .icon,
.utility-text .icon {
  width: 16px;
  height: 16px;
}

.line-link .icon {
  color: var(--c-line);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--c-muted);
}

.lang-switch button {
  min-height: 32px;
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #1e293b;
}

.lang-switch button[aria-pressed="true"] {
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.currency-select {
  width: auto !important;
  min-height: 32px !important;
  padding: 2px 8px !important;
  font-size: 13.5px !important;
}

/* ---------- Header: main bar ---------- */

.main-bar {
  border-bottom: 1px solid var(--c-border);
}

.main-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--c-text);
  text-decoration: none;
}

.brand:hover {
  color: var(--c-text);
}

.brand-logo {
  width: 56px;
  height: 56px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-size: 12.5px;
  color: var(--c-muted);
}

.header-search {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Product suggestions under the search box (js/search-suggest.js). */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 70;
  max-height: min(70vh, 470px);
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

.search-suggestions [role="option"] {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--c-text);
  cursor: pointer;
}

.search-suggestions [role="option"][aria-selected="true"] {
  background: var(--c-subtle);
}

.search-suggestions img {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

.suggest-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.suggest-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-model {
  color: var(--c-muted);
  font-size: 13px;
}

.suggest-price {
  flex: none;
  color: var(--c-price);
  font-size: 14px;
  font-weight: 600;
}

.search-suggestions .suggest-all {
  justify-content: center;
  color: var(--c-link);
  font-weight: 500;
}

.search-suggestions [role="option"] + .suggest-all {
  margin-top: 4px;
  border-top: 1px solid var(--c-border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.search-form {
  display: flex;
  height: 46px;
  border: 1px solid var(--c-input);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.search-form:focus-within {
  outline: 2px solid var(--c-link);
  outline-offset: 1px;
}

.search-form .search-category {
  width: auto;
  max-width: 170px;
  min-height: 0;
  border: 0;
  border-right: 1px solid var(--c-border);
  border-radius: 0;
  background: var(--c-subtle);
  font-size: 14px;
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  outline: none;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  border: 0;
  background: var(--c-primary);
  color: #fff;
}

.search-submit:hover {
  background: var(--c-primary-hover);
}

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

.header-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--c-text);
  font-size: 15px;
  text-decoration: none;
}

.header-action:hover {
  background: var(--c-subtle);
  color: var(--c-text);
}

.header-action .icon {
  width: 24px;
  height: 24px;
}

.header-action .icon-sm {
  width: 16px;
  height: 16px;
}

.header-action-label {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.account-menu {
  position: relative;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

.account-dropdown a,
.account-dropdown button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--c-text);
  text-align: left;
  text-decoration: none;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
  background: var(--c-subtle);
}

/* ---------- Header: category bar ---------- */

.category-bar {
  background: var(--c-subtle);
  border-bottom: 1px solid var(--c-border);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 6px;
}

.category-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-bottom: 3px solid transparent;
  color: #1e293b;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.category-link:hover,
.category-link[aria-current="page"] {
  border-bottom-color: var(--c-primary);
  color: var(--c-text);
}

/* ---------- Footer ---------- */

.back-to-top {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 40px;
  border: 0;
  background: #1e293b;
  color: #fff;
  font-size: 15px;
}

.back-to-top:hover {
  background: #334155;
}

.site-footer {
  background: var(--c-footer-bg);
  color: var(--c-footer-text);
  font-size: 15px;
}

.site-footer a {
  color: var(--c-footer-text);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
  padding-block: 40px;
}

.footer-name {
  margin-bottom: 12px;
  color: var(--c-footer-head);
  font-size: 18px;
  font-weight: 600;
}

.footer-contact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
}

.footer-contact dt {
  color: #94a3b8;
}

.footer-line {
  margin-top: 16px;
}

.site-footer .btn-line,
.site-footer .btn-line:hover {
  color: #fff;
  text-decoration: none;
}

.footer-heading {
  margin-bottom: 12px;
  color: var(--c-footer-head);
  font-size: 16px;
}

.footer-col li + li {
  margin-top: 8px;
}

.footer-legal {
  border-top: 1px solid var(--c-footer-line);
  font-size: 14px;
}

.legal-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  padding-block: 16px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.site-footer .link-button {
  color: var(--c-footer-text);
  font-size: 14px;
  text-decoration: none;
}

.site-footer .link-button:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Floating LINE button ---------- */

.line-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--c-line);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  text-decoration: none;
}

.line-float:hover {
  background: var(--c-line-hover);
  color: #fff;
}

.line-float .icon {
  width: 26px;
  height: 26px;
}

/* ---------- Compare (js/compare-store.js) ---------- */

.compare-toggle {
  min-height: 34px;
  color: var(--c-muted);
}

.compare-toggle[aria-pressed="true"] {
  border-color: var(--c-link);
  background: var(--c-info-bg);
  color: var(--c-link);
  font-weight: 600;
}

/* Bottom left, so the LINE button keeps the bottom right. */
.compare-tray {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 800;
  display: flex;
  align-items: center;
  max-width: calc(100% - 120px);
  border-radius: 999px;
  background: var(--c-text);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.compare-tray-go,
.compare-tray-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 6px 8px 18px;
  color: #fff;
  font-weight: 500;
}

.compare-tray-go {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compare-tray-go:hover {
  color: #fff;
  text-decoration-thickness: 2px;
}

.compare-tray-clear {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.compare-tray-clear:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1500;
  max-width: 760px;
  margin-inline: auto;
  padding: 18px 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

.cookie-banner h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.cookie-banner p {
  font-size: 15px;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cookie-actions .btn {
  flex: 1 1 160px;
}

.cookie-option {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--c-border);
}

.cookie-option:last-child {
  border-bottom: 0;
}

.cookie-option strong {
  display: block;
  font-weight: 500;
}

.cookie-desc {
  display: block;
  color: var(--c-muted);
  font-size: 14px;
}

label.cookie-option {
  cursor: pointer;
}

/* ---------- Phones & tablets ---------- */

@media (max-width: 1024px) {
  .hide-md { display: none !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --gutter: 16px; }
  .hide-sm { display: none !important; }
  .section { padding-block: 26px; }
  .page-title { font-size: 24px; }
  .section-head h2 { font-size: 21px; }

  .utility-inner { min-height: 36px; }
  .utility-group { gap: 4px 10px; }

  .main-inner {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding-block: 10px;
  }

  .brand-logo { width: 44px; height: 44px; }
  .brand-name { font-size: 16px; }
  .brand-tagline { display: none; }
  .header-actions { margin-left: auto; }
  .header-action { padding: 6px 8px; }
  .header-action .header-action-label { display: none; }
  .header-search { order: 3; flex-basis: 100%; }
  .search-form .search-category { max-width: 110px; }

  .category-list {
    flex-wrap: nowrap;
    justify-content: flex-start; /* centred overflow would hide the first links */
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card-body { padding: 10px; }
  .product-card .price { font-size: 17px; }
  .line-float { right: 14px; bottom: 14px; padding: 10px; }
  .line-float .line-float-text { display: none; }
  .compare-tray { bottom: 14px; left: 14px; max-width: calc(100% - 92px); font-size: 14px; }
  .compare-tray-go, .compare-tray-text { padding-left: 14px; }
  /* Above the product page's phone action bar. */
  body.has-buy-bar .compare-tray { bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */

@media print {
  site-header,
  site-footer,
  .line-float,
  .cookie-banner,
  .toast-region,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 12pt;
  }

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