/* ==================================================================
   MyUzyShop — Design system
   Tokens taken directly from the project documentation.
   ================================================================== */

:root {
  /* Brand palette */
  --blue:   #185FA5;
  --teal:   #1D9E75;
  --amber:  #BA7517;
  --danger: #E24B4A;
  --purple: #534AB7;
  --coral:  #D85A30;
  --pink:   #993556;
  --forest: #3B6D11;
  --navy:   #0C447C;

  --blue-dark:  #12497e;
  --blue-tint:  #eaf2fa;
  --teal-tint:  #e6f5ef;
  --amber-tint: #fbf1e4;
  --red-tint:   #fdecec;

  /* Neutrals — light, bright theme */
  --bg:        #f5f7fa;
  --surface:   #ffffff;
  --line:      #e4e8ee;
  --line-soft: #eef1f5;
  --ink:       #1a2230;
  --ink-soft:  #5a6577;
  --ink-mute:  #8b95a6;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;

  /* Radius */
  --r-card: 12px;
  --r-btn: 8px;
  --r-pill: 9999px;

  /* Spacing */
  --pad-card: 16px;
  --gap-section: 16px;
  --gap-form: 12px;

  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .06);
  --shadow-md: 0 4px 16px rgba(16, 30, 54, .08);
  --shadow-lg: 0 12px 32px rgba(16, 30, 54, .12);

  --sidebar-w: 248px;
  --topbar-h: 60px;
}

/* ---- Reset ------------------------------------------------------ */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }

h1 { font-size: var(--fs-xl); line-height: 1.25; }
h2 { font-size: var(--fs-lg); line-height: 1.3; }
h3 { font-size: var(--fs-base); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

button { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Layout utilities ------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.stack > * + * { margin-top: var(--gap-section); }

.grid { display: grid; gap: var(--gap-section); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

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

.spacer { flex: 1; }

.muted   { color: var(--ink-soft); }
.dim     { color: var(--ink-mute); }
.tiny    { font-size: var(--fs-xs); }
.bold    { font-weight: 600; }
.right   { text-align: right; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }

.hide { display: none !important; }

/* ---- Cards ------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--pad-card);
  box-shadow: var(--shadow-sm);
}

.card--flush { padding: 0; overflow: hidden; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
}

.card__title {
  font-size: var(--fs-base);
  font-weight: 600;
}

.card__body { padding: var(--pad-card); }

/* ---- Stat cards (8 documented variants) ------------------------- */

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--pad-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-color, var(--blue));
}

.stat__label {
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}

.stat__value {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.15;
  margin-top: 6px;
  color: var(--stat-color, var(--ink));
  word-break: break-word;
}

.stat__note {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  margin-top: 4px;
}

.stat--blue   { --stat-color: var(--blue); }
.stat--teal   { --stat-color: var(--teal); }
.stat--amber  { --stat-color: var(--amber); }
.stat--purple { --stat-color: var(--purple); }
.stat--coral  { --stat-color: var(--coral); }
.stat--pink   { --stat-color: var(--pink); }
.stat--forest { --stat-color: var(--forest); }
.stat--navy   { --stat-color: var(--navy); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--bg); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { opacity: .9; }

.btn--link {
  background: none;
  color: var(--blue);
  padding: 4px 0;
}

.btn--block { width: 100%; }
.btn--sm { padding: 7px 12px; font-size: var(--fs-xs); }

.btn[disabled], .btn.is-busy {
  opacity: .6;
  pointer-events: none;
}

/* ---- Badges ----------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--ok    { background: var(--teal-tint);  color: #147a58; }
.badge--warn  { background: var(--amber-tint); color: #8c580f; }
.badge--bad   { background: var(--red-tint);   color: #b93534; }
.badge--info  { background: var(--blue-tint);  color: var(--blue); }
.badge--muted { background: #eef1f5;           color: var(--ink-soft); }

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

.field { margin-bottom: var(--gap-form); }

.field__label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field__label .req { color: var(--danger); }

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}

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

.select {
  appearance: none;
  background-image: 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='%235a6577' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.field--error .input,
.field--error .select { border-color: var(--danger); }

.field__error {
  display: block;
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: 5px;
}

.field__hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  margin-top: 5px;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-form);
}

/* Password reveal */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 62px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

/* ---- Alerts ----------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-btn);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
}

.alert--success { background: var(--teal-tint);  border-color: #b9e3d3; color: #14664a; }
.alert--error   { background: var(--red-tint);   border-color: #f5c4c4; color: #a32f2e; }
.alert--warning { background: var(--amber-tint); border-color: #ecd3ae; color: #7d4e0d; }
.alert--info    { background: var(--blue-tint);  border-color: #c3dcf1; color: var(--navy); }

.alert__close {
  margin-left: auto;
  background: none;
  border: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: .55;
}
.alert__close:hover { opacity: 1; }

.flash-zone {
  position: relative;
  display: grid;
  gap: 8px;
  margin-bottom: var(--gap-section);
}

/* ---- Tables ----------------------------------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px var(--pad-card);
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 12px var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }

/* ---- Empty state ------------------------------------------------ */

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
}

