/* ==========================================================================
   ARTOBE — portal de pedidos B2B — design tokens
   Shape rule: controles interactivos (botones, chips, badges, stepper) =
   radio píldora. Contenedores (tarjetas, imágenes, inputs, paneles, tablas)
   = radio 0. Un solo acento de marca para acciones; los colores de estado
   son funcionales y se usan únicamente en badges de pedido.
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-display: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;

  --bg: #f5f6fa;
  --bg-elevated: #ffffff;
  --bg-sunken: #eceef4;
  --ink: #14151d;
  --ink-soft: #52555f;
  --ink-faint: #82858f;
  --line: #dfe1e8;
  --line-strong: #b7bac4;
  --brand: #1973ce;
  --accent: #1973ce;
  --accent-decor: #2f8fe0;
  --accent-on: #ffffff;
  --focus-ring: #1973ce;

  --status-sent: #55565c;
  --status-progress: #9a6b12;
  --status-delivered: #2f7a4f;
  --status-cancelled: #a83a3a;

  --shadow-soft: 0 1px 2px rgba(30, 20, 15, 0.06), 0 12px 32px -16px rgba(30, 20, 15, 0.18);
  --shadow-panel: 0 8px 24px -12px rgba(20, 15, 10, 0.22);

  --radius-pill: 999px;
  --radius-sharp: 0px;

  --container: 1400px;
  --topnav-h: 68px;

  /* Escala de la interfaz en escritorio (ver el bloque del final del archivo). */
  --ui-scale: 0.8;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}


/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; max-width: 100%; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

html {
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

.visually-hidden {
  position: absolute; left: -9999px;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 768px) {
  .container { padding-inline: 2.5rem; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lede { color: var(--ink-soft); font-size: 1rem; }

.mono { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-on); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black 0%); }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); }

.btn-block { width: 100%; }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.8125rem; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.0625rem; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  color: var(--ink);
  position: relative;
  transition: background 0.2s var(--ease-out);
}
.btn-icon:hover { background: var(--bg-sunken); }
.btn-icon--bordered { border: 1px solid var(--line-strong); }

