/* ============================================================
   LIBRERIA44 — Cuaderno escolar moderno
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700;9..144,900&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --ink:        #1a1d29;
  --ink-soft:   #3a3f52;
  --ink-mute:   #6c7185;
  --paper:      #faf6ef;
  --paper-2:    #f3ede1;
  --paper-3:    #ebe3d2;
  --rule:       #d9d2c4;
  --rule-soft:  #e6dfd0;
  --coral:      #e30613;
  --coral-deep: #b00510;
  --coral-soft: #fbe0e2;
  --lemon:      #f5d547;
  --lemon-soft: #fbf3c8;
  --leaf:       #4a7c59;
  --leaf-soft:  #e0ebe2;
  --sky:        #3a6db5;

  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans:  'Plus Jakarta Sans', system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 22px;

  --shadow-soft:   0 1px 0 var(--rule), 0 8px 24px -16px rgba(26,29,41,0.18);
  --shadow-card:   0 1px 0 var(--rule), 0 12px 28px -20px rgba(26,29,41,0.25);
  --shadow-pop:    0 24px 80px -24px rgba(26,29,41,0.35), 0 8px 24px -12px rgba(26,29,41,0.18);

  --topbar-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* Fondo: papel rayado sutil tipo cuaderno */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(26,29,41,0.035) 31px,
      rgba(26,29,41,0.035) 32px
    );
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(232,82,60,0.06), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(245,213,71,0.10), transparent 60%);
  z-index: 0;
}
body.no-scroll { overflow: hidden; }

main, header, section, aside, .modal { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

a { color: var(--ink); }

::selection { background: var(--lemon); color: var(--ink); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,246,239,0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.topbar-logo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
  background: #fff;
  image-rendering: -webkit-optimize-contrast;
}
.topbar h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 16px;
  margin-left: 4px;
}

.topbar-actions { display: flex; align-items: center; gap: 18px; }


/* ============================================================
   ANIMACIONES GLOBALES
   ============================================================ */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes card-appear {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes item-slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes item-remove {
  to { opacity: 0; transform: translateX(16px) scale(0.96); max-height: 0; padding: 0; margin: 0; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 56px 32px 24px;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  background: var(--paper-2);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-soft);
}
.hero-tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-soft);
}
.hero h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 18px 0 14px;
  max-width: 880px;
}
.hero h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--coral);
}
.hero h2 .underline {
  position: relative;
  display: inline-block;
}
.hero h2 .underline::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.08em;
  height: 0.3em;
  background: var(--lemon);
  z-index: -1;
  border-radius: 2px;
  transform: skewX(-8deg);
}
.hero p.lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 8px;
}
.hero-steps {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--rule);
}
.hero-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.hero-step strong {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
}
.hero-step-num {
  font-family: var(--mono);
  font-size: 11px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-weight: 700;
}
.hero-step-arrow {
  color: var(--rule);
  font-family: var(--mono);
}

/* Hero: entrada escalonada */
.hero-tag    { animation: rise-in 0.5s ease-out both; }
.hero h2     { animation: rise-in 0.55s ease-out 0.08s both; }
.hero p.lead { animation: rise-in 0.55s ease-out 0.16s both; }
.hero-steps  { animation: rise-in 0.55s ease-out 0.26s both; }

/* ============================================================
   CONTENIDO
   ============================================================ */
.content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 8px 32px 80px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
}
.input-wrap {
  position: relative;
}
.input-wrap::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1d29' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  opacity: 0.6;
  pointer-events: none;
}
#inputBuscar {
  width: 100%;
  padding: 16px 44px 16px 46px;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}
