/* ==========================================================================
   Sanz Jose storefront design system
   Shared by the desktop (.is-desktop) and mobile (.is-mobile) views.
   Page templates add their own layout on top of these tokens and components.
   ========================================================================== */

:root {
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --subtle: #94A3B8;
  --line: #E6E8EC;
  --line-2: #F0F2F5;
  --bg: #F5F6F8;
  --surface: #FFFFFF;

  --brand: #0B5ED7;
  --brand-ink: #0847A6;
  --brand-soft: #EAF2FE;
  --accent: #E5262E;
  --accent-soft: #FDECEC;

  --success: #15803D;
  --success-soft: #E8F6EC;
  --warning: #B45309;
  --warning-soft: #FEF4E2;
  --danger: #DC2626;
  --danger-soft: #FDECEC;
  --info: #0369A1;
  --info-soft: #E6F3FA;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, .12);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container: 1200px;
  --header-h: 68px;
  --appbar-h: 56px;
  --tabbar-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.store {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
:where(.store) :is(h1, h2, h3, h4, h5, p) { margin: 0; }
:where(.store) :is(h1, h2, h3, h4) { letter-spacing: -0.01em; line-height: 1.25; font-weight: 700; }
:where(.store) a { color: inherit; text-decoration: none; }
:where(.store) img { max-width: 100%; display: block; }
:where(.store) button { font-family: inherit; }
:where(.store) :is(input, select, textarea) { font-family: inherit; font-size: 15px; }
:where(.store) ul { margin: 0; padding: 0; list-style: none; }
:where(.store) :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
:where(.store) .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:where(.store) .skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
:where(.store) .skip-link:focus { left: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.clamp-1, .clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.price { font-weight: 800; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.price-accent { color: var(--accent); }
.price-old { color: var(--subtle); text-decoration: line-through; font-weight: 500; font-size: .85em; }
.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
.stack { display: flex; flex-direction: column; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn i { font-size: 1.05em; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1E293B; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #C81E26; color: #fff; }
.btn-outline { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-outline:hover { border-color: #CBD5E1; background: #FAFBFC; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: #DCE9FD; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge i { font-size: 12px; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent); color: #fff; }

/* Order status → badge colour (use class "status-<status>") */
.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-processing { background: var(--info-soft); color: var(--info); }
.status-shipped { background: var(--brand-soft); color: var(--brand); }
.status-delivered { background: var(--success-soft); color: var(--success); }
.status-cancelled, .status-expired { background: var(--danger-soft); color: var(--danger); }
.status-paid { background: var(--success-soft); color: var(--success); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: #CBD5E1; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.chip.active .count { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 16px; font-weight: 700; }
.card-body { padding: 20px; }

.section { margin-top: 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { font-size: 22px; font-weight: 800; }
.section-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--brand); }
.link-more:hover { color: var(--brand-ink); }

/* ---------- Product card ---------- */
.product-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s;
}
.product-card:hover { box-shadow: var(--shadow); border-color: #DDE1E6; }
.product-card .pc-media { position: relative; aspect-ratio: 1 / 1; background: var(--line-2); overflow: hidden; }
.product-card .pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.product-card:hover .pc-media img { transform: scale(1.03); }
.product-card .pc-tag { position: absolute; top: 10px; left: 10px; }
.product-card .pc-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.product-card .pc-cat { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.product-card .pc-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; min-height: 2.8em; }
.product-card .pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.product-card .pc-price { font-size: 16px; font-weight: 800; }
.product-card .pc-meta { font-size: 12px; color: var(--muted); }
.product-card .pc-add {
  width: 36px; height: 36px; border-radius: 10px; border: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); cursor: pointer; transition: background .15s, color .15s; flex: 0 0 auto;
}
.product-card .pc-add:hover { background: var(--brand); color: #fff; }
.product-card.is-soldout .pc-media img { filter: grayscale(.6); opacity: .7; }

/* Image placeholder used when a product has no photo */
.img-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--subtle); background: linear-gradient(135deg, #F1F3F6, #E8EBEF); }
.img-ph i { font-size: 32px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s; outline: none; appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%2364748B'%3E%3Cpath d='M1.6 5.1a.6.6 0 0 1 .8 0L8 10.7l5.6-5.6a.6.6 0 1 1 .8.8l-6 6a.6.6 0 0 1-.8 0l-6-6a.6.6 0 0 1 0-.8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 94, 215, .12); }
.input:disabled, .input[readonly] { background: var(--line-2); color: var(--muted); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: span 2; }
.is-invalid { border-color: var(--danger) !important; }
.invalid-text { font-size: 12.5px; color: var(--danger); }

/* ---------- Quantity stepper ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); height: 36px; }
.qty button { width: 34px; height: 100%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.qty button:hover { color: var(--brand); }
.qty button:disabled { color: var(--subtle); cursor: not-allowed; }
.qty .qty-value { display: inline-flex; align-items: center; justify-content: center; }
.qty input, .qty .qty-value { width: 40px; height: 100%; border: 0; text-align: center; font-weight: 700; background: transparent; color: var(--ink); -moz-appearance: textfield; outline: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-lg { height: 44px; }
.qty-lg button { width: 42px; }

/* ---------- Summary rows ---------- */
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.sum-row strong { color: var(--ink); font-weight: 600; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--line); }
.sum-total .price { font-size: 22px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 24px; }
.empty .empty-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* ---------- Alerts & toasts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid transparent; }
.alert i { font-size: 16px; margin-top: 1px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #CDEBD6; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: #F8D0D0; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: #CBE5F3; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #F6DFB4; }

.toast-stack { position: fixed; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.is-desktop .toast-stack { top: calc(var(--header-h) + 16px); right: 24px; width: 360px; }
.is-mobile .toast-stack { left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + var(--appbar-h) + 8px); }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .25s ease-out;
}
.toast i { font-size: 17px; margin-top: 1px; }
.toast.toast-success i { color: #4ADE80; }
.toast.toast-error i { color: #F87171; }
.toast .toast-close { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 0 0 0 8px; font-size: 16px; }
.toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
dialog.modal .modal-body { padding: 24px; }
dialog.modal .modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
dialog.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 24px; }
.is-mobile dialog.modal { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.is-mobile dialog.modal .modal-actions .btn { flex: 1; }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 37%, #EEF0F3 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   Desktop shell
   ========================================================================== */
.is-desktop .site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.site-header .logo { display: flex; align-items: center; flex: 0 0 auto; }
.site-header .logo img { height: 38px; width: auto; }
.site-header .logo-text { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.site-header .main-nav { display: flex; align-items: center; gap: 4px; }
.site-header .main-nav a { padding: 8px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.site-header .main-nav a:hover { background: var(--line-2); color: var(--ink); }
.site-header .main-nav a.active { color: var(--brand); }
.site-header .search { flex: 1; max-width: 520px; position: relative; }
.site-header .search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.site-header .search input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 16px 0 40px; outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.site-header .search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,94,215,.12); }
.site-header .actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 20px; background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.count-badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.count-badge[hidden] { display: none; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 6px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: 14px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { border-color: #CBD5E1; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 200; }
.user-menu .menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu .menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.user-menu .menu a:hover { background: var(--line-2); color: var(--ink); }
.user-menu .menu a.danger { color: var(--danger); }
.user-menu .menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 0; }

.is-desktop .page { padding: 28px 0 64px; min-height: calc(100vh - var(--header-h) - 200px); }
.page-head { margin-bottom: 24px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); margin-top: 4px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--subtle); }
.breadcrumb .current { color: var(--ink-2); font-weight: 600; }

.site-footer { background: #0B1220; color: #CBD5E1; margin-top: 0; }
.site-footer .footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; padding: 56px 0 40px; }
.site-footer h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.site-footer p, .site-footer li { font-size: 14px; line-height: 1.6; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-logo img { height: 40px; margin-bottom: 14px; }
.site-footer .socials { display: flex; gap: 8px; margin-top: 16px; }
.site-footer .socials a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.site-footer .socials a:hover { background: rgba(255,255,255,.16); }
.site-footer .contact li { display: flex; gap: 10px; }
.site-footer .contact i { color: #60A5FA; margin-top: 3px; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: #94A3B8; }
.site-footer .footer-bottom .links { display: flex; gap: 20px; }

/* ==========================================================================
   Mobile shell
   ========================================================================== */
.is-mobile { font-size: 14.5px; }
.is-mobile .appbar {
  position: sticky; top: 0; z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255,255,255,.95); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar .appbar-row { height: var(--appbar-h); display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.appbar .appbar-title { flex: 1; font-size: 16.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.appbar .appbar-logo { display: flex; align-items: center; padding-left: 6px; flex: 0 0 auto; }
.appbar .appbar-logo img { height: 30px; width: auto; }
.appbar .appbar-search { flex: 1; position: relative; }
.appbar .appbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); font-size: 14px; }
.appbar .appbar-search input { width: 100%; height: 40px; border-radius: 999px; border: 0; background: var(--line-2); padding: 0 14px 0 36px; font-size: 14px; outline: none; }
.appbar .appbar-search input:focus { background: #fff; box-shadow: 0 0 0 2px var(--brand); }
.is-mobile .icon-btn { width: 40px; height: 40px; }

.is-mobile .page { padding: 16px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)); }
.is-mobile.no-tabbar .page { padding-bottom: 24px; }
.is-mobile .page-title { font-size: 22px; }
.is-mobile .section { margin-top: 24px; }
.is-mobile .section-head { margin-bottom: 12px; }
.is-mobile .section-title { font-size: 17px; }
.is-mobile .card-pad, .is-mobile .card-body { padding: 16px; }
.is-mobile .card-header { padding: 14px 16px; }
.is-mobile .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.is-mobile .product-card { border-radius: 14px; }
.is-mobile .product-card .pc-body { padding: 10px 10px 12px; gap: 4px; }
.is-mobile .product-card .pc-name { font-size: 13px; }
.is-mobile .product-card .pc-price { font-size: 14.5px; }
.is-mobile .product-card .pc-add { width: 32px; height: 32px; border-radius: 9px; }
.is-mobile .form-grid { grid-template-columns: 1fr; }
.is-mobile .form-grid .span-2 { grid-column: auto; }
.is-mobile .input, .is-mobile .select { font-size: 16px; } /* prevents iOS zoom on focus */
.is-mobile .textarea { font-size: 16px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--subtle); font-size: 11px; font-weight: 600; }
.tabbar a i { font-size: 21px; line-height: 1; }
.tabbar a.active { color: var(--brand); }
.tabbar .count-badge { top: 6px; right: calc(50% - 22px); }

/* Sticky action bar at the bottom of mobile pages (checkout, add to cart) */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,23,42,.06);
}
.is-mobile.has-action-bar .page { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.is-mobile.has-action-bar.has-tabbar .action-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
.is-mobile.has-action-bar.has-tabbar .page { padding-bottom: calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom, 0px)); }

/* List rows (profile menu, settings) */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #FAFBFC; }
.list-item .li-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.list-item .li-text { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14.5px; }
.list-item .li-sub { font-size: 12.5px; color: var(--muted); }
.list-item .li-chevron { color: var(--subtle); }

/* ---------- Responsive safety net (desktop view in a narrow window) ---------- */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .is-desktop .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-desktop .site-header .main-nav, .is-desktop .user-menu .user-name { display: none; }
  .container { padding: 0 16px; }
}

/* ==========================================================================
   Customer auth pages (/login, /register, /register/verify)
   ========================================================================== */
.auth-split { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 56px; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, #1E3A8A 0%, #0B1220 60%);
}
.auth-aside::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 56px solid rgba(229, 38, 46, .22); }
.auth-aside .auth-logo img { height: 44px; width: auto; }
.auth-aside .auth-logo strong { font-size: 22px; }
.auth-aside h2 { font-size: 36px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; max-width: 420px; }
.auth-aside .lead { color: #CBD5E1; font-size: 16px; margin-top: 12px; max-width: 400px; }
.auth-perks { display: grid; gap: 14px; margin-top: 32px; position: relative; z-index: 1; }
.auth-perks li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: #E2E8F0; }
.auth-perks i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: #93C5FD; flex: 0 0 auto; }
.auth-aside .aside-foot { font-size: 13px; color: #94A3B8; position: relative; z-index: 1; }

.auth-main { display: flex; flex-direction: column; padding: 28px 40px; background: var(--surface); }
.auth-main .auth-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.auth-main .auth-top a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.auth-main .auth-top a:hover { color: var(--ink); }
.auth-main .auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--muted); margin-top: 6px; font-size: 15px; }
.auth-form { display: grid; gap: 16px; margin-top: 28px; }
.auth-form .btn-lg { margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 14.5px; color: var(--muted); }
.auth-switch a { color: var(--brand); font-weight: 700; }
.auth-switch a:hover { color: var(--brand-ink); }
.auth-legal { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.6; }
.auth-legal a { color: var(--ink-2); text-decoration: underline; }

.pw-field { position: relative; }
.pw-field .input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; cursor: pointer; font-size: 17px; }
.pw-toggle:hover { color: var(--ink); background: var(--line-2); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row a { font-size: 13px; font-weight: 600; color: var(--brand); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter span { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #F59E0B; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: #84CC16; }
.pw-meter[data-score="4"] span { background: var(--success); }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

.otp-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.otp-inputs input {
  width: 100%; height: 58px; text-align: center; font-size: 24px; font-weight: 800; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.otp-inputs input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,94,215,.12); }
.otp-inputs.is-invalid input { border-color: var(--danger); }
.otp-mail { display: inline-flex; width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); align-items: center; justify-content: center; font-size: 28px; margin-bottom: 18px; }
.resend-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.resend-row button { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; cursor: pointer; font-size: 14px; }
.resend-row button:disabled { color: var(--subtle); cursor: default; }

/* Mobile auth */
.is-mobile .auth-m { padding-top: 8px; }
.is-mobile .auth-m h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.is-mobile .auth-m .sub { color: var(--muted); margin-top: 6px; }
.is-mobile .auth-m .auth-form { margin-top: 24px; }
.is-mobile .otp-inputs { gap: 8px; }
.is-mobile .otp-inputs input { height: 54px; font-size: 22px; }
.auth-m-brand { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: radial-gradient(130% 150% at 100% 0%, #1E3A8A 0%, #0B1220 60%); color: #fff; margin-bottom: 22px; }
.auth-m-brand i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.1); color: #93C5FD; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.auth-m-brand .t { font-weight: 700; font-size: 14px; }
.auth-m-brand .s { font-size: 12.5px; color: #CBD5E1; }

@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* ==========================================================================
   Product variants: picker chips (product detail) and variant labels (cart, orders)
   ========================================================================== */
.variant-picker { display: flex; flex-direction: column; gap: 12px; }
.variant-picker .vp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.variant-picker .vp-head .label { margin: 0; }
.variant-picker .vp-selected { font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 6px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-align: left;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.variant-chip img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; margin-left: -6px; }
.variant-chip:hover:not(:disabled) { border-color: var(--brand); }
.variant-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.variant-chip.is-selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand); }
.variant-chip.is-out { cursor: not-allowed; color: var(--muted); background: var(--surface); border-style: dashed; }
.variant-chip.is-out .vc-name { text-decoration: line-through; }
.variant-chip .vc-out { font-size: 11px; font-weight: 700; color: var(--accent); text-decoration: none; }
.variant-picker .vp-hint { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
/* These boxes use display:flex, so `hidden` needs restating */
.variant-picker .vp-hint[hidden], [data-vp-grosir][hidden] { display: none !important; }
.variant-picker.needs-choice .variant-chips { animation: vp-shake .4s ease; }
@keyframes vp-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .variant-picker.needs-choice .variant-chips { animation: none; } }
.variant-picker.is-compact .variant-chip { min-height: 38px; padding: 5px 12px; font-size: 13.5px; }
[data-vp-submit].is-waiting { opacity: .8; }
.pc-from { font-size: .72em; font-weight: 600; color: var(--muted); }

/* Variant label under a product name (cart, checkout, orders) */
.variant-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.variant-tag i { font-size: 11px; color: var(--muted); }

