/* "New booking experience" — a flatter, faster-scanning alternative to the
   interactive SVG floor plan (see warehouse-map.css). Scoped entirely under
   .bv2 with its own accent so it doesn't affect the rest of the site, which
   keeps its amber brand accent. Toggled in from StorageWizard's map step. */

.bv2 {
  --bv2-accent: #4f8ff0;
  --bv2-accent-bg: rgba(79, 143, 240, 0.14);
  --bv2-accent-border: rgba(79, 143, 240, 0.45);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  padding: var(--sp-5);
}

.bv2-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4);
}
.bv2-toolbar .field { margin: 0; }

.bv2-legend { display: flex; gap: var(--sp-4); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.bv2-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.bv2-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.bv2-dot.available { background: var(--status-available); }
.bv2-dot.selected { background: var(--bv2-accent); }
.bv2-dot.occupied { background: var(--status-occupied); }

.bv2-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; margin-bottom: var(--sp-4);
  max-height: 520px; overflow-y: auto; padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) {
  /* Smaller inner-scroll viewport on phones — combined with the aisle
     filter/search above, this keeps an unfiltered large zone from turning
     into an oversized nested-scroll box that fights the page's own scroll. */
  .bv2-grid { max-height: 360px; grid-template-columns: repeat(3, 1fr); }
}
.bv2-cell {
  /* Explicit height rather than `aspect-ratio` — some mobile WebKit builds
     (older iOS Safari in particular) have shipped `aspect-ratio` support
     with bugs where a grid item's painted box and its actual tap/hit-test
     box can disagree, which reads to a user as "the button is there but
     tapping it does nothing." A fixed height is universally reliable and
     also guarantees a real touch target: 46px clears Apple's own 44pt
     minimum recommended tap-target size, so a cell is never too small to
     reliably tap even on a small phone screen with 3 columns. */
  position: relative; height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  background: var(--surface-1); color: var(--text-0); font-size: 11.5px; font-weight: 600;
  font-family: var(--font-mono); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.15s ease, color 0.15s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
  /* Removes the ~300ms tap delay / accidental double-tap-zoom some mobile
     browsers apply by default to elements without this hint — selecting a
     pallet position should register on the first tap. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 480px) {
  .bv2-cell { height: 50px; font-size: 12px; }
}
.bv2-cell.available:hover:not(:disabled) {
  border-color: var(--bv2-accent); background: var(--bv2-accent-bg); color: var(--bv2-accent);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(79, 143, 240, 0.28), 0 0 0 1px var(--bv2-accent-border);
  z-index: 1;
}
.bv2-cell.available:active:not(:disabled) { transform: translateY(-1px) scale(1.02); }
.bv2-cell.selected {
  border-color: var(--bv2-accent); background: var(--bv2-accent); color: #06101f; font-weight: 700;
  box-shadow: 0 0 0 1px var(--bv2-accent), 0 4px 14px rgba(79, 143, 240, 0.4);
  animation: bv2-cell-pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bv2-cell.selected:hover:not(:disabled) { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 20px rgba(79, 143, 240, 0.5), 0 0 0 1px var(--bv2-accent); }
.bv2-cell.selected::after {
  content: "✓"; position: absolute; top: -6px; right: -6px; width: 15px; height: 15px; border-radius: 50%;
  background: #06101f; color: var(--bv2-accent); font-size: 9px; font-weight: 800; line-height: 15px; text-align: center;
  box-shadow: 0 0 0 2px var(--bv2-accent);
  /* Purely decorative — must never intercept a tap meant for an adjacent
     cell in the grid, since its negative offset pushes it slightly outside
     this cell's own box into the gap between cells. */
  pointer-events: none;
}
@keyframes bv2-cell-pop { 0% { transform: scale(0.86); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .bv2-cell, .bv2-cell.selected { animation: none; transition: border-color 0.12s ease, background 0.12s ease; transform: none !important; } }
/* Unavailable states use the app's existing "de-emphasized" text tone
   (--text-3 — the same muted color used for secondary labels elsewhere,
   e.g. .wh-aisle-label, .zoom-pct) plus a flatter surface and disabled
   cursor to read as inactive. Deliberately NOT also multiplying the whole
   element by opacity on top of that: --text-3 is already dim, and stacking
   opacity on an already-dim color compounds against the dark surface
   behind it, crushing the position code to near-unreadable — especially
   on a phone screen, where the majority of a real zone's cells are
   occupied/reserved and so render this way by default. */
.bv2-cell.occupied, .bv2-cell.reserved, .bv2-cell.blocked, .bv2-cell.maintenance {
  color: var(--text-3); background: var(--surface-2); cursor: not-allowed;
}

.bv2-aisles { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-5); }
.bv2-aisle-pill {
  flex: 1; min-width: 140px; text-align: center; padding: 10px 14px; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-2); background: var(--surface-1);
}