#inputBuscar::placeholder { color: var(--ink-mute); }
#inputBuscar:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(26,29,41,0.08), var(--shadow-soft);
}
.btn-limpiar {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: var(--ink-mute, #888);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s ease;
  padding: 0;
}
.btn-limpiar:hover { opacity: 0.9; }
.btn-limpiar[hidden] { display: none; }


/* ============================================================
   CATEGORÍAS — selector dropdown
   ============================================================ */
.categorias-bar {
  margin-bottom: 20px;
}

.cat-selector {
  display: inline-flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.cat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 18px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.cat-trigger:hover,
.cat-trigger[aria-expanded="true"] {
  border-color: var(--coral);
  color: var(--coral);
}
.cat-trigger.has-active {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}
.cat-arrow {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.cat-trigger[aria-expanded="true"] .cat-arrow {
  transform: rotate(180deg);
}

.cat-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  border: 1.5px solid var(--coral);
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--coral);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}
.cat-clear:hover { background: var(--coral-deep); border-color: var(--coral-deep); }

/* Dropdown */
.cat-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-width: 340px;
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  z-index: 200;
  overflow: hidden;
}

.cat-search-wrap {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.cat-search {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
}
.cat-search:focus { border-color: var(--ink); }

.cat-list {
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.cat-list li {
  padding: 9px 18px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cat-list li:hover { background: var(--coral-soft); color: var(--coral); }
.cat-list li.active {
  background: var(--coral-soft);
  color: var(--coral);
  font-weight: 600;
}
.cat-list li.active::after {
  content: "✓";
  font-size: 12px;
  color: var(--coral);
}
.cat-count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-mute);
  background: var(--paper-2);
  border-radius: 10px;
  padding: 1px 7px;
}
.cat-list li.active .cat-count,
.cat-list li:hover .cat-count {
  background: rgba(232,82,60,0.12);
  color: var(--coral);
}

.cat-empty {
  padding: 16px 18px;
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
  font-family: var(--mono);
}

/* ============================================================
   STATUS
   ============================================================ */
.status {
  text-align: center;
  margin: 12px 0;
  font-size: 13px;
  font-family: var(--mono);
  min-height: 20px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.status.error   { color: var(--coral-deep); }
.status.success { color: var(--leaf); }
.status.loading { color: var(--sky); }
.status.loading::before {
  content: "◐ ";
  display: inline-block;
  animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   GRID DE PRODUCTOS (cards)
   ============================================================ */
.table-wrapper {
  background: transparent;
  box-shadow: none;
  overflow: visible;
  max-height: none;
}
#tablaProductos { display: none; }

.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.producto-card {
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
/* Cards: entrada con stagger CSS */
.producto-card {
  animation: card-appear 0.38s ease-out both;
}
.producto-card:nth-child(1)  { animation-delay: 0.02s; }
.producto-card:nth-child(2)  { animation-delay: 0.05s; }
.producto-card:nth-child(3)  { animation-delay: 0.08s; }
.producto-card:nth-child(4)  { animation-delay: 0.11s; }
.producto-card:nth-child(5)  { animation-delay: 0.14s; }
.producto-card:nth-child(6)  { animation-delay: 0.17s; }
.producto-card:nth-child(7)  { animation-delay: 0.20s; }
.producto-card:nth-child(8)  { animation-delay: 0.23s; }
.producto-card:nth-child(n+9) { animation-delay: 0.26s; }

.producto-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--paper-2) 0%, transparent 40%);
  opacity: 0.5;
  pointer-events: none;
}
.producto-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--ink-soft);
  cursor: pointer;
}
.producto-card.is-in-cart {
  border-color: var(--leaf);
  background: linear-gradient(180deg, var(--leaf-soft) 0%, #fff 60%);
}
.producto-card.is-in-cart::after {
  content: "EN CARRITO";
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  background: var(--leaf);
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
}

.pc-codigo {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.pc-codigo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin-left: 4px;
}

.pc-nombre {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.pc-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  gap: 10px;
}

.pc-precio {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.pc-precio .pc-precio-cents {
  font-size: 14px;
  color: var(--ink-mute);
  font-weight: 500;
}
.pc-precio.is-na {
  font-size: 14px;
  font-family: var(--mono);
  color: var(--ink-mute);
  font-weight: 500;
}

.btn-agregar {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}
.btn-agregar:hover:not(:disabled) {
  background: var(--coral);
  transform: translateY(-1px);
}
.btn-agregar:active { transform: translateY(0); }
.btn-agregar:disabled {
  background: var(--paper-3);
  color: var(--ink-mute);
  cursor: not-allowed;
}
.btn-agregar::before {
  content: "+";
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
}
@keyframes btn-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.93); }
  70%  { transform: translateY(-1px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}
.btn-agregar.pulse {
  animation: btn-pulse 0.32s cubic-bezier(.34,1.56,.64,1);
}

.en-carrito-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--leaf);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.en-carrito-mini::before {
  content: "✓";
  font-family: var(--sans);
  font-size: 13px;
}