.empty__title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ==================================================================
   Auth layout
   ================================================================== */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(1000px 420px at 50% -10%, var(--blue-tint), transparent 70%),
    var(--bg);
}

.auth__box { width: 100%; max-width: 440px; }

.auth__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--navy);
}
.auth__brand:hover { text-decoration: none; }

.auth__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-btn);
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-base);
  font-weight: 700;
}

.auth__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.auth__title { font-size: var(--fs-lg); font-weight: 700; }
.auth__sub { color: var(--ink-soft); margin-top: 4px; margin-bottom: 20px; }

.auth__foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--ink-soft);
}

.auth__back {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}

/* ==================================================================
   Dashboard layout
   ================================================================== */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .2s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
  font-weight: 700;
  color: var(--navy);
  flex: none;
}
.sidebar__brand:hover { text-decoration: none; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 20px;
}

.nav-group + .nav-group { margin-top: 18px; }

.nav-group__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--ink-mute);
  padding: 0 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-btn);
  color: var(--ink-soft);
  font-weight: 500;
}
.nav-link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }

.nav-link.is-active {
  background: var(--blue-tint);
  color: var(--blue);
  font-weight: 600;
}

.nav-link__icon { width: 18px; height: 18px; flex: none; }

.nav-link__count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.nav-link--soon {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

.sidebar__foot {
  flex: none;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
}

/* Main column */

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__title {
  font-size: var(--fs-base);
  font-weight: 600;
}

.topbar__burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 6px 8px;
  cursor: pointer;
  line-height: 0;
}

.content {
  flex: 1;
  padding: 20px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--gap-section);
}

.page-head__title { font-size: var(--fs-xl); font-weight: 700; }
.page-head__sub { color: var(--ink-soft); margin-top: 2px; }

/* Avatar bubble */

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  flex: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 46px; height: 46px; font-size: var(--fs-sm); }

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-btn);
  background: var(--bg);
}
.userbox__name { font-weight: 600; font-size: var(--fs-xs); }
.userbox__role { font-size: 11px; color: var(--ink-mute); text-transform: capitalize; }

/* Sidebar backdrop on mobile */

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 34, .45);
  z-index: 35;
}
.backdrop.is-open { display: block; }

/* ==================================================================
   Public layout
   ================================================================== */

.pubnav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.pubnav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
}

.pubnav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--navy);
  font-size: var(--fs-base);
}
.pubnav__brand:hover { text-decoration: none; }

.pubnav__links { display: flex; align-items: center; gap: 6px; }

