/*
 * theme.css — G-TECH COMPUTER.
 * Direction: a well-kept shop counter. Warm paper ground, ink text, one
 * confident royal-blue action colour, and a yellow price tag that every
 * product carries — the way a price card sits on a laptop in the shop window.
 * Archivo (wide, sturdy) for headings, IBM Plex Sans for reading, IBM Plex
 * Mono for product IDs and prices so "GT-1004" reads exactly over the phone.
 */

:root {
  --canvas: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #ecebe5;
  --border: #dedcd3;
  --border-strong: #a4a198;
  --ink: #14171c;
  --muted: #5a5e66;
  --accent: #1e44c7;
  --accent-hover: #1836a0;
  --accent-ink: #ffffff;
  --accent-text: #1c3fb8;
  --accent-strong: #15308f;
  --accent-soft: #e3e8fb;
  --accent-border: #b3c1f1;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #dcefe2;
  --success-strong: #12652f;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f7e8d6;
  --warning-strong: #8f4207;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #f6dede;
  --danger-strong: #a01818;
  --chart-1: #1e44c7;
  --chart-2: #d99a00;
  --chart-3: #15803d;
  --chart-4: #b91c1c;
  --chart-5: #0b5668;
  --chart-6: #6d4bb5;

  --x-tag: #ffd23f;
  --x-tag-ink: #14171c;
  --x-band: #12151a;
  --x-band-2: #1b1f26;
  --x-band-ink: #f2f3f5;
  --x-band-muted: #a9afba;

  --font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 800;
  --display-tracking: -0.025em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-input: 10px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-raised: 0 18px 40px rgba(0, 0, 0, 0.16);
  --shadow-btn: none;
  --btn-weight: 600;
}

html[data-theme="dark"] {
  --canvas: #0f1216;
  --surface: #171b21;
  --surface-2: #1f242c;
  --border: #2b313b;
  --border-strong: #4b5361;
  --ink: #eef0f3;
  --muted: #a0a7b3;
  --accent: #7593ff;
  --accent-hover: #93abff;
  --accent-ink: #0b0f1f;
  --accent-text: #93abff;
  --accent-strong: #c6d1ff;
  --accent-soft: #1b2446;
  --accent-border: #36457e;
  --success: #22a356;
  --success-ink: #06130b;
  --success-soft: #142b1d;
  --success-strong: #6fcf94;
  --warning: #d9822b;
  --warning-ink: #1a0e02;
  --warning-soft: #33230f;
  --warning-strong: #f0b072;
  --danger: #e0524f;
  --danger-ink: #1a0505;
  --danger-soft: #3a1818;
  --danger-strong: #f29b98;
  --chart-1: #7593ff;
  --chart-2: #ffd23f;
  --chart-3: #6fcf94;
  --chart-4: #f29b98;
  --chart-5: #5cc6db;
  --chart-6: #b9a1f0;

  --x-tag: #ffd23f;
  --x-tag-ink: #14171c;
  --x-band: #07090c;
  --x-band-2: #11151b;
  --x-band-ink: #eef0f3;
  --x-band-muted: #a0a7b3;
}

/*
 * app.css — G-TECH COMPUTER's own pieces: the bar, the price tag, the product
 * card, the dark bands, the photo uploader and the drag-to-sort states.
 * Tokens only.
 */

body { font-family: var(--font-body); }

/* ---- type -------------------------------------------------------------- */
.hero-title, .page-title, .section-title, .section-title-sm, .statement, .closing, .product-title, .brand-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-stretch: 112%;
}
.hero-title { @apply text-5xl leading-[0.98] md:text-7xl lg:text-[5.25rem]; }
.hero-title-sm { @apply text-4xl md:text-6xl; }
.page-title { @apply text-3xl leading-tight md:text-4xl; }
.section-title { @apply text-3xl leading-tight md:text-5xl; }
.section-title-sm { @apply text-2xl leading-tight md:text-3xl; }
.product-title { @apply text-3xl leading-tight md:text-4xl; }
.statement { @apply max-w-4xl text-4xl leading-[1.02] md:text-6xl; }
.closing { @apply max-w-5xl text-5xl leading-[0.98] md:text-7xl lg:text-8xl; }
.brand-name { @apply block truncate text-base leading-none md:text-lg; font-weight: 900; }
.caps { @apply text-xs font-semibold uppercase; letter-spacing: var(--eyebrow-tracking); }