/* ============================================================
   PAGINATION + COUNTER
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.pagination button {
  padding: 8px 14px;
  min-width: 38px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pagination button:hover:not(:disabled):not(.active) {
  background: var(--paper-2);
  border-color: var(--rule);
}
.pagination button.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.counter {
  text-align: center;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
}

/* ============================================================
   BOTÓN CARRITO TOP
   ============================================================ */
.btn-carrito {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 12px 18px 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.btn-carrito:hover {
  background: var(--coral);
  transform: translateY(-1px);
}
.carrito-icono {
  display: inline-flex;
  width: 18px;
  height: 18px;
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23faf6ef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/><path d='M3 6h18'/><path d='M16 10a4 4 0 0 1-8 0'/></svg>");
}
.carrito-badge {
  background: var(--coral);
  color: #fff;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  padding: 0 7px;
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.btn-carrito.bump .carrito-badge { transform: scale(1.4); }

/* ============================================================
   CARRITO DRAWER
   ============================================================ */
.carrito-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.carrito-drawer[hidden] { display: none; }
.carrito-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,29,41,0.45);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in  { from { opacity: 0; }   to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; }   to { opacity: 0; } }

/* Carrito: salida */
.carrito-drawer.is-closing .carrito-backdrop {
  animation: fade-out 0.22s ease-in forwards;
}
.carrito-drawer.is-closing .carrito-panel {
  animation: slideOut 0.26s cubic-bezier(.55,0,.8,.45) forwards;
}
@keyframes slideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

.carrito-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 100vw);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 80px -20px rgba(26,29,41,0.4);
  animation: slideIn 0.28s cubic-bezier(.22,.61,.36,1);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    rgba(26,29,41,0.04) 31px,
    rgba(26,29,41,0.04) 32px
  );
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.carrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.carrito-header h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.carrito-header h2::before {
  content: "✎ ";
  color: var(--coral);
  font-family: var(--sans);
}
.carrito-close {
  background: transparent;
  border: 1.5px solid var(--rule);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.carrito-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.carrito-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}
.carrito-vacio {
  text-align: center;
  color: var(--ink-mute);
  padding: 56px 16px;
  font-size: 14px;
  font-family: var(--serif);
  font-style: italic;
}
.carrito-vacio::before {
  content: "☐";
  display: block;
  font-size: 48px;
  color: var(--rule);
  margin-bottom: 12px;
  font-style: normal;
}
.carrito-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px dashed var(--rule);
}
/* Item de carrito: entrada */
.carrito-item {
  animation: item-slide-in 0.22s ease-out both;
}
/* Salida animada via JS: .is-removing */
.carrito-item.is-removing {
  animation: item-remove 0.22s ease-in forwards;
  overflow: hidden;
  pointer-events: none;
}