.pubnav__link {
  padding: 8px 12px;
  border-radius: var(--r-btn);
  color: var(--ink-soft);
  font-weight: 500;
}
.pubnav__link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.pubnav__link.is-active { color: var(--blue); font-weight: 600; }

.hero {
  border-radius: var(--r-card);
  padding: 44px 28px;
  color: #fff;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.hero__eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  opacity: .8;
}

.hero__title {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  margin: 10px 0 8px;
  max-width: 20ch;
}

.hero__sub {
  font-size: var(--fs-base);
  opacity: .9;
  max-width: 46ch;
  margin-bottom: 20px;
}

.hero__btn {
  background: #fff;
  color: var(--navy);
}
.hero__btn:hover { background: #f0f4f8; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.chip:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

.footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: var(--fs-xs);
}

/* ---- Copy-to-clipboard row -------------------------------------- */

.copyrow {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.copyrow .input {
  font-size: var(--fs-xs);
  background: var(--bg);
}

/* ==================================================================
   Responsive
   ================================================================== */

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar__burger { display: inline-flex; }
  .content { padding: 16px; }
  .hero { padding: 32px 20px; }
  .hero__title { font-size: 24px; }
  .pubnav__links .pubnav__link--hide-sm { display: none; }
}

@media (max-width: 560px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; }
  .page-head__title { font-size: var(--fs-lg); }
  .stat__value { font-size: var(--fs-lg); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

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

@media print {
  .sidebar, .topbar, .backdrop, .btn { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
}

/* ==================================================================
   Admin list screens (Phase 2)
   ================================================================== */

.chip--active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.chip--active:hover { color: #fff; border-color: var(--blue); }

.chip__count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .08);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.chip--active .chip__count { background: rgba(255, 255, 255, .25); }

/* Pagination */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px var(--pad-card);
  border-top: 1px solid var(--line-soft);
}

.pager__count { font-size: var(--fs-xs); color: var(--ink-soft); }
.pager__links { display: flex; gap: 4px; flex-wrap: wrap; }

.pager__link {
  display: inline-block;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
}
.pager__link:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pager__link.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Definition list used on detail pages */

.datalist { margin: 0; font-size: var(--fs-sm); }

.datalist dt {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  font-weight: 600;
  margin-top: 10px;
}
.datalist dt:first-child { margin-top: 0; }

.datalist dd {
  margin: 2px 0 0;
  color: var(--ink);
  word-break: break-word;
}

/* Toggle switch for settings */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: #cbd3de;
  transition: background .18s ease;
  flex: none;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease;
}

.switch input:checked + .switch__track { background: var(--teal); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue); outline-offset: 2px; }

.switch__label { font-size: var(--fs-sm); }
.switch__label small { display: block; color: var(--ink-mute); font-size: var(--fs-xs); }

/* Settings groups */

.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.setting-row:last-child { border-bottom: 0; }

.setting-row__text { flex: 1; min-width: 0; }
.setting-row__title { font-weight: 600; }
.setting-row__hint { font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }
.setting-row__control { flex: none; width: 180px; max-width: 45%; }

/* Inline edit row (categories) */

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.inline-form .input, .inline-form .select { min-width: 140px; flex: 1; }

/* ==================================================================
   Confirm modal
   Native confirm() is suppressed by some mobile browsers, so every
   destructive action routes through this instead.
   ================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 20, 34, .5);
}
.modal.is-open { display: flex; }

.modal__box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.modal__title { font-size: var(--fs-base); font-weight: 700; margin-bottom: 6px; }
.modal__body { color: var(--ink-soft); margin-bottom: 18px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 560px) {
  .setting-row { flex-direction: column; }
  .setting-row__control { width: 100%; max-width: none; }
  .modal__actions .btn { flex: 1; }
}

/* ==================================================================
   Storefront (Phase 3)
   ================================================================== */

.section__title { font-size: var(--fs-base); font-weight: 700; }