/* ---- Aisle quick-filter + code search (large zones can be hundreds of
   positions — this is what turns that into a manageable, tap-friendly
   list on a phone) ---- */
.bv2-aisle-filters { margin-bottom: var(--sp-3); }
.bv2-aisle-pill-btn {
  cursor: pointer; font-weight: 600; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.bv2-aisle-pill-btn:hover { border-color: var(--bv2-accent); color: var(--bv2-accent); }
.bv2-aisle-pill-btn.active {
  border-color: var(--bv2-accent); background: var(--bv2-accent-bg); color: var(--bv2-accent);
  box-shadow: inset 0 0 0 1px var(--bv2-accent-border);
}
.bv2-search-row { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.bv2-search-input { max-width: 280px; flex: 1; }
.bv2-search-input:focus { border-color: var(--bv2-accent); box-shadow: 0 0 0 3px var(--bv2-accent-bg); }
.bv2-search-count { font-size: 12px; white-space: nowrap; }
@media (max-width: 480px) {
  .bv2-aisle-pill { min-width: 0; padding: 7px 10px; font-size: 11px; }
  .bv2-search-input { max-width: none; }
}

.bv2-selected-panel { border-top: 1px solid var(--border-1); padding-top: var(--sp-4); }
.bv2-selected-head { margin-bottom: var(--sp-4); }
.bv2-spec-row { display: flex; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.bv2-spec { flex: 1; background: var(--surface-2); border: 1px solid var(--border-1); border-radius: var(--radius-sm); padding: 12px 14px; }
.bv2-spec .k { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.bv2-spec .v { font-size: 15px; font-weight: 700; color: var(--text-0); }

.bv2-breakdown {
  border: 1px solid var(--border-1); border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 10px 14px; margin-bottom: var(--sp-4); max-height: 180px; overflow-y: auto;
}
.bv2-breakdown-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin-bottom: 6px; }
.bv2-breakdown-row {
  display: flex; justify-content: space-between; font-size: 13px; color: var(--text-1);
  padding: 5px 0; border-top: 1px solid var(--border-1);
}
.bv2-breakdown-row:first-of-type { border-top: none; }

.bv2-price-row {
  display: flex; justify-content: space-between; align-items: baseline; margin: var(--sp-4) 0;
  padding-top: var(--sp-3); border-top: 1px solid var(--border-1); font-size: 14px; color: var(--text-1);
}
.bv2-price-row strong { font-size: 20px; color: var(--text-0); }

.bv2-cta { background: var(--bv2-accent); border-color: var(--bv2-accent); color: #fff; }
.bv2-cta:hover:not(:disabled) { background: #3c78e0; border-color: #3c78e0; }

.bv2-view-toggle {
  display: inline-flex; border: 1px solid var(--border-2); border-radius: 20px; padding: 3px; gap: 2px;
}
.bv2-view-toggle button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 16px; font-size: 12.5px;
  font-weight: 600; color: var(--text-2); cursor: pointer;
}
.bv2-view-toggle button.active { background: var(--surface-3); color: var(--text-0); }

/* ---- Storage details (collected once, after storage is picked) ---- */
.bsd-panel { border-left: 3px solid var(--accent); }
.bsd-panel .form-row { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .bsd-panel .form-row { grid-template-columns: 1fr; } }
.bsd-readonly {
  border: 1px solid var(--border-1); border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 9px 12px; font-size: 14px; font-weight: 700; color: var(--text-0);
}
.bsd-heading {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-family: var(--font-display); font-size: 16.5px; letter-spacing: 0.01em; color: var(--text-0);
}
.bsd-heading-icon {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; background: var(--accent-bg); color: var(--accent-strong);
}
/* Storage details' chip buttons (duration/handling/temperature) run smaller
   and tighter than the site-wide .chip-option default — this panel packs
   several chip rows close together, so oversized buttons ate a lot of
   vertical space and felt heavy relative to the rest of the form. */
.bsd-panel .chip-option { padding: 6px 12px; font-size: 12.5px; border-radius: 16px; }
.bsd-panel .chip-select { gap: 6px; }
.bsd-duration-chips .chip-option { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 68px; padding: 6px 10px; text-align: center; }
.bsd-save-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--status-available); background: var(--status-available-bg); padding: 1px 6px; border-radius: 8px;
}
.bsd-weight-input { max-width: 200px; }
.bsd-custom-duration { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bsd-custom-duration .input { max-width: 200px; }
@media (max-width: 480px) {
  .bsd-panel .chip-option { padding: 5px 10px; font-size: 12px; }
  .bsd-duration-chips .chip-option { min-width: 58px; padding: 5px 8px; }
}

/* ---- Global icons-in-labels + interactivity for the booking wizard ---- */
.wiz .field label { display: inline-flex; align-items: center; gap: 6px; }
.wiz .field label svg { color: var(--accent); flex-shrink: 0; }
.wiz .input, .wiz .select, .wiz .textarea { transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease; }
.wiz .input:focus, .wiz .select:focus, .wiz .textarea:focus { box-shadow: 0 0 0 3px var(--accent-bg); }
.wiz .chip-option { transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease; }
.wiz .chip-option:hover { transform: translateY(-1px); }
.wiz .chip-option.selected { font-weight: 700; }
.wiz .btn { transition: all 0.15s ease, transform 0.12s ease; }
.wiz .btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(226,166,59,0.28); }

/* ---- Stepper: bold active state + filling progress connector ---- */
.wiz .step-num { transition: all 0.2s ease; }
.wiz .step.active .step-num { box-shadow: 0 0 0 4px var(--accent-bg); transform: scale(1.08); }
.wiz .step-label { display: inline-flex; align-items: center; gap: 4px; }
.wiz .step-connector { position: relative; overflow: hidden; }
.wiz .step-connector.done { background: var(--accent); }
/* The base .step-label rule (components.css) hides labels below 720px to
   keep the stepper from overflowing narrow screens. The unconditional
   `.wiz .step-label { display: inline-flex }` above has equal specificity
   and loads later, so it was winning even on mobile and forcing the
   stepper wider than the viewport — this restores the responsive hide. */
@media (max-width: 720px) { .wiz .step-label { display: none; } }

/* ---- Step content transition ---- */
.wiz-anim-in { animation: wiz-fade-slide-in 0.35s ease both; }
@keyframes wiz-fade-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .wiz-anim-in { animation: none; }
}

/* ---- Facility location banner ---- */
.fbn {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin-bottom: var(--sp-4);
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--radius-md);
}
.fbn-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bv2-accent-bg, rgba(79,143,240,0.14)); color: var(--bv2-accent, #4f8ff0);
}
.fbn-name { font-family: var(--font-display); font-size: 16px; color: var(--text-0); letter-spacing: 0.02em; }
.fbn-address { font-size: 12.5px; color: var(--text-2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.fbn-desc { font-size: 13px; color: var(--text-2); margin: 6px 0 0; max-width: 720px; }

/* ---- Interactive facility floor plan (zone picker) ---- */
.ffp { margin-bottom: var(--sp-5); }
.ffp-header { margin-bottom: var(--sp-3); }
.ffp-floor {
  display: flex; gap: 10px; align-items: stretch; border: 1px solid var(--border-1); border-radius: var(--radius-md);
  padding: 20px; background: var(--bg-1); min-height: 400px;
  background-image: linear-gradient(var(--border-1) 1px, transparent 1px), linear-gradient(90deg, var(--border-1) 1px, transparent 1px);
  background-size: 22px 22px;
}
.ffp-zones { display: flex; gap: 14px; flex: 1; min-width: 0; }
.ffp-zone-block {
  display: flex; flex-direction: column; text-align: left; min-width: 210px; padding: 22px 20px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-1);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; position: relative;
}
.ffp-zone-block:hover { border-color: var(--bv2-accent, #4f8ff0); }
.ffp-zone-block.active { border-color: var(--bv2-accent, #4f8ff0); background: var(--bv2-accent-bg, rgba(79,143,240,0.14)); box-shadow: 0 0 0 1px var(--bv2-accent, #4f8ff0); }
.ffp-zone-type { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bv2-accent, #4f8ff0); margin-bottom: 4px; }
.ffp-zone-name { font-family: var(--font-display); font-size: 15px; color: var(--text-0); margin-bottom: 6px; }
.ffp-zone-blurb { font-size: 12px; color: var(--text-2); margin: 0 0 12px; flex: 1; }
.ffp-zone-stats { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-1); padding-top: 10px; }
.ffp-stat { display: flex; justify-content: space-between; font-size: 11.5px; }
.ffp-stat .k { color: var(--text-3); }
.ffp-stat .v { color: var(--text-1); font-weight: 600; }
.ffp-selected-tag {
  position: absolute; top: -9px; right: 10px; background: var(--bv2-accent, #4f8ff0); color: #fff;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 10px;
}
.ffp-dock {
  width: 108px; flex-shrink: 0; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.ffp-dock-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); text-align: center; writing-mode: vertical-rl; transform: rotate(180deg); }
.ffp-dock-doors { display: flex; flex-direction: column; gap: 3px; }
.ffp-dock-door { width: 22px; height: 5px; background: var(--status-reserved); border-radius: 1px; opacity: 0.6; }

@media (max-width: 860px) {
  .ffp-floor { flex-direction: column; }
  .ffp-zones { flex-direction: column; }
  .ffp-dock { width: 100%; flex-direction: row; }
  .ffp-dock-label { writing-mode: horizontal-tb; transform: none; }
  .ffp-dock-doors { flex-direction: row; }
}
