/* ============================================================
   cotizador.css — "Mi cotización" (js/cotizador.js)

   Va en el inicio y en /merch-personalizado/. Sólo usa tokens, así que
   sigue el tema claro/oscuro. Sin sombras de Tailwind: hairlines.
   ============================================================ */

/* ---------- píldora flotante ----------
   Abajo a la izquierda, encima del botón "Merch!" (que está en
   tokens.css). z-index 94, igual que él: el panel del chat (96) la tapa. */
.cot-pildora {
  position: fixed;
  left: clamp(0.9rem, 3vw, 2rem);
  bottom: calc(clamp(0.9rem, 3vw, 2rem) + 3.9rem);
  z-index: 94;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.7rem 0.8rem 0.7rem 1rem;
  background: var(--texto);
  color: var(--fondo);
  border: 1px solid var(--linea-fuerte);
  border-radius: 999px;
  font-family: var(--f-display); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; line-height: 1;
  cursor: pointer;
  transition: translate var(--dur-media) var(--ease-suave), background-color var(--dur-rapida) var(--ease-suave);
}
.cot-pildora[hidden] { display: none; }
.cot-pildora:hover { translate: 0 -2px; }
.cot-pildora:focus-visible { outline: 2px solid var(--acento-texto); outline-offset: 3px; }
.cot-pildora svg { width: 1.2rem; height: 1.2rem; flex: none; }
.cot-pildora__n {
  display: grid; place-items: center;
  min-width: 1.45rem; height: 1.45rem; padding: 0 0.35rem;
  background: var(--magenta); color: var(--negro);
  border-radius: 999px;
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500;
}
.cot-pildora--salto { animation: cot-salto 520ms cubic-bezier(.16, 1, .3, 1); }
@keyframes cot-salto { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* aviso breve al sumar */
.cot-aviso {
  position: fixed;
  left: clamp(0.9rem, 3vw, 2rem);
  bottom: calc(clamp(0.9rem, 3vw, 2rem) + 7.4rem);
  z-index: 94;
  margin: 0; max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.6rem 0.9rem;
  background: var(--fondo); color: var(--texto);
  border: 1px solid var(--acento-texto);
  font-size: 0.85rem; line-height: 1.35;
  opacity: 0; translate: 0 0.6rem; pointer-events: none;
  transition: opacity var(--dur-media) var(--ease-suave), translate var(--dur-media) var(--ease-suave);
}
.cot-aviso.es-visible { opacity: 1; translate: 0 0; }

/* ---------- el panel ---------- */
.cot {
  border: 1px solid var(--linea-fuerte);
  background: var(--fondo); color: var(--texto);
  padding: 0;
  width: min(42rem, 94vw);
  max-height: 90dvh;
  margin: auto;
}
.cot[open] { display: flex; flex-direction: column; }
.cot::backdrop { background: oklch(0 0 0 / 0.72); }
.cot__cab {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: clamp(1.1rem, 3vw, 1.7rem) clamp(1.1rem, 3vw, 1.7rem) 1rem;
  border-bottom: 1px solid var(--linea);
}
.cot__cab h3 { font-size: var(--t-h4); font-weight: 500; margin: 0.35rem 0 0; }
.cot__x {
  flex: none; display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem;
  border: 1px solid var(--linea); background: var(--fondo);
  color: var(--texto-suave); cursor: pointer;
}
.cot__x:hover { color: var(--acento-texto); border-color: var(--acento-texto); }
.cot__x svg { width: 16px; height: 16px; }
.cot__vacia { padding: 2rem clamp(1.1rem, 3vw, 1.7rem); margin: 0; color: var(--texto-suave); }

.cot__lista { list-style: none; margin: 0; padding: 0 clamp(1.1rem, 3vw, 1.7rem); overflow-y: auto; min-height: 0; }
.cot__fila {
  display: grid; grid-template-columns: 3.6rem 1fr auto auto; gap: 0.9rem; align-items: center;
  padding: 0.9rem 0; border-bottom: 1px solid var(--linea);
}
.cot__foto { width: 3.6rem; aspect-ratio: 1; background: var(--blanco); overflow: hidden; }
.cot__foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cot__nombre { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 1rem; line-height: 1.2; }
.cot__sub { margin: 0.2rem 0 0; font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--texto-tenue); }
.cot__cant { display: inline-flex; align-items: stretch; border: 1px solid var(--linea-fuerte); }
.cot__cant button {
  width: 2.1rem; background: none; border: 0; color: var(--texto); font-size: 1.1rem; cursor: pointer;
}
.cot__cant button:hover { background: var(--superficie); color: var(--acento-texto); }
.cot__cant input {
  width: 3.6rem; text-align: center; background: none; color: var(--texto);
  border: 0; border-inline: 1px solid var(--linea); font-family: var(--f-mono); font-size: 0.9rem;
  -moz-appearance: textfield; appearance: textfield;
}
.cot__cant input::-webkit-outer-spin-button, .cot__cant input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cot__cant input:focus-visible, .cot__cant button:focus-visible { outline: 2px solid var(--acento-texto); outline-offset: -2px; }
.cot__quitar { display: grid; place-items: center; width: 2rem; height: 2rem; background: none; border: 0; color: var(--texto-tenue); cursor: pointer; }
.cot__quitar:hover { color: var(--acento-texto); }
.cot__quitar svg { width: 15px; height: 15px; }

.cot__pie { padding: 1.1rem clamp(1.1rem, 3vw, 1.7rem) clamp(1.1rem, 3vw, 1.7rem); border-top: 1px solid var(--linea); }
.cot__nota { display: block; }
.cot__nota textarea {
  display: block; width: 100%; margin-top: 0.45rem; resize: vertical;
  background: var(--fondo); color: var(--texto);
  border: 1px solid var(--linea-fuerte); padding: 0.7rem 0.8rem;
  font: inherit; font-size: var(--t-small); line-height: 1.45;
}
.cot__nota textarea::placeholder { color: var(--texto-tenue); }
.cot__nota textarea:focus-visible { outline: none; border-color: var(--acento-texto); }
.cot__aclara { margin: 0.8rem 0 0; font-size: 0.78rem; color: var(--texto-tenue); max-width: 60ch; }
.cot__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; margin-top: 1rem; }
.cot__acciones .btn { flex: 1 1 14rem; }
.cot__vaciar { background: none; border: 0; color: var(--texto-suave); font: inherit; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cot__vaciar:hover { color: var(--acento-texto); }
.cot__total { margin: 0.9rem 0 0; font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texto-tenue); }

/* ---------- cantidad y botón dentro de la ficha del catálogo ---------- */
.cat-ficha__sumar { margin-top: 1.4rem; }
.cat-ficha__cantidad { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.cat-ficha__cantidad .cot__cant { flex: none; }
.cat-ficha__cantidad span { font-size: 0.8rem; color: var(--texto-tenue); }
.cat-ficha__sumar .btn { width: 100%; justify-content: center; }
.cat-ficha__sumar .btn + .btn { margin-top: 0.6rem; }

@media (max-width: 560px) {
  .cot__fila { grid-template-columns: 3rem 1fr auto; row-gap: 0.6rem; }
  .cot__foto { width: 3rem; }
  .cot__cant { grid-column: 2 / 3; justify-self: start; }
  .cot__quitar { grid-row: 1; grid-column: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .cot-pildora--salto { animation: none; }
}