.hero__search {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin-bottom: 14px;
}
.hero__search .input { background: #fff; border-color: transparent; }

.hero__meta { font-size: var(--fs-xs); opacity: .85; }

.crumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  margin: 4px 0 14px;
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--blue); }

/* ---- Product grid ---------------------------------------------- */

.pgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pcard:hover { border-color: #cfd8e4; box-shadow: var(--shadow-md); }

.pcard__media {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
}
.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.pcard:hover .pcard__media img { transform: scale(1.03); }

.pcard__flag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.pcard__flag--sale { background: var(--danger); }
.pcard__flag--out  { background: rgba(26, 34, 48, .78); top: auto; bottom: 8px; }

.pcard__wish { position: absolute; top: 6px; right: 6px; z-index: 2; }

.wishbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.wishbtn:hover { color: var(--danger); border-color: var(--danger); }
.wishbtn.is-saved { color: #fff; background: var(--danger); border-color: var(--danger); }
.wishbtn.is-saved svg { fill: currentColor; }

.wishbtn-wide.is-saved {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--red-tint);
}
.wishbtn-wide.is-saved svg { fill: currentColor; }

.pcard__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.pcard__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}
.pcard__title a { color: var(--ink); }
.pcard__title a:hover { color: var(--blue); text-decoration: none; }

.pcard__seller { font-size: var(--fs-xs); color: var(--ink-mute); }
.pcard__seller a { color: var(--ink-soft); }

.pcard__price { margin-top: auto; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.pcard__now  { font-size: var(--fs-base); font-weight: 700; color: var(--ink); }
.pcard__was  { font-size: var(--fs-xs); color: var(--ink-mute); text-decoration: line-through; }

.pcard__stock { font-size: var(--fs-xs); font-weight: 600; }

.stock--ok    { color: var(--teal); }
.stock--warn  { color: var(--amber); }
.stock--bad   { color: var(--danger); }

/* ---- Stars ------------------------------------------------------ */

.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars__count { font-size: var(--fs-xs); color: var(--ink-mute); margin-left: 5px; }

/* ---- Shop layout ------------------------------------------------ */

.shoplayout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.shopfilters { position: sticky; top: calc(var(--topbar-h) + 12px); }

/* ---- Product detail --------------------------------------------- */

.pdetail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.gallery__main {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery__thumb {
  flex: none;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--r-btn);
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--blue); }

.pdetail__title { font-size: var(--fs-xl); font-weight: 700; line-height: 1.25; margin-bottom: 8px; }

.pdetail__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.pdetail__now { font-size: 28px; font-weight: 700; }
.pdetail__was { font-size: var(--fs-base); color: var(--ink-mute); text-decoration: line-through; }

.pdetail__stock { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 16px; }

.pdetail__actions { display: block; }

.prose { color: var(--ink-soft); line-height: 1.65; }

.review { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.review:last-child { border-bottom: 0; }

/* ---- Store pages ------------------------------------------------ */

.storehead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}

.storehead__banner {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--navy);
}

.storehead__body { display: flex; gap: 14px; align-items: center; padding: 16px; }
.storehead__name { font-size: var(--fs-lg); font-weight: 700; }
.storehead__about { padding: 0 16px 16px; margin: 0; }

.sgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.scard {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--ink);
}
.scard:hover { border-color: var(--blue); text-decoration: none; box-shadow: var(--shadow-sm); }

.scard__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scard__name { font-weight: 600; }

/* ---- Responsive -------------------------------------------------- */