/* The product ID: monospace, boxed, readable over the phone. */
.pid {
  @apply inline-flex items-center rounded-md border border-border bg-surface-2 px-1.5 py-0.5 text-xs font-semibold text-ink;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.pid-lg { @apply px-2 py-1 text-sm; }
.pid-dark { background: var(--x-band-2); color: var(--x-band-ink); border-color: color-mix(in srgb, var(--x-band-ink) 18%, transparent); }

/* ---- the yellow price tag ------------------------------------------------ */
.price-tag {
  @apply relative inline-flex h-8 shrink-0 items-center pl-5 pr-3 text-base font-semibold tabular-nums;
  font-family: var(--font-mono);
  background: var(--x-tag);
  color: var(--x-tag-ink);
  clip-path: polygon(0.75rem 0, 100% 0, 100% 100%, 0.75rem 100%, 0 50%);
  border-radius: 0 6px 6px 0;
}
.price-tag::before {
  content: "";
  @apply absolute left-2.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full;
  background: color-mix(in srgb, var(--x-tag-ink) 55%, transparent);
}
.price-tag-lg { @apply h-12 pl-7 pr-5 text-2xl md:text-3xl; clip-path: polygon(1.1rem 0, 100% 0, 100% 100%, 1.1rem 100%, 0 50%); }
.price-tag-lg::before { @apply left-3.5 size-2; }

/* ---- bars ------------------------------------------------------------------ */
.util-strip { background: var(--x-band); color: var(--x-band-ink); }
.util-strip a:hover { text-decoration: underline; text-underline-offset: 2px; }
.site-bar { @apply sticky top-0 z-30 border-b border-border bg-surface; }
.brand-mark {
  @apply grid size-10 shrink-0 place-items-center rounded-xl text-xl;
  font-family: var(--font-display);
  font-weight: 900;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--x-tag) 100%, transparent);
}
.admin-tag { @apply rounded-full; }
.search-input { @apply bg-surface-2; }
.rail-wrap { @apply border-b border-border bg-surface; }
.rail { @apply flex items-center gap-2 overflow-x-auto py-3; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .chip { @apply shrink-0; }
.chip-img { @apply size-5 rounded-full object-cover; }
.count-pill {
  @apply inline-grid h-5 min-w-5 place-items-center rounded-full px-1.5 text-xs font-bold tabular-nums;
  background: var(--danger); color: var(--danger-ink);
}
.count-pill-quiet { background: var(--surface-2); color: var(--muted); }

/* ---- grounds and bands ------------------------------------------------------ */
.hero-ground {
  @apply border-b border-border;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
}
.hero-photo { @apply rounded-3xl; box-shadow: var(--shadow-raised); }
.hero-search { @apply flex flex-col gap-2 sm:flex-row; }
.hero-search .input { @apply h-12 text-base; }

.band-dark { background: var(--x-band); color: var(--x-band-ink); }
.band-muted { color: var(--x-band-muted); }
.band-head { @apply mb-1 text-xs font-semibold uppercase; letter-spacing: var(--eyebrow-tracking); color: var(--x-band-muted); }
.band-link { @apply inline-flex items-center gap-2; color: var(--x-band-ink); }
.band-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.band-rule { border-top: 1px solid color-mix(in srgb, var(--x-band-ink) 12%, transparent); color: var(--x-band-muted); }

.step {
  @apply flex flex-col gap-3 rounded-2xl p-6;
  background: var(--x-band-2);
  border: 1px solid color-mix(in srgb, var(--x-band-ink) 10%, transparent);
}
.step-n { @apply grid size-11 place-items-center rounded-xl; background: var(--x-tag); color: var(--x-tag-ink); }
.step-title { @apply text-xl font-semibold; font-family: var(--font-display); font-stretch: 110%; }

/* ---- category tiles --------------------------------------------------------- */
.cat-tile { @apply relative block overflow-hidden no-underline; border-radius: var(--radius-card); }
.cat-tile .media { @apply rounded-none; }
.cat-tile img { @apply transition-transform duration-500; }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile-label {
  @apply absolute inset-x-0 bottom-0 flex flex-col gap-0.5 p-4 pt-12;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}
.cat-tile-name { @apply text-lg font-semibold leading-tight md:text-xl; color: white; font-family: var(--font-display); font-stretch: 110%; }
.cat-tile-count { @apply text-xs; color: rgba(255, 255, 255, 0.82); }

/* ---- the product card (store and admin share it) ----------------------------- */
.pcard {
  @apply relative flex min-w-0 flex-col overflow-hidden border border-border bg-surface transition-[box-shadow,transform,border-color] duration-200;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.pcard:hover { @apply border-border-strong; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08); }
.pcard-media { @apply rounded-none; }
.pcard-media img { @apply transition-transform duration-500; }
.pcard:hover .pcard-media img { transform: scale(1.03); }
.pcard-noimg { @apply flex size-full flex-col items-center justify-center gap-2 text-sm text-muted; }
.pcard-noimg .icon { @apply size-7; }
.pcard-flags { @apply pointer-events-none absolute left-3 top-3 flex items-center gap-1.5; }
.pcard-flags .badge { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.pcard-body { @apply flex flex-1 flex-col gap-1.5 p-3 md:p-4; }
.pcard-title { @apply line-clamp-2 text-sm font-semibold leading-snug md:text-base; }
.pcard-title a { color: inherit; }
.pcard-title a::after { content: ""; @apply absolute inset-0; }
.pcard-sum { @apply hidden text-sm leading-snug text-muted sm:line-clamp-2; }
.pcard-admin { @apply relative z-[2] flex items-center gap-2 border-t border-border bg-surface-2 p-3; }
.pcard-del:hover { color: var(--danger-strong); background: var(--danger-soft); }
.pcard.is-off .pcard-media img { filter: grayscale(0.7); opacity: 0.75; }
.pcard-handle {
  @apply absolute right-3 top-3 z-[3] grid size-9 cursor-grab place-items-center rounded-lg border border-border bg-surface text-ink;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  touch-action: none;
}
.pcard-handle:active { cursor: grabbing; }

/* drag-to-sort states */
[data-sort-item].is-dragging {
  @apply z-10;
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  opacity: 0.85;
  transform: scale(0.98);
}
html.is-sorting, html.is-sorting * { cursor: grabbing !important; user-select: none; }

/* ---- product page -------------------------------------------------------------- */
.product-photo { @apply rounded-2xl border border-border bg-surface; }
.product-photo img { @apply object-contain; background: var(--surface); }
.thumbs { @apply grid grid-cols-5 gap-2 sm:grid-cols-6; }
.thumb { @apply relative aspect-square overflow-hidden rounded-lg border-2 border-transparent bg-surface-2 transition-colors; }
.thumb img { @apply size-full object-cover; }
.thumb.is-active { border-color: var(--accent); }
.thumb:hover { @apply border-border-strong; }
.buy-box { @apply flex flex-col gap-3 rounded-2xl border border-accent-border bg-accent-soft p-5 text-accent-strong; }
.buy-box .btn-outline { @apply bg-surface; }
.btn-wa { background: var(--success); border-color: var(--success); color: var(--success-ink); }
.btn-wa:hover { background: var(--success-strong); border-color: var(--success-strong); color: var(--success-ink); }
html[data-theme="dark"] .btn-wa:hover { color: var(--canvas); }
.save-btn[aria-pressed="true"] { color: var(--danger-strong); }
.save-btn[aria-pressed="true"] .icon { fill: currentColor; }
.spec-list { @apply overflow-hidden rounded-xl border border-border bg-surface; }
.spec-row { @apply grid grid-cols-[minmax(7rem,38%)_1fr] gap-3 border-b border-border px-4 py-3 text-sm; }
.spec-row:last-child { @apply border-b-0; }
.spec-row dt { @apply font-medium text-muted; }
.spec-row.spec-note { @apply grid-cols-1; }
.crumbs a { @apply text-muted hover:text-ink; }
.map-frame iframe { @apply block size-full border-0; }

/* ---- admin -------------------------------------------------------------------------- */
.stat { @apply flex flex-col gap-1 no-underline; }
a.stat:hover { @apply border-border-strong; }
.stat-ic { @apply mb-2 grid size-10 place-items-center rounded-xl bg-accent-soft text-accent-strong; }
.stat-ic.is-hot { background: var(--danger-soft); color: var(--danger-strong); }
.stat-value { @apply text-3xl tabular-nums md:text-4xl; font-family: var(--font-display); font-weight: 800; font-stretch: 110%; }
.guide { @apply mt-4 flex flex-col gap-4; }
.guide li { @apply flex gap-3; }
.guide-n { @apply grid size-8 shrink-0 place-items-center rounded-full text-sm font-bold; background: var(--x-tag); color: var(--x-tag-ink); }
.enq-product { @apply flex min-w-0 items-center gap-2 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm font-medium text-ink; }
.enq-product:hover { @apply border-border-strong no-underline; }
.is-done { opacity: 0.78; }
.role-select { @apply h-9 w-36 text-sm; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.save-bar { @apply flex items-center gap-3 rounded-2xl border border-border bg-surface p-3; box-shadow: var(--shadow-raised); }
@media (width < 64rem) {
  form[data-preview-form] .save-bar { @apply sticky bottom-3 z-20; }
}

/* option cards (condition, visibility) */
.opt { @apply block cursor-pointer; }
.opt-box {
  @apply flex h-full flex-col gap-0.5 rounded-xl border border-border-strong bg-surface px-3 py-3 transition-colors;
}
.opt:hover .opt-box { @apply border-ink; }
.opt input:checked + .opt-box { @apply border-accent bg-accent-soft text-accent-strong; box-shadow: inset 0 0 0 1px var(--accent); }
.opt input:checked + .opt-box .text-muted { color: var(--accent-strong); }
.opt input:focus-visible + .opt-box { box-shadow: var(--ring); }

/* the photo uploader */
.gallery { @apply mb-4 grid grid-cols-3 gap-3 empty:hidden sm:grid-cols-4 md:grid-cols-5; }
.gallery-single { @apply grid-cols-2 sm:grid-cols-3; }
.g-tile {
  @apply relative aspect-square cursor-grab overflow-hidden rounded-xl border border-border bg-surface-2;
  touch-action: none;
}
.g-tile img { @apply pointer-events-none size-full object-cover select-none; }
.g-cover {
  @apply absolute bottom-2 left-2 hidden rounded-md px-1.5 py-0.5 text-xs font-bold;
  background: var(--x-tag); color: var(--x-tag-ink);
}
.g-tile:first-child .g-cover { @apply inline-flex; }
.g-remove {
  @apply absolute right-1.5 top-1.5 grid size-8 place-items-center rounded-full;
  background: rgba(0, 0, 0, 0.6); color: white;
}
.g-remove:hover { background: var(--danger); color: var(--danger-ink); }
.g-tile.is-uploading { @apply grid cursor-wait place-items-center; }
.dropzone {
  @apply flex cursor-pointer flex-col items-center gap-1.5 rounded-2xl border-2 border-dashed border-border-strong bg-surface-2 px-6 py-8 text-center transition-colors;
}
.dropzone:hover, .dropzone.is-over { @apply border-accent bg-accent-soft; }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone-ic { @apply mb-1 grid size-12 place-items-center rounded-full bg-surface text-accent-text; }
.dropzone-ic .icon { @apply size-6; }
.dropzone-status:empty { display: none; }

/* ---- the one moment that moves: category tiles rise in -------------------------- */
@keyframes tile-rise { from { transform: translateY(18px); } to { transform: none; } }
[data-rise].is-in > * { animation: tile-rise 520ms var(--ease-out, cubic-bezier(0.2, 0.8, 0.2, 1)) both; }
[data-rise].is-in > *:nth-child(2) { animation-delay: 60ms; }
[data-rise].is-in > *:nth-child(3) { animation-delay: 120ms; }
[data-rise].is-in > *:nth-child(4) { animation-delay: 180ms; }
[data-rise].is-in > *:nth-child(5) { animation-delay: 240ms; }
[data-rise].is-in > *:nth-child(n + 6) { animation-delay: 300ms; }
html.reduced-motion [data-rise].is-in > * { animation: none; }