/* ==========================================================================
   Brand mark
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
}
.brand--on-dark { color: #ffffff; }

.brand__logo {
  height: 24px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
@media (min-width: 768px) {
  .brand__logo { height: 28px; }
}

.brand__long, .brand__short {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__short { display: none; }
@media (max-width: 480px) {
  .brand__long { display: none; }
  .brand__short { display: inline; }
}

/* ==========================================================================
   App shell / topnav
   ========================================================================== */

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  height: var(--topnav-h);
}
.topnav .brand { color: #fff; }
.topnav .btn-icon { color: #fff; }
.topnav .btn-icon:hover { background: rgba(255, 255, 255, 0.14); }
.topnav .cart-badge { background: #fff; color: var(--brand); }
.topnav :focus-visible { outline-color: #fff; }
.topnav__account { border-left-color: rgba(255, 255, 255, 0.25); }
.topnav__account-name { color: #fff; }
.topnav__account-sub { color: rgba(255, 255, 255, 0.65); }
.topnav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.topnav__links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
}
@media (min-width: 900px) {
  .topnav__links { display: flex; }
}
.topnav__links a {
  display: flex;
  align-items: center;
  height: 100%;
  padding-inline: 0.9rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.topnav__links a:hover { color: #fff; }
.topnav__links a.is-active { color: #fff; border-color: #fff; font-weight: 600; }

.topnav__center {
  flex: 1;
  display: flex;
  justify-content: center;
}
@media (min-width: 900px) {
  .topnav__center { display: none; }
}

.topnav__actions { display: flex; align-items: center; gap: 0.25rem; }

.topnav__account {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--line);
  font-size: 0.8125rem;
}
@media (min-width: 700px) {
  .topnav__account { display: flex; }
}
.topnav__account-name { font-weight: 600; line-height: 1.15; }
.topnav__account-sub { color: var(--ink-faint); line-height: 1.15; }

.nav-toggle { display: inline-flex; }
@media (min-width: 900px) { .nav-toggle { display: none; } }

.search-toggle { display: none; }

@media (max-width: 767px) {
  /* Header compacto: hamburguesa (izq) / marca centrada / lupa (der), fijo arriba */
  .topnav .container { justify-content: flex-start; gap: 0.25rem; }
  .topnav .brand { flex: 1; justify-content: center; }
  .topnav__account { display: none !important; }
  .topnav .logout-toggle { display: none; }
  .topnav [data-switch-client] { display: none; }
  .search-toggle { display: inline-flex; }
}

/* Mobile drawer (nav) */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 50; visibility: hidden;
}
.mobile-drawer__scrim {
  position: absolute; inset: 0;
  background: rgba(10, 8, 6, 0.4);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.mobile-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(85vw, 340px);
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  display: flex; flex-direction: column; gap: 2rem;
}
.mobile-drawer.is-open { visibility: visible; }
.mobile-drawer.is-open .mobile-drawer__scrim { opacity: 1; }
.mobile-drawer.is-open .mobile-drawer__panel { transform: translateX(0); }
.mobile-drawer__links { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-drawer__links a {
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.mobile-drawer__foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; }
@media (prefers-reduced-motion: reduce) {
  .mobile-drawer__panel, .mobile-drawer__scrim { transition: none; }
}

/* ==========================================================================
   Footer (slim, app-style)
   ========================================================================== */

.app-footer {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem;
  margin-top: auto;
}
.app-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.app-footer a { color: var(--ink-faint); }
.app-footer a:hover { color: var(--ink-soft); }
.app-footer__links { display: flex; gap: 1.25rem; }

/* ==========================================================================
   Login
   ========================================================================== */

.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .login-screen { grid-template-columns: 0.95fr 1.05fr; }
}

.login-aside {
  background: var(--brand);
  color: #f4f4f2;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}
@media (min-width: 900px) {
  .login-aside { padding: 3.5rem; min-height: 100dvh; }
}

.login-aside__logo-link { display: inline-block; }
.login-aside__logo { height: 34px; width: auto; display: block; }
@media (min-width: 900px) {
  .login-aside__logo { height: 44px; }
}

.login-aside__tag {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1.25rem;
  max-width: 34ch;
}
.login-aside__brands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: auto;
  padding-top: 2rem;
}
@media (max-width: 899px) {
  .login-aside__brands { display: none; }
}
.login-aside__brands span {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem 3rem;
}
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 1.75rem; margin-bottom: 0.4rem; }
.login-card > .lede { margin-bottom: 2rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
.field input {
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  padding: 0.85rem 1rem;
  font-size: 0.9375rem;
}
.field input:focus-visible { outline-offset: 1px; }
.field-password { position: relative; }
.field-password input { padding-right: 2.75rem; }
.field-password__toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}
.field-row a { font-size: 0.8125rem; color: var(--ink-soft); }
.field-row a:hover { color: var(--ink); text-decoration: underline; }

.login-card__demo-note {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.login-ok {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid color-mix(in srgb, #2e9e5b 45%, transparent);
  background: color-mix(in srgb, #2e9e5b 12%, transparent);
  color: #2e9e5b;
  font-size: 0.9rem;
  line-height: 1.4;
}

.order-panel__nota {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted, #6b7280);
  padding: 0.35rem 0 0.75rem;
}

.login-error {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid color-mix(in srgb, #e5484d 45%, transparent);
  background: color-mix(in srgb, #e5484d 12%, transparent);
  color: #e5484d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.login-card__help {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.role-toggle { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.role-toggle .chip { flex: 1; justify-content: center; text-align: center; }

/* ==========================================================================
   Selección de cliente (vendedora) — mismo lenguaje visual que el login
   ========================================================================== */

.client-select-card { width: 100%; max-width: 460px; }
.client-select-card h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.client-select-card > .lede { margin-bottom: 1.5rem; }

.client-select-card__user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.client-select-card__user b { color: var(--ink-soft); font-weight: 600; }
.client-select-card__user button { font-size: 0.8125rem; color: var(--ink-soft); flex-shrink: 0; }
.client-select-card__user button:hover { color: var(--ink); text-decoration: underline; }

.client-search { position: relative; margin-bottom: 1.25rem; }
.client-search i {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 1.1rem;
}
.client-search input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  font-size: 0.9375rem;
}
.client-search input:focus-visible { outline-offset: 1px; }

.client-list {
  border: 1px solid var(--line);
  max-height: min(50vh, 420px);
  overflow-y: auto;
}
.client-option {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s var(--ease-out);
}
.client-option:last-child { border-bottom: none; }
.client-option:hover, .client-option:focus-visible { background: var(--bg-sunken); }
.client-option__name { font-weight: 600; font-size: 0.9375rem; }
.client-option__meta { font-size: 0.8125rem; color: var(--ink-faint); }

/* ==========================================================================
   Page head (pedido / mis-pedidos)
   ========================================================================== */

.page-head { padding-block: 1.75rem 1.25rem; }
.page-head h1 { font-size: clamp(1.5rem, 1.8vw + 1rem, 2rem); margin-bottom: 0.35rem; }

.account-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin-top: 0.6rem;
}
.account-strip strong { color: var(--ink-soft); font-weight: 600; }


/* ==========================================================================
   Buscador + filtros de marca (nuevo pedido)
   ========================================================================== */

.order-toolbar {
  position: sticky;
  top: var(--topnav-h);
  z-index: 30;
  background: var(--bg);
  padding-block: 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
}

.search-bar {
  position: relative;
  margin-bottom: 1rem;
}
.search-bar i {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 1.15rem;
}
.search-bar input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1.0625rem;
}
.search-bar input:focus-visible { outline-offset: 1px; }
.search-bar__clear {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}
.search-bar__clear.is-visible { display: inline-flex; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: center;
}

.brand-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 100%;
  min-width: 0;
}
.brand-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }

.category-select {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
}
@media (min-width: 640px) {
  .brand-chips { flex: 1 1 auto; }
  .category-select { flex: 0 1 auto; width: auto; }
}

.results-meta {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  padding-block: 1rem 0.5rem;
}

/* ==========================================================================
   Layout: catálogo + panel de pedido
   ========================================================================== */

.order-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  padding-block: 1rem 3rem;
}
@media (min-width: 1100px) {
  .order-layout { grid-template-columns: 1fr 380px; }
}

/* ==========================================================================
   Product grid + quick-add card
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}
@media (min-width: 1360px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.product-card__media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }

.product-card__body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.product-card__brand {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}
.product-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}
.product-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}
.product-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.product-card__price { font-weight: 700; font-size: 1rem; }

.product-card__qty-group { display: flex; align-items: center; gap: 0.5rem; }
.product-card__remove { display: none; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  height: 2.25rem;
}
.qty-stepper button {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.qty-stepper button:hover { color: var(--accent); }
.qty-stepper__value {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  -moz-appearance: textfield;
}
.qty-stepper__value::-webkit-outer-spin-button,
.qty-stepper__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-stepper__value:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-on);
  padding: 0.55rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}
.add-btn:hover { background: color-mix(in srgb, var(--accent) 88%, black 0%); }
.add-btn:active { transform: scale(0.96); }

/* ==========================================================================
   Lista de productos en celular: fila horizontal compacta (info a la
   izquierda, imagen a la derecha), estilo lista con separadores en vez de
   tarjetas con caja. Tablet (>=768px) y escritorio conservan el grid de
   tarjetas de arriba sin cambios.
   ========================================================================== */
@media (max-width: 767px) {
  .product-grid { grid-template-columns: 1fr; gap: 0; }

  .product-card {
    flex-direction: row-reverse;
    align-items: stretch;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    min-width: 0;
  }

  .product-card__media {
    width: 8rem;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    border-bottom: none;
    background: transparent;
  }
  .product-card__media img { object-fit: contain; }

  .product-card__body {
    padding: 0.7rem 0.75rem 0.7rem 0;
    justify-content: center;
    gap: 0;
    min-width: 0;
  }
  .product-card__brand { display: none; }
  .product-card__name {
    font-size: 0.875rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .product-card__meta { font-size: 0.75rem; margin-bottom: 0.5rem; }
  .product-card__foot { margin-top: 0; flex-wrap: wrap; row-gap: 0.5rem; }
  .product-card__price { font-size: 1rem; }

  .product-card .add-btn { padding: 0.56rem 1.15rem; font-size: 0.8125rem; gap: 0.4rem; }
  .product-card .qty-stepper { height: 2.625rem; }
  .product-card .qty-stepper button { width: 2.625rem; height: 2.625rem; }
  .product-card .qty-stepper button i { font-size: 1.0625rem; }
  .product-card .qty-stepper__value { width: 2.75rem; min-width: 2.75rem; font-size: 0.9375rem; }

  .product-card__qty-group { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; }
  .product-card__remove { display: inline-flex; align-items: center; }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--ink-soft);
}
.empty-state i { font-size: 2rem; color: var(--ink-faint); margin-bottom: 1rem; display: block; }
.empty-state h3 { font-size: 1.125rem; margin-bottom: 0.4rem; color: var(--ink); }
.empty-state p { max-width: 40ch; margin-inline: auto; font-size: 0.9375rem; }

/* ==========================================================================
   Panel "Mi pedido" (sidebar desktop / bottom sheet mobile)
   ========================================================================== */

.order-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.order-panel__head {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.order-panel__head h2 { font-size: 1.0625rem; }
.order-panel__count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.order-panel__lines {
  padding: 0.25rem 1.25rem;
}
.order-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.order-line__media {
  width: 48px; height: 48px;
  overflow: hidden;
  background: var(--bg-sunken);
  flex-shrink: 0;
}
.order-line__media img { width: 100%; height: 100%; object-fit: cover; }
.order-line__name { font-size: 0.8125rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.2rem; }
.order-line__unit { font-size: 0.75rem; color: var(--ink-faint); }
.order-line__right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.order-line__subtotal { font-weight: 700; font-size: 0.875rem; }
.order-line .qty-stepper { height: 1.85rem; }
.order-line .qty-stepper button { width: 1.85rem; height: 1.85rem; }
.order-line__remove { font-size: 0.75rem; color: var(--ink-faint); }
.order-line__remove:hover { color: var(--accent); }

.order-panel__empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-faint);
}
.order-panel__empty i { font-size: 1.75rem; display: block; margin-bottom: 0.75rem; }
.order-panel__empty p { font-size: 0.875rem; max-width: 28ch; margin-inline: auto; }

.order-panel__foot {
  border-top: 1px solid var(--line);
  padding: 1.1rem 1.25rem 1.35rem;
}
.order-panel__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.order-panel__total span:first-child { font-size: 0.9375rem; color: var(--ink-soft); }
.order-panel__total strong { font-family: var(--font-display); font-size: 1.5rem; }

.order-success { padding: 2.5rem 1.5rem; text-align: center; }
.order-success i { font-size: 2.5rem; color: var(--accent); margin-bottom: 1rem; display: block; }
.order-success h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.order-success p { color: var(--ink-soft); font-size: 0.9375rem; margin-bottom: 1.5rem; }
.order-success__actions { display: flex; flex-direction: column; gap: 0.6rem; }

/* Mobile floating bar + bottom sheet behaviour */
.order-bar {
  display: none;
}
@media (max-width: 1099px) {
  .order-layout > .order-panel { display: none; }

  .order-bar {
    display: flex;
    position: fixed;
    left: 1rem; right: 1rem; bottom: 1rem;
    z-index: 45;
    background: var(--ink);
    color: #fff;
    padding: 0.9rem 1.1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-panel);
  }
  .order-bar.is-hidden { display: none; }
  .order-bar__info { display: flex; flex-direction: column; }
  .order-bar__count { font-size: 0.75rem; color: rgba(244,244,242,0.65); }
  .order-bar__total { font-family: var(--font-display); font-size: 1.125rem; }
  .order-bar .btn-primary { background: var(--accent-decor); color: #fff; }

  .order-sheet {
    position: fixed;
    inset: 0;
    z-index: 55;
    visibility: hidden;
  }
  .order-sheet.is-open { visibility: visible; }
  .order-sheet__scrim {
    position: absolute; inset: 0;
    background: rgba(10,8,6,0.45);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
  }
  .order-sheet.is-open .order-sheet__scrim { opacity: 1; }
  .order-sheet__panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 86dvh;
    background: var(--bg-elevated);
    border-top: 1px solid var(--line);
    transform: translateY(100%);
    transition: transform 0.35s var(--ease-out);
    display: flex;
    flex-direction: column;
  }
  .order-sheet.is-open .order-sheet__panel { transform: translateY(0); }
  @media (prefers-reduced-motion: reduce) {
    .order-sheet__panel, .order-sheet__scrim { transition: none; }
  }

  /* La hoja inferior es un overlay de altura fija (86dvh): a diferencia del
     panel de escritorio, acá sí necesita su propio scroll interno para la
     lista de líneas, dejando encabezado y total/botón siempre visibles. */
  .order-sheet__panel .order-panel__lines {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }
}

/* ==========================================================================
   Tabla de pedidos (mis-pedidos)
   ========================================================================== */

.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.orders-table-wrap {
  border: 1px solid var(--line);
  overflow-x: auto;
}
.orders-table { min-width: 720px; }
.orders-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.orders-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  vertical-align: middle;
}
.orders-table tr:last-child td { border-bottom: none; }
.orders-table__actions { display: flex; gap: 0.6rem; justify-content: flex-end; white-space: nowrap; }

@media (max-width: 767px) {
  .orders-table-wrap { display: none; }
}

.orders-cards { display: none; flex-direction: column; gap: 1rem; }
@media (max-width: 767px) {
  .orders-cards { display: flex; }
}
.order-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 0.9rem 1.1rem;
}
.order-card__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.order-card__id { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-faint); }
.order-card__date { font-size: 0.875rem; margin-top: 0.15rem; }
.order-card__total { font-family: var(--font-display); font-size: 1.125rem; margin-bottom: 0.9rem; }
.order-card__actions { display: flex; gap: 0.6rem; }
.order-card__actions .btn { flex: 1; }
.order-card .orders-table__actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  white-space: normal;
}