@media (max-width: 1024px) {
  .pgrid, .sgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shoplayout { grid-template-columns: 210px minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .pgrid, .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shoplayout { grid-template-columns: 1fr; }
  .shopfilters { position: static; }
  .pdetail { grid-template-columns: 1fr; }
  .pdetail__now { font-size: 24px; }
}

@media (max-width: 420px) {
  .sgrid { grid-template-columns: 1fr; }
  .pcard__body { padding: 10px; }
}

/* Toast stack for background actions */
.toast-zone {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast-zone .alert {
  box-shadow: var(--shadow-md);
  transition: opacity .25s ease;
}
@media (max-width: 480px) {
  .toast-zone { left: 16px; right: 16px; max-width: none; }
}

/* ==================================================================
   Cart & checkout (Phase 4)
   ================================================================== */

.cartlink {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-btn);
  color: var(--ink-soft);
}
.cartlink:hover { background: var(--bg); color: var(--blue); }

.cartlink__count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.checkoutlayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.checkoutside { position: sticky; top: calc(var(--topbar-h) + 12px); }

/* Cart rows */

.cartrow {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 96px 110px auto;
  gap: 12px;
  align-items: center;
  padding: 12px var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
}
.cartrow:last-child { border-bottom: 0; }

.cartrow__img {
  width: 64px;
  height: 64px;
  border-radius: var(--r-btn);
  overflow: hidden;
  background: var(--bg);
  display: block;
}
.cartrow__img img { width: 100%; height: 100%; object-fit: cover; }

.cartrow__info { min-width: 0; }
.cartrow__info a { color: var(--ink); }
.cartrow__info a:hover { color: var(--blue); }

.cartrow__qty .input { width: 88px; }
.cartrow__total { text-align: right; font-weight: 600; white-space: nowrap; }

.cartrow--sub {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #fafbfc;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

/* Summary rows */

.sumrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: var(--fs-sm);
}
.sumrow--good { color: var(--teal); }
.sumrow--total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 10px;
  font-size: var(--fs-base);
  font-weight: 700;
}

/* Payment options */

.paylist { display: grid; gap: 8px; margin-top: 12px; }

.payopt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  cursor: pointer;
}
.payopt:hover { border-color: var(--blue); }
.payopt input { margin-top: 3px; }
.payopt__body { display: flex; flex-direction: column; gap: 2px; }

.payopt--disabled {
  opacity: .55;
  cursor: default;
  background: var(--bg);
}
.payopt--disabled:hover { border-color: var(--line); }

/* Saved addresses */

.addrpick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.addrcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.addrcard:hover, .addrcard.is-active { border-color: var(--blue); background: var(--blue-tint); }

/* Confirmation */

.confirm { text-align: center; padding: 22px 0 4px; }

.confirm__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.confirm__icon--ok   { background: var(--teal-tint);  color: var(--teal); }
.confirm__icon--wait { background: var(--amber-tint); color: var(--amber); }

.confirm__title { font-size: var(--fs-xl); font-weight: 700; }
.confirm__sub { color: var(--ink-soft); margin-top: 4px; }

@media (max-width: 900px) {
  .checkoutlayout { grid-template-columns: 1fr; }
  .checkoutside { position: static; }
}

@media (max-width: 640px) {
  .cartrow {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "img info info"
      "img qty  total"
      "img rm   rm";
    row-gap: 6px;
  }
  .cartrow__img    { grid-area: img; width: 56px; height: 56px; }
  .cartrow__info   { grid-area: info; }
  .cartrow__qty    { grid-area: qty; }
  .cartrow__total  { grid-area: total; }
  .cartrow__remove { grid-area: rm; }
  .cartrow--sub { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: none; }
  .addrpick { grid-template-columns: 1fr; }
}

/* ==================================================================
   Vendor dashboard (Phase 6)
   ================================================================== */

.stat-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  text-align: center;
}
.stat-card--ok { border-color: var(--teal); background: var(--teal-tint); }

.stat-card__label { font-size: var(--fs-xs); color: var(--ink-mute); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card__value { font-size: 26px; font-weight: 700; margin: 4px 0; }
.stat-card__hint  { font-size: var(--fs-xs); color: var(--ink-mute); }

.imgprev { display: flex; gap: 10px; flex-wrap: wrap; }
.imgprev__item { position: relative; }
.imgprev__item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r-btn); border: 1px solid var(--line); }
.imgprev__remove { display: flex; align-items: center; gap: 4px; margin-top: 4px; cursor: pointer; }