.ci-info { min-width: 0; grid-column: 1; }
.ci-nombre {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ci-codigo {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-top: 4px;
}
.ci-precio {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.ci-quitar {
  grid-column: 2;
  grid-row: 1;
  background: transparent;
  border: none;
  color: var(--ink-mute);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.ci-quitar:hover { background: var(--coral-soft); color: var(--coral-deep); }

.ci-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.ci-controles {
  display: inline-flex;
  align-items: center;
  background: var(--paper-2);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.ci-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.ci-btn:hover { background: #fff; box-shadow: var(--shadow-soft); }
.ci-cantidad {
  min-width: 38px;
  width: 38px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 4px;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
  cursor: text;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ci-cantidad::-webkit-outer-spin-button,
.ci-cantidad::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ci-cantidad:hover { border-color: rgba(0,0,0,0.12); background: #fff; }
.ci-cantidad:focus {
  outline: none;
  border-color: var(--leaf);
  background: #fff;
}
.ci-subtotal {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}

.carrito-footer {
  padding: 20px 24px 24px;
  border-top: 1.5px solid var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.carrito-subline {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
}
.carrito-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--serif);
  margin-bottom: 4px;
}
.carrito-total > span:first-child {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: var(--mono);
  color: var(--ink-mute);
}
#carritoTotal {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

#btnFinalizar {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 20px -8px rgba(232,82,60,0.6);
}
#btnFinalizar::after {
  content: "→";
  font-size: 18px;
  transition: transform 0.2s ease;
}
#btnFinalizar:hover:not(:disabled) {
  background: var(--coral-deep);
  transform: translateY(-1px);
}
#btnFinalizar:hover:not(:disabled)::after { transform: translateX(4px); }
#btnFinalizar:disabled {
  background: var(--paper-3);
  color: var(--ink-mute);
  cursor: not-allowed;
  box-shadow: none;
}

#btnVaciar {
  font-family: var(--mono);
  font-size: 11px;
  background: transparent;
  color: var(--ink-mute);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 6px;
  align-self: center;
  transition: color 0.15s ease;
}
#btnVaciar:hover { color: var(--coral-deep); }

/* ============================================================
   MODAL CHECKOUT
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,29,41,0.55);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease-out;
}
.modal-content {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.25s cubic-bezier(.22,.61,.36,1);
  border: 1.5px solid var(--rule);
}
@keyframes pop-in  {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes pop-out {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to   { transform: translateY(12px) scale(0.96); opacity: 0; }
}

/* Modal: salida */
.modal.is-closing .modal-backdrop {
  animation: fade-out 0.2s ease-in forwards;
}
.modal.is-closing .modal-content {
  animation: pop-out 0.2s cubic-bezier(.55,0,.8,.45) forwards;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  border: 1.5px solid var(--rule);
  font-size: 18px;
  color: var(--ink);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.modal-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.modal-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.modal-sub {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-sub::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--coral);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Forms */
.form-checkout .field { margin-bottom: 14px; }
.form-checkout .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: 6px;
  font-weight: 600;
}
.field-input, .field-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: all 0.18s ease;
}
.field-input:focus, .field-textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(26,29,41,0.08);
}
.field-textarea { resize: vertical; font-family: var(--sans); }

.checkout-resumen {
  background: var(--paper-2);
  border: 1.5px dashed var(--rule);
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  margin: 18px 0 8px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.checkout-resumen strong {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-left: 6px;
}
.checkout-error {
  background: var(--coral-soft);
  color: var(--coral-deep);
  border: 1px solid var(--coral);
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 13px;
}

#btnEnviarPedido {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.01em;
}
#btnEnviarPedido:hover:not(:disabled) {
  background: var(--coral);
  transform: translateY(-1px);
}

.checkout-exito {
  text-align: center;
  padding: 24px 0 8px;
}
.checkout-exito::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--leaf-soft);
  color: var(--leaf);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  animation: pop-in 0.4s cubic-bezier(.34,1.56,.64,1);
}
.checkout-exito h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.checkout-exito p {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 15px;
}
.checkout-exito p strong {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--lemon);
  padding: 2px 8px;
  border-radius: 4px;
}
.checkout-exito #btnNuevoPedido {
  margin-top: 22px;
  font-family: var(--sans);
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.checkout-exito #btnNuevoPedido:hover { background: var(--coral); }