/* ==========================================================================
   Status badge
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-sunken);
}
.status-badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.status-badge--sent { color: var(--status-sent); }
.status-badge--progress { color: var(--status-progress); }
.status-badge--delivered { color: var(--status-delivered); }
.status-badge--cancelled { color: var(--status-cancelled); }

/* ==========================================================================
   Detalle de pedido (expandible, sin modal)
   ========================================================================== */

[data-toggle] i { transition: transform 0.2s var(--ease-out); }
[data-toggle].is-open i { transform: rotate(180deg); }

.order-detail-row td { padding: 0 !important; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.order-detail { padding: 0.5rem 1.25rem; }
.order-detail .order-line:first-child { border-top: none; }
.order-detail__author {
  padding-block: 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}
.order-detail__author strong { color: var(--ink-soft); font-weight: 600; }

.order-detail__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 1rem;
  font-size: 0.9375rem;
}
.order-detail__total strong { font-family: var(--font-display); font-size: 1.25rem; }

.order-card > [data-detail] {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.order-card > [data-detail] .order-detail { padding: 0; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  z-index: 70;
  box-shadow: var(--shadow-soft);
  max-width: calc(100vw - 2rem);
}
.toast svg, .toast i { color: var(--accent-decor); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 0.15s linear; }
}