.grid--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 768px) { .grid--2 { grid-template-columns: 1fr; } }

/* ==================================================================
   Admin dashboard chart + production upgrades
   ================================================================== */

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-bottom: 22px;
  position: relative;
}

.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.bar-chart__bar {
  width: 100%;
  min-height: 2px;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
  opacity: .7;
  transition: opacity .15s;
}

.bar-chart__bar--today { opacity: 1; background: var(--teal); }
.bar-chart__col:hover .bar-chart__bar { opacity: 1; }

.bar-chart__label {
  position: absolute;
  bottom: -20px;
  font-size: 10px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.stale-row { background: #fffbf0; }

/* Progress bar */
.progress { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--teal); border-radius: 3px; transition: width .3s ease; min-width: 2px; }

/* ==================================================================
   Homepage sections
   ================================================================== */

.home-section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section__title { font-size: 18px; font-weight: 700; }
.section__link { font-size: 13px; color: var(--blue); text-decoration: none; white-space: nowrap; }
.section__link:hover { text-decoration: underline; }

/* Category row — desktop only */
.cat-row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; scroll-snap-type: x mandatory;
}


.desktop-only { display: block; }
@media (max-width: 768px) { .desktop-only { display: none !important; } }

/* Carousel */
.carousel { position: relative; }
.carousel__track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth;
  padding-bottom: 4px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > .pcard {
  flex: 0 0 180px; scroll-snap-align: start; min-width: 0;
}
@media (min-width: 640px) { .carousel__track > .pcard { flex: 0 0 200px; } }
@media (min-width: 1024px) { .carousel__track > .pcard { flex: 0 0 220px; } }

.carousel__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 2; display: none; align-items: center; justify-content: center;
  color: var(--ink); transition: background .12s;
}
.carousel__arrow:hover { background: var(--bg); }
.carousel__arrow--left { left: -14px; }
.carousel__arrow--right { right: -14px; }

/* Show arrows only on desktop */
@media (min-width: 769px) {
  .carousel:hover .carousel__arrow { display: flex; }
}

/* ==================================================================
   Homepage sections
   ================================================================== */
.hpsection { margin-bottom: 24px; }
.hpsection__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
.hpsection__title { font-size: 18px; font-weight: 700; }
.hpsection__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap;
  padding: 6px 14px; border: 1.5px solid var(--blue); border-radius: 999px;
  transition: background .15s, color .15s;
}
.hpsection__link:hover { background: var(--blue); color: #fff; }

/* Category strip (desktop only) */
.catstrip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.catcard {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
  padding: 14px 8px 10px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  transition: border-color .15s, box-shadow .15s;
}
.catcard:hover { border-color: var(--blue); box-shadow: var(--shadow); }

.catcard__visual {
  position: relative; width: 100%; display: flex; justify-content: center;
}

.catcard__img {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
}
.catcard__img--placeholder {
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700; color: var(--ink-mute);
  border: 2px dashed var(--line);
}

.catcard__count {
  position: absolute; top: -4px; right: 8px;
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  line-height: 1.3;
}

.catcard__name {
  font-size: 13px; text-align: center; font-weight: 600;
  line-height: 1.3;
}

@media (max-width: 768px) { .catstrip-wrap { display: none !important; } }

/* Carousel */
.carousel { position: relative; }
.carousel__track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.carousel__track::-webkit-scrollbar { height: 0; }
.carousel__track .pcard { min-width: 180px; max-width: 200px; flex-shrink: 0; scroll-snap-align: start; }
.carousel__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; font-size: 20px; display: none; place-items: center; z-index: 2; color: var(--ink); }
.carousel__arrow--left { left: -14px; }
.carousel__arrow--right { right: -14px; }
.carousel__arrow:hover { background: var(--bg); }
@media (min-width: 769px) { .carousel__arrow { display: grid; } }
@media (max-width: 768px) { .carousel__track .pcard { min-width: 150px; max-width: 170px; } }