.estado-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 5px 10px;
  border-radius: 999px;
}
.estado-pendiente   { background: var(--lemon-soft); color: #8a6d00; }
.estado-en_proceso  { background: #e0eaff; color: var(--sky); }
.estado-completado  { background: var(--leaf-soft); color: var(--leaf); }
.estado-cancelado   { background: var(--coral-soft); color: var(--coral-deep); }


.btn-ver {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-ver:hover { background: var(--coral); }

.pedido-detalle h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pedido-detalle h3::before {
  content: "";
  width: 4px;
  height: 14px;
  background: var(--coral);
  border-radius: 2px;
}
.pedido-detalle .grid-data {
  display: grid;
  grid-template-columns: 130px 1fr;
  row-gap: 8px;
  font-size: 14px;
  background: var(--paper-2);
  padding: 14px 16px;
  border-radius: 10px;
}
.pedido-detalle .grid-data span:nth-child(odd) {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  font-weight: 600;
}
.tabla-items {
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.tabla-items th, .tabla-items td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
}
.tabla-items th {
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.tabla-items tfoot th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .topbar { padding: 14px 18px; }
  .topbar h1 { font-size: 20px; }
  .topbar h1 em { display: none; }
.btn-carrito { padding: 10px 14px; }
  .btn-carrito > span:nth-child(2) { display: none; }

  .hero { padding: 32px 18px 16px; }
  .hero h2 { font-size: clamp(28px, 8vw, 40px); }
  .hero p.lead { font-size: 15px; }
  .hero-steps { gap: 14px; }

  .content { padding: 8px 18px 60px; }

  .toolbar { grid-template-columns: 1fr; }

  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .producto-card { padding: 14px 14px 12px; }
  .pc-nombre { font-size: 15px; min-height: 2.4em; }
  .pc-desc { display: none; }
  .pc-precio { font-size: 20px; }
  .pc-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .btn-agregar {
    width: 100%;
    justify-content: center;
    padding: 9px 10px;
    font-size: 12px;
  }

  .form-checkout .field-row { grid-template-columns: 1fr; }
  .modal-content { padding: 28px 22px 24px; border-radius: 18px; }
  .modal-title { font-size: 22px; }

  .cat-trigger {
    padding: 13px 18px 13px 22px;
    font-size: 15px;
    gap: 10px;
  }
  .cat-clear {
    width: 46px;
    font-size: 20px;
  }
}

@media (max-width: 420px) {
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
  .carrito-panel { width: 100vw; }
}

/* ============================================================
   SECCIÓN DE RESULTADOS SIMILARES
   ============================================================ */
.similares-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px dashed var(--border);
}

.similares-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.similares-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.similares-hint {
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
}

.similares-grid {
  opacity: 0.85;
}

.similares-card {
  border-style: dashed;
  border-color: var(--border);
  position: relative;
}

.similares-card::before {
  content: "similar";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--paper-alt);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Éxito checkout: acciones PDF + WhatsApp ─────────────────────────────── */
.exito-acciones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-pdf:hover { opacity: 0.85; }

.whatsapp-status {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  min-height: 1.2em;
}
.whatsapp-enviando { color: var(--ink-mute); }
.whatsapp-ok       { color: #2a7a4b; font-weight: 600; }
.whatsapp-error    { color: #b05500; }

/* ============================================================
   STEPPER EN CARD (cantidad +/−)
   ============================================================ */
.pc-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1.5px solid var(--leaf);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 2px 6px -3px rgba(74,124,89,0.4);
}
.pc-step-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--leaf-soft);
  color: var(--leaf);
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}
.pc-step-btn:hover {
  background: var(--leaf);
  color: #fff;
  transform: scale(1.06);
}
.pc-step-btn:active { transform: scale(0.94); }
.pc-step-qty {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  min-width: 36px;
  width: 36px;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 2px;
  -moz-appearance: textfield;
  appearance: textfield;
  cursor: text;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pc-step-qty::-webkit-outer-spin-button,
.pc-step-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pc-step-qty:hover { border-color: rgba(74,124,89,0.35); background: #fff; }
.pc-step-qty:focus {
  outline: none;
  border-color: var(--leaf);
  background: #fff;
}

/* ============================================================
   MODAL DETALLE PRODUCTO
   ============================================================ */
.modal-producto {
  width: min(540px, 100%);
  padding: 38px 36px 28px;
}
.modal-producto .mp-codigo {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.modal-producto .mp-codigo::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--coral);
}
.modal-producto .mp-nombre {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 12px;
  word-break: break-word;
}
.mp-categoria {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--leaf);
  background: var(--leaf-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 18px;
}
.mp-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--paper-2);
  border-left: 3px solid var(--rule);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin-bottom: 22px;
  white-space: pre-wrap;
}
.mp-desc.is-empty {
  color: var(--ink-mute);
  font-style: italic;
}
.mp-precio-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  padding: 14px 0;
  margin-bottom: 22px;
}
.mp-precio-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.mp-precio {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.mp-acciones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.mp-acciones .btn-primario,
.mp-acciones .mp-add {
  flex: 1;
  min-width: 180px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}
.mp-acciones .btn-primario:hover:not(:disabled),
.mp-acciones .mp-add:hover {
  background: var(--coral);
  transform: translateY(-1px);
}
.mp-acciones .btn-primario:disabled {
  background: var(--paper-3);
  color: var(--ink-mute);
  cursor: not-allowed;
}
.mp-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--leaf);
  border-radius: 999px;
  padding: 5px;
}
.mp-step-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--leaf-soft);
  color: var(--leaf);
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.mp-step-btn:hover {
  background: var(--leaf);
  color: #fff;
  transform: scale(1.06);
}
.mp-step-btn:active { transform: scale(0.94); }
.mp-step-qty {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  min-width: 52px;
  width: 52px;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 4px;
  -moz-appearance: textfield;
  appearance: textfield;
  cursor: text;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mp-step-qty::-webkit-outer-spin-button,
.mp-step-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.mp-step-qty:hover { border-color: rgba(74,124,89,0.35); background: #fff; }
.mp-step-qty:focus {
  outline: none;
  border-color: var(--leaf);
  background: #fff;
}
.mp-subtotal {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.mp-subtotal strong {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-left: 6px;
}

@media (max-width: 540px) {
  .modal-producto { padding: 32px 22px 22px; }
  .modal-producto .mp-nombre { font-size: 22px; }
  .mp-precio { font-size: 26px; }
  .mp-acciones { flex-direction: column-reverse; align-items: stretch; }
  .mp-acciones .mp-stepper { align-self: center; }
}

/* ============================================================
   STOCK BADGES
   ============================================================ */
.pc-stock {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 2px 6px -2px rgba(26,29,41,0.2);
}
.pc-stock-low {
  background: var(--coral);
  color: #fff;
  animation: stock-pulse 2.4s ease-in-out infinite;
}
.pc-stock-out {
  background: var(--ink);
  color: var(--paper);
}
@keyframes stock-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.producto-card .pc-step-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--paper-3);
  color: var(--ink-mute);
}
.producto-card .pc-step-btn[disabled]:hover {
  background: var(--paper-3);
  color: var(--ink-mute);
  transform: none;
}

/* Modal: stock + acciones */
.mp-acciones { flex-direction: column; align-items: stretch; }
.mp-acciones-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.mp-stock {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.mp-stock-low {
  background: var(--coral-soft);
  color: var(--coral-deep);
  border: 1px solid var(--coral);
}
.mp-stock-out {
  background: var(--paper-3);
  color: var(--ink);
  border: 1px solid var(--ink-soft);
}
.mp-stock-ok {
  background: var(--leaf-soft);
  color: var(--leaf);
  border: 1px solid var(--leaf);
}
.mp-step-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--paper-3);
  color: var(--ink-mute);
}
.mp-step-btn[disabled]:hover {
  background: var(--paper-3);
  color: var(--ink-mute);
  transform: none;
}

/* ============================================================
   TOAST (avisos de stock / errores cortos)
   ============================================================ */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: 0 16px 40px -16px rgba(26,29,41,0.5);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: 90vw;
  text-align: center;
}
.toast-host.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-host.toast-warn {
  background: var(--coral);
  color: #fff;
}
.toast-host.toast-error {
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--coral);
}