/* ==========================================================================
   Cart nav badge
   ========================================================================== */

.cart-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding-inline: 3px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-on);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.cart-badge.is-empty { display: none; }

/* ==========================================================================
   Ajustes móviles: targets táctiles más grandes y sin zoom automático de
   iOS en inputs/selects (que exige font-size >= 16px al enfocar).
   ========================================================================== */

@media (max-width: 767px) {
  .btn-icon { width: 2.75rem; height: 2.75rem; }

  .qty-stepper { height: 2.5rem; }
  .qty-stepper button { width: 2.5rem; height: 2.5rem; }
  .qty-stepper__value { font-size: 1rem; }

  .field input,
  .category-select,
  .search-bar input { font-size: 16px; }

  .chip { padding: 0.6rem 1.05rem; }
}

/* ==========================================================================
   En celular el catalogo se filtra por marca y por el buscador: el desplegable
   de categoria se saca para dejar la barra mas simple. Se apunta al atributo
   [data-category-select] y no a la clase, porque Mis pedidos reutiliza
   .category-select para el filtro por estado, que si se mantiene.
   ========================================================================== */

@media (max-width: 767px) {
  .filter-row [data-category-select] { display: none; }
}


/* ==========================================================================
   Escala de la interfaz en escritorio

   El portal se veia demasiado grande al 100% de zoom del navegador. Esto lo
   achica de forma proporcional -tipografia, espaciados, imagenes y bordes por
   igual- hasta el tamanio que antes daba poner el navegador al 80%. No cambia
   la maquetacion: solo su escala.

   Aplica de 900 px para arriba, que es el ancho a partir del cual el portal ya
   usa el diseno de escritorio (menu superior en vez de hamburguesa). En celular
   no cambia nada.

   El ajuste de dvh es necesario porque las unidades de alto de pantalla no se
   achican junto con el zoom; sin dividirlas, los bloques que deben ocupar la
   pantalla entera quedarian al 80% de alto.
   ========================================================================== */

@media (min-width: 900px) {
  html { zoom: var(--ui-scale); }

  .app-shell,
  .login-screen,
  .login-aside { min-height: calc(100dvh / var(--ui-scale)); }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .order-sheet__panel { max-height: calc(86dvh / var(--ui-scale)); }
}