/* Sponsored flag */
.pcard__flag--promo { background: var(--blue); }

/* ==================================================================
   Footer
   ================================================================== */

.footer-bottom { max-width: var(--container); margin: 0 auto; padding: 16px var(--pad-x); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-bottom-links a { color: #8b95a6; text-decoration: none; font-size: 12px; }
.footer-bottom-links a:hover { color: #fff; }
.footer-copy { font-size: 12px; color: #5a6577; }
@media (max-width: 768px) {
  .footer-main { grid-template-columns: 1fr; gap: 20px; }
}

/* WhatsApp FAB */
.wa-fab { position: fixed; bottom: 20px; right: 20px; width: 56px; height: 56px; background: #25D366; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 90; transition: transform .2s; }
.wa-fab:hover { transform: scale(1.08); }

/* ==================================================================
   Footer — 3-column + policy row + copyright row
   ================================================================== */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 0;
}

.site-footer .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  padding: 32px 0;
}

.footer-logo { height: 36px; width: auto; margin-bottom: 8px; display: block; }
.footer-brand { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.footer-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink);
  margin-bottom: 10px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.9;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-links a:hover { color: var(--blue); }

/* Policy links row */
.footer-policy { text-align: center; justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.footer-policy a {
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.footer-policy a:hover { color: var(--blue); }

/* Copyright row */
.footer-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-mute);
}

/* WhatsApp floating button */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, .35);
  z-index: 90;
  transition: transform .2s;
  text-decoration: none;
}

.wa-float:hover { transform: scale(1.08); }

@keyframes wa-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.wa-float { animation: wa-bounce .6s ease 2s 3; }

/* Responsive footer */
@media (max-width: 768px) {
  .site-footer .wrap { padding: 0 16px; }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0;
  }

  .footer-policy { text-align: center; justify-content: center;
    gap: 6px 14px;
    justify-content: center;
    text-align: center;
  }

  .footer-copy {
    flex-direction: column;
    text-align: center;
  }

  .wa-float { bottom: 16px; right: 16px; width: 50px; height: 50px; }
}

/* ==================================================================
   Hamburger menu + mobile drawer
   ================================================================== */

.burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mob-menu { display: none; background: var(--surface); border-top: 1px solid var(--line); padding: 0; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.mob-menu.is-open { max-height: 500px; }

.mob-menu__links { display: flex; flex-direction: column; padding: 12px 20px 0; }
.mob-menu__link { padding: 10px 0; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 6px; }
.mob-menu__link.is-active { color: var(--blue); }
.mob-menu__link:last-child { border-bottom: none; }

.mob-menu__auth { padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Desktop: show nav + auth, hide burger + drawer */
.pubnav__links--desktop { display: flex; }
.pubnav__auth--desktop { display: flex; align-items: center; gap: 10px; }

@media (max-width: 768px) {
  .pubnav__links--desktop { display: none; }
  .pubnav__auth--desktop { display: none; }
  .burger { display: flex; }
  .mob-menu { display: block; }
}

/* Categories grid page */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cat-card {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.cat-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.cat-card__img {
  width: 100%; aspect-ratio: 1/1;
  object-fit: cover; display: block;
  background: var(--bg);
}
.cat-card__icon {
  width: 100%; aspect-ratio: 1/1;
  background: var(--bg); display: grid; place-items: center;
  font-size: 24px; font-weight: 700; color: var(--ink-mute);
}
.cat-card__name { font-size: 14px; font-weight: 600; text-align: center; padding: 10px 8px 2px; }
.cat-card__count { font-size: 12px; color: var(--ink-mute); padding: 0 8px 10px; }
