/* ==========================================================================
   The quotation box.

   1. .boxbtn  — the companion of the heart: "put this piece in the box"
   2. the box page — the few things the saved-list styling does not already
      cover (the waiting-for-a-price line, the note field, the leaving card)

   Same design-system tokens as the rest of the storefront, so the heart and the
   box button sit next to each other in light and dark without a second palette.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. the box button (the heart's sibling)
   -------------------------------------------------------------------------- */

.boxbtn {
  --box-size: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  width: var(--box-size);
  height: var(--box-size);
  border: 1px solid var(--ds-border);
  border-radius: var(--radius-full);
  background: var(--ds-glass-bg-strong, var(--ds-surface));
  color: var(--ds-text-muted);
  cursor: pointer;
  transition: color var(--ds-nav-base) var(--ds-nav-ease),
              border-color var(--ds-nav-base) var(--ds-nav-ease),
              background-color var(--ds-nav-base) var(--ds-nav-ease),
              transform var(--ds-nav-base) var(--ds-nav-ease),
              box-shadow var(--ds-nav-base) var(--ds-nav-ease);
  -webkit-tap-highlight-color: transparent;
}

.boxbtn:hover {
  color: var(--ds-primary);
  border-color: var(--ds-primary-line);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}

.boxbtn:focus-visible {
  outline: 2px solid var(--ds-focus-color);
  outline-offset: 2px;
}

.boxbtn-icon {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.boxbtn-icon > svg {
  width: 18px;
  height: 18px;
}

.boxbtn.is-on {
  color: var(--ds-primary);
  border-color: color-mix(in srgb, var(--ds-primary) 46%, var(--ds-border));
  background: color-mix(in srgb, var(--ds-primary) 12%, var(--ds-surface));
}

/* the piece dropping into the box: the lid lifts, then closes */
.boxbtn.is-on .boxbtn-icon {
  animation: boxDrop 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* While the server confirms, the button keeps the state the visitor just gave it:
   a second tap is simply ignored. (Dimming it was the old "…wait…" look — now
   nothing moves under his finger.) */
.boxbtn.is-busy {
  pointer-events: none;
}

@keyframes boxDrop {
  0% { transform: translateY(-3px) scale(.94); }
  60% { transform: translateY(1px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .boxbtn,
  .boxbtn-icon { transition: none; animation: none; }
}

/* on a catalogue card it sits in the same corner as the heart, one step over */
.boxbtn-card {
  position: absolute;
  top: 10px;
  inset-inline-end: 52px;
  z-index: 3;
  --box-size: 34px;
  background: color-mix(in srgb, var(--lu-neutral-0) 88%, transparent);
  backdrop-filter: blur(10px);
}

.boxbtn-card:hover { background: var(--lu-neutral-0); }

[data-theme="dark"] .boxbtn-card {
  background: color-mix(in srgb, var(--lu-ink-950) 62%, transparent);
}

[data-theme="dark"] .boxbtn-card:hover {
  background: color-mix(in srgb, var(--lu-ink-950) 82%, transparent);
}

/* on the product page it is a pill, next to the save button */
.boxbtn-pill {
  --box-size: auto;
  width: auto;
  padding: 13px 20px;
  height: auto;
  gap: 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.boxbtn-pill .boxbtn-label { white-space: nowrap; }

/* --------------------------------------------------------------------------
   2. the box page
   -------------------------------------------------------------------------- */

/* the count in the header keeps its seat even at nothing */
.box .favs-stat-value[data-box-count]:empty::after { content: '0'; }

.box-limit-note {
  margin: 20px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ds-text-muted);
}

.box-card-wait {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.box .fav-card.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.box .favs-mail textarea {
  width: 100%;
  min-height: 78px;
  padding: 11px 13px;
  border: 1px solid var(--ds-border);
  border-radius: var(--radius-md, 10px);
  background: var(--ds-surface);
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

.box .favs-mail textarea:focus-visible {
  outline: 2px solid var(--ds-focus-color);
  outline-offset: 1px;
}
