:root {
  color-scheme: light;
  --ink: #111216;
  --muted: #666a73;
  --line: #e5e7ec;
  --paper: #f7f7f4;
  --white: #ffffff;
  --red: #b3192a;
  --blue: #2456d6;
  --green: #0f7a3d;
  --gold: #9a6a00;
  --violet: #6650c8;
  --teal: #087f86;
  --shadow: 0 24px 80px rgba(17, 18, 22, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.process-bar {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: 4px;
  overflow: hidden;
  opacity: 0;
  background: rgba(179, 25, 42, 0.12);
  transition: opacity 180ms ease;
}

.process-bar.is-active {
  opacity: 1;
}

.process-bar span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #111216);
  border-radius: 999px;
  transform: translateX(-100%);
}

.process-bar.is-active span {
  animation: process-slide 1.1s ease-in-out infinite;
}

.status-toast {
  pointer-events: auto;
  position: fixed;
  top: calc(env(safe-area-inset-top) + 18px);
  left: 50%;
  right: auto;
  z-index: 50000;
  width: max-content;
  max-width: min(620px, calc(100vw - 28px));
  padding: 14px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  user-select: text;
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.status-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.status-toast.is-success {
  background: #0f7a3d;
}

.status-toast.is-error {
  background: var(--red);
}

.catalog-load-error {
  max-width: min(920px, calc(100vw - 28px));
  margin: 16px auto;
  padding: 18px 20px;
  border: 1px solid rgba(190, 18, 60, 0.24);
  border-radius: 22px;
  color: #7f1d1d;
  background: #fff1f2;
  box-shadow: 0 18px 50px rgba(127, 29, 29, 0.1);
  font-weight: 850;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.catalog-load-error strong {
  display: block;
  margin-bottom: 6px;
  color: #be123c;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.status-toast.is-warning {
  background: #8a5a00;
}

@keyframes process-slide {
  0% {
    transform: translateX(-110%);
  }

  50% {
    transform: translateX(80%);
  }

  100% {
    transform: translateX(260%);
  }
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.catalog-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 68px;
  padding: 14px clamp(18px, 5vw, 70px);
  background: rgba(247, 247, 244, 0.82);
  border-bottom: 1px solid rgba(229, 231, 236, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  width: 136px;
}

.brand img {
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}

.catalog-header nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  color: rgba(17, 18, 22, 0.68);
  font-size: 13px;
  font-weight: 700;
}

.catalog-header nav a {
  transition: color 180ms ease, transform 180ms ease;
}

.catalog-header nav a:hover,
.catalog-header nav [aria-current="page"] {
  color: var(--red);
}

.order-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  transition: background 180ms ease, transform 180ms ease;
}

.order-pill:hover {
  background: var(--red);
  transform: translateY(-2px);
}

.order-pill span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  color: var(--ink);
  background: var(--white);
  border-radius: 999px;
}

.catalog-hero {
  min-height: 38vh;
  display: grid;
  place-items: center;
  padding: clamp(70px, 8vw, 112px) clamp(18px, 6vw, 90px) clamp(30px, 5vw, 58px);
  text-align: center;
}

.hero-copy {
  max-width: 820px;
  animation: rise-in 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-inline: auto;
  margin-bottom: 22px;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 1;
  font-weight: 800;
}

.hero-logo {
  width: min(330px, 68vw);
  margin: 0 auto;
  filter: drop-shadow(0 18px 34px rgba(17, 18, 22, 0.12));
  transform: translateY(0);
  animation: logo-float 5.8s ease-in-out infinite;
}

.catalog-search-panel {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  gap: 14px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto 14px;
  padding: 14px clamp(18px, 5vw, 70px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 226, 239, 0.95);
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(31, 45, 74, 0.1);
  backdrop-filter: blur(18px);
}

.catalog-search-panel label {
  color: #435169;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.catalog-search-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  color: #111827;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 850;
  outline: 0;
}

.catalog-search-panel input:focus {
  border-color: rgba(36, 94, 232, 0.42);
  box-shadow: 0 0 0 4px rgba(36, 94, 232, 0.1);
}

.catalog-selection-bar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 226, 239, 0.95);
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(31, 45, 74, 0.08);
}

.catalog-selection-bar strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.catalog-selection-bar span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.catalog-selection-bar button,
.catalog-select-toggle {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.catalog-selection-bar button:hover,
.catalog-select-toggle:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
}

.catalog-select-toggle {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.catalog-select-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1261ed;
}

.style-card.is-manually-selected {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 22px 48px rgba(37, 99, 235, 0.16);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(170px, auto) repeat(5, minmax(118px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  max-width: 1120px;
  margin-inline: auto;
  padding: 0 clamp(18px, 5vw, 70px) 26px;
}

@media (max-width: 720px) {
  .catalog-search-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-inline: 12px;
    padding: 14px;
  }

  .catalog-selection-bar {
    grid-template-columns: 1fr;
    margin-inline: 12px;
  }
}

.filter-bar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-bar select,
.catalog-check-filter-button,
.import-unlock input,
.import-unlock button,
.clear-filters {
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.catalog-native-filter {
  display: none;
}

.filter-bar label {
  position: relative;
}

.catalog-check-filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

.catalog-check-filter-button::after {
  content: "v";
  color: #5f6d83;
  font-size: 13px;
}

.catalog-check-filter-panel {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d8e1ee;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(13, 28, 52, 0.18);
  text-transform: none;
}

.catalog-check-filter-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 12px;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  text-transform: none;
  cursor: pointer;
}

.catalog-check-filter-panel label:hover {
  background: #f3f7ff;
}

.catalog-check-filter-panel input {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: #1261ed;
}

.import-unlock {
  display: flex;
  gap: 8px;
  align-items: end;
  min-width: 170px;
}

.import-unlock[hidden] {
  display: none;
}

.import-unlock input {
  flex: 0 0 112px;
  width: 112px;
  text-align: center;
  letter-spacing: 4px;
}

.import-unlock button {
  flex: 0 0 auto;
  min-width: 160px;
  padding-inline: 18px;
  white-space: nowrap;
  cursor: pointer;
  color: var(--white);
  background: var(--red);
}

.business-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 18, 22, 0.58);
  backdrop-filter: blur(18px);
}

.business-gate[hidden] {
  display: none;
}

.business-gate-card {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  padding: clamp(22px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(17, 18, 22, 0.26);
  text-align: center;
}

#catalogBusinessGate .business-gate-card {
  background: rgba(255, 255, 255, 0.98) !important;
  background-image: none !important;
  overflow: hidden;
}

#catalogBusinessGate .business-gate-card::before,
#catalogBusinessGate .business-gate-card::after,
#catalogBusinessGate .business-brand-preview::before,
#catalogBusinessGate .business-brand-preview::after,
#catalogBusinessGate .business-gate-actions [data-business-mode]::before {
  content: none !important;
  display: none !important;
}

.business-gate-card p,
.business-pin label {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.business-gate-card h2 {
  margin: 0;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 0.95;
}

.business-gate-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.business-gate button,
.business-pin input {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
}

.business-gate button {
  cursor: pointer;
  color: var(--white);
  background: var(--ink);
}

.business-gate-actions button:nth-child(2),
.business-gate-actions button:nth-child(3) {
  background: var(--red);
}

.business-pin {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.business-pin[hidden] {
  display: none;
}

.business-pin input {
  margin-top: 7px;
  width: 100%;
  color: var(--ink);
  background: var(--white);
  text-align: center;
  letter-spacing: 4px;
}

.business-gate .business-gate-close {
  color: var(--ink);
  background: var(--white);
}

.clear-filters {
  cursor: pointer;
  color: var(--white);
  background: var(--ink);
  transition: background 180ms ease, transform 180ms ease;
}

.clear-filters:hover {
  background: var(--red);
  transform: translateY(-2px);
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1220px;
  margin-inline: auto;
  padding: 0 clamp(18px, 5vw, 70px) clamp(52px, 7vw, 96px);
}

.style-card {
  position: relative;
  cursor: pointer;
  display: grid;
  gap: 16px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(17, 18, 22, 0.06);
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  animation: card-in 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms ease;
}

.new-model-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  padding: 7px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe66d, #ff8a3d);
  color: #3b2100;
  box-shadow: 0 12px 24px rgba(255, 138, 61, .3);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.style-card.is-hidden {
  display: none;
}

.style-card:nth-child(2) {
  animation-delay: 90ms;
}

.style-card:nth-child(3) {
  animation-delay: 180ms;
}

.style-card:hover,
.style-card:focus-visible {
  outline: none;
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow);
}

.style-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
}

.style-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 34%, rgba(255, 255, 255, 0.18));
  opacity: 0;
  transition: opacity 220ms ease;
}

.style-card:hover .style-media::after,
.style-card:focus-visible .style-media::after {
  opacity: 1;
}

.style-media img {
  width: 122%;
  max-width: none;
  transform: translateY(12px);
  filter: drop-shadow(0 26px 34px rgba(17, 18, 22, 0.18));
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.style-card:hover .style-media img,
.style-card:focus-visible .style-media img {
  transform: translateY(-2px) scale(1.05) rotate(-0.6deg);
}

.graphite {
  background: #fff;
}

.red {
  background: #fff;
}

.silver {
  background: #fff;
}

.style-copy p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.style-copy h2 {
  margin-bottom: 6px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
}

.style-copy span {
  color: var(--muted);
  font-weight: 700;
}

.data-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-chip {
  color: var(--ink);
  background: #eef1f5;
  border-color: #dce2ea;
}

.collection-chip {
  color: var(--teal);
  background: rgba(8, 127, 134, 0.09);
  border-color: rgba(8, 127, 134, 0.18);
}

.model-chip,
.sku-chip {
  color: var(--blue);
  background: rgba(36, 86, 214, 0.09);
  border-color: rgba(36, 86, 214, 0.18);
}

.color-chip {
  color: var(--red);
  background: rgba(179, 25, 42, 0.08);
  border-color: rgba(179, 25, 42, 0.18);
}

.run-chip {
  color: var(--violet);
  background: rgba(102, 80, 200, 0.09);
  border-color: rgba(102, 80, 200, 0.18);
}

.pairs-chip {
  color: var(--green);
  background: rgba(15, 122, 61, 0.09);
  border-color: rgba(15, 122, 61, 0.18);
}

.lot-chip {
  color: var(--gold);
  background: rgba(154, 106, 0, 0.09);
  border-color: rgba(154, 106, 0, 0.18);
}

.style-meta,
.variant-tags,
.order-tags,
.line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.gallery-modal {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  background: rgba(17, 18, 22, 0);
  opacity: 0;
  transition: opacity 240ms ease, background 240ms ease;
}

.gallery-modal.is-open {
  pointer-events: auto;
  background: rgba(17, 18, 22, 0.58);
  opacity: 1;
}

.modal-shell {
  width: min(1260px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  padding: clamp(20px, 4vw, 42px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(34px) scale(0.96);
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-modal.is-open .modal-shell {
  transform: translateY(0) scale(1);
}

.modal-close {
  cursor: pointer;
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
}

.modal-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-heading h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.95;
}

#variantCount {
  color: var(--muted);
  font-weight: 800;
}

.order-controls {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(90px, 0.5fr);
  gap: 12px;
  margin-top: 24px;
}

.order-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-controls select,
.order-controls input {
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

.size-breakdown {
  grid-column: 1 / -1;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.size-breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.size-breakdown-head strong {
  color: var(--ink);
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.size-point {
  display: grid;
  gap: 6px;
}

.size-point span {
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.size-point input {
  min-height: 40px;
  padding: 0 8px;
  text-align: center;
}

.size-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.size-hint.is-error {
  color: var(--red);
  font-weight: 800;
}

.size-hint.is-ok {
  color: #0f7a3d;
  font-weight: 800;
}

.line-notes-field {
  grid-column: 1 / -1;
}

.line-notes-field textarea {
  width: 100%;
  padding: 12px 14px;
  resize: vertical;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  text-transform: none;
}

.add-order {
  cursor: pointer;
  grid-column: 1 / -1;
  min-height: 46px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  transition: background 180ms ease, transform 180ms ease;
}

.add-order:hover {
  background: var(--red);
  transform: translateY(-2px);
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.variant-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.variant-toolbar select {
  min-height: 40px;
  padding: 0 12px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.variant-card {
  cursor: pointer;
  position: relative;
  min-height: 100%;
  padding: clamp(12px, 2vw, 18px);
  background: #f7f7f4;
  border: 1px solid transparent;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(18px);
  animation: card-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.variant-card:hover,
.variant-card.is-active {
  background: var(--white);
  border-color: rgba(179, 25, 42, 0.32);
  transform: translateY(-3px);
}

.variant-card img {
  aspect-ratio: 1 / 1.04;
  width: 100%;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 14px 20px rgba(17, 18, 22, 0.14));
}

.variant-card strong {
  display: block;
  font-size: clamp(14px, 1.5vw, 18px);
  text-align: center;
}

.variant-card span {
  display: flex;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  text-align: center;
}

.variant-card .data-chip,
.style-copy .data-chip,
.order-item .data-chip {
  display: inline-flex;
  margin-top: 0;
}

.gallery-run-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  background: #f4f8ff;
  border: 1px solid #d9e4f3;
  border-radius: 999px;
}

.gallery-run-tab {
  cursor: pointer;
  min-height: 34px;
  padding: 0 13px;
  color: #24314a;
  background: #fff;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.gallery-run-tab.is-active {
  color: #fff;
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.gallery-run-tab span {
  margin-left: 4px;
  color: inherit;
  opacity: .82;
}

.image-viewer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  padding: clamp(22px, 5vw, 58px);
  color: var(--white);
  background: rgba(10, 10, 12, 0);
  opacity: 0;
  transition: opacity 240ms ease, background 240ms ease;
}

.image-viewer.has-order-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.image-viewer.is-open {
  pointer-events: auto;
  background: rgba(10, 10, 12, 0.88);
  opacity: 1;
}

.viewer-stage {
  display: grid;
  place-items: center;
  gap: 20px;
  min-width: 0;
}

.image-viewer img {
  max-width: min(1120px, 94vw);
  max-height: 72vh;
  object-fit: contain;
  filter: drop-shadow(0 34px 64px rgba(0, 0, 0, 0.42));
  transform: translateY(28px) scale(0.94);
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.image-viewer.is-open img {
  transform: translateY(0) scale(1);
}

.viewer-stage div {
  text-align: center;
}

.image-viewer p {
  margin-bottom: 8px;
  color: #ff7380;
  font-weight: 800;
}

.image-viewer h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 48px);
}

.viewer-close {
  cursor: pointer;
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-size: 32px;
  line-height: 1;
}

.viewer-nav {
  cursor: pointer;
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.viewer-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  font-size: 34px;
  line-height: 1;
  font-family: Arial, sans-serif;
  font-weight: 900;
  transform: translateY(-50%);
}

.viewer-prev {
  left: 18px;
}

.viewer-next {
  right: 18px;
}

.viewer-cart {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: min(360px, calc(100vw - 52px));
  padding: 0 22px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.viewer-nav:hover,
.viewer-cart:hover {
  color: var(--white);
  background: var(--red);
}

.viewer-cart:hover {
  transform: translateY(-2px);
}

.viewer-order-panel {
  align-self: center;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: clamp(16px, 3vw, 24px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.viewer-order-panel.is-hidden {
  display: none;
}

.viewer-order-panel p {
  margin-bottom: 8px;
  color: var(--red);
}

.viewer-order-panel h3 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.viewer-order-panel > span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.order-drawer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(17, 18, 22, 0);
  opacity: 0;
  transition: opacity 220ms ease, background 220ms ease;
}

.order-drawer.is-open {
  pointer-events: auto;
  background: rgba(17, 18, 22, 0.44);
  opacity: 1;
}

.order-panel {
  width: min(520px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: clamp(20px, 4vw, 34px);
  background: var(--white);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.order-drawer.is-open .order-panel {
  transform: translateX(0);
}

.order-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.order-heading h2 {
  margin-bottom: 0;
  font-size: 42px;
  line-height: 1;
}

.drawer-close {
  cursor: pointer;
  width: 42px;
  height: 42px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.customer-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.customer-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-fields input,
.customer-fields textarea {
  width: 100%;
  padding: 12px 14px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.customer-fields textarea {
  grid-column: 1 / -1;
}

.order-items {
  display: grid;
  gap: 12px;
}

.empty-order {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: #f7f7f4;
  border-radius: var(--radius);
  text-align: center;
}

.order-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.order-item img {
  aspect-ratio: 1 / 1;
  width: 88px;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius);
}

.order-item h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.order-item p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.order-item strong {
  display: block;
  font-size: 13px;
}

.line-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.size-list {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.order-item .order-tags,
.order-item .line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.order-item .order-tags {
  margin-bottom: 6px;
}

.order-item .size-list {
  color: #566070;
}

.style-copy .brand-chip,
.order-item .brand-chip {
  color: var(--ink);
}

.style-copy .collection-chip,
.order-item .collection-chip {
  color: var(--teal);
}

.style-copy .sku-chip,
.order-item .sku-chip,
.order-item .model-chip {
  color: var(--blue);
}

.style-copy .color-chip,
.order-item .color-chip {
  color: var(--red);
}

.style-copy .run-chip,
.order-item .run-chip {
  color: var(--violet);
}

.style-copy .pairs-chip,
.order-item .pairs-chip {
  color: var(--green);
}

.remove-order {
  cursor: pointer;
  width: 34px;
  height: 34px;
  color: var(--red);
  background: var(--white);
  border: 1px solid rgba(179, 25, 42, 0.24);
  border-radius: 999px;
  font-size: 20px;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.order-folio {
  display: grid;
  gap: 4px;
  margin: -4px 0 14px;
  padding: 12px 14px;
  color: var(--muted);
  background: #f7f7f4;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.order-folio strong {
  color: var(--red);
  font-size: 20px;
  letter-spacing: 0;
}

.order-folio.is-saved {
  color: #0f7a3d;
  background: rgba(15, 122, 61, 0.08);
  border-color: rgba(15, 122, 61, 0.28);
}

.order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.order-actions .primary-action {
  grid-column: 1 / -1;
}

.order-actions button {
  cursor: pointer;
  min-height: 44px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

.order-actions button:hover {
  background: var(--red);
}

.send-flow {
  margin-top: 14px;
  padding: 14px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.send-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.send-flow-head button {
  cursor: pointer;
  width: 34px;
  height: 34px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
}

.send-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.send-options p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.send-options label,
.send-company-copy {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.send-destination-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.send-destination-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.send-destination-grid input {
  width: 100%;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  text-transform: none;
}

.send-company-copy {
  margin-top: 12px;
  border-radius: var(--radius);
}

.send-email-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #8a5a00;
  background: rgba(138, 90, 0, 0.1);
  border: 1px solid rgba(138, 90, 0, 0.2);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.send-flow .primary-action {
  cursor: pointer;
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

.send-flow .primary-action:hover {
  background: var(--red);
}

.history-screen {
  position: fixed;
  inset: 0;
  z-index: 140;
  padding: clamp(16px, 4vw, 44px);
  background: rgba(17, 18, 22, 0.48);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.history-screen[hidden] {
  display: none;
}

.history-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(980px, 100%);
  min-height: min(760px, calc(100vh - 88px));
  max-height: calc(100vh - clamp(32px, 8vw, 88px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 34px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.history-heading h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
}

.history-heading button {
  cursor: pointer;
  width: 42px;
  height: 42px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.history-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.history-tools input {
  min-height: 44px;
  padding: 0 14px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
}

.history-tools button {
  cursor: pointer;
  min-height: 44px;
  padding: 0 16px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

.history-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

#historyList {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 180px;
  overflow: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.history-card strong {
  display: block;
  font-size: 14px;
}

.history-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.programmed-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reprint-order {
  cursor: pointer;
  min-height: 34px;
  padding: 0 12px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.reprint-order:hover {
  background: var(--red);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logo-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 920px) {
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-unlock {
    grid-column: 1 / -1;
  }

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

  .image-viewer {
    grid-template-columns: 1fr;
    align-content: center;
    overflow: auto;
    min-height: 100svh;
    padding-block: calc(env(safe-area-inset-top) + 58px) calc(env(safe-area-inset-bottom) + 24px);
  }

  .image-viewer.has-order-panel {
    grid-template-columns: 1fr;
  }

  .viewer-order-panel {
    width: min(520px, 100%);
    margin-inline: auto;
  }

  .variant-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .variant-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .business-gate-actions,
  .business-pin {
    grid-template-columns: 1fr;
  }

  .catalog-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-header nav {
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .order-controls,
  .customer-fields,
  .order-actions,
  .send-options,
  .send-destination-grid,
  .history-tools {
    grid-template-columns: 1fr;
  }

  .history-screen {
    padding: 0;
    background: var(--white);
  }

  .history-panel {
    width: 100%;
    min-height: 100svh;
    max-height: 100svh;
    border-radius: 0;
    box-shadow: none;
  }

  #historyList {
    min-height: 280px;
    padding-bottom: 24px;
  }

  .size-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-item {
    grid-template-columns: 72px 1fr auto;
  }

  .order-item img {
    width: 72px;
  }

  .style-media {
    min-height: 230px;
  }

  .filter-bar,
  .variant-toolbar {
    grid-template-columns: 1fr;
  }

  .modal-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .variant-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-nav {
    width: 44px;
    height: 44px;
    font-size: 34px;
  }

  .viewer-cart {
    width: min(340px, calc(100vw - 36px));
    min-height: 52px;
    font-size: 15px;
  }

  .image-viewer img {
    max-height: 58vh;
    max-height: 58svh;
  }

  .order-drawer {
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  }

  .order-panel {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
  }
}

@media (max-width: 420px) {
  .viewer-order-panel,
  .order-panel {
    padding-inline: 16px;
  }

  .size-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-cart {
    width: min(300px, calc(100vw - 28px));
  }
}

/* Apple-like catalog skin inspired by the offline gallery. Visual only. */
:root {
  --catalog-soft-bg: #eef3f9;
  --catalog-panel: rgba(255, 255, 255, 0.82);
  --catalog-panel-strong: rgba(255, 255, 255, 0.95);
  --catalog-border: #d7e0ec;
  --catalog-ink: #111827;
  --catalog-muted: #657184;
  --catalog-blue: #2563eb;
  --catalog-shadow: 0 22px 70px rgba(39, 52, 78, 0.12);
}

body {
  background:
    radial-gradient(circle at 50% -140px, rgba(37, 99, 235, 0.10), transparent 420px),
    linear-gradient(180deg, #f5f8fc 0%, var(--catalog-soft-bg) 100%);
  color: var(--catalog-ink);
}

.catalog-header {
  position: relative;
  top: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: auto;
  padding: 22px clamp(18px, 5vw, 72px) 8px;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.catalog-header .brand {
  width: 72px;
  justify-self: start;
}

.catalog-header .brand img {
  max-height: 52px;
  object-position: center;
  filter: drop-shadow(0 18px 26px rgba(17, 24, 39, 0.12));
}

.catalog-header nav {
  justify-self: center;
  gap: 4px;
  padding: 8px;
  color: #283447;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--catalog-border);
  border-radius: 999px;
  box-shadow: 0 18px 48px rgba(30, 41, 59, 0.10);
  backdrop-filter: blur(18px);
}

.catalog-header nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #283447;
  font-weight: 850;
}

.catalog-header nav a:hover,
.catalog-header nav [aria-current="page"] {
  color: #111827;
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.08);
  transform: none;
}

.order-pill {
  justify-self: end;
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: #111827;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.20);
}

.catalog-hero {
  min-height: auto;
  padding: 14px clamp(18px, 6vw, 90px) 18px;
}

.hero-copy h1 {
  margin: 0 auto 14px;
  max-width: 760px;
  color: #111827;
  font-size: clamp(34px, 6vw, 72px);
  letter-spacing: 0;
}

.hero-logo {
  width: min(120px, 28vw);
  filter: drop-shadow(0 20px 34px rgba(30, 41, 59, 0.18));
  animation: none;
}

.filter-bar {
  max-width: 1320px;
  margin: 0 auto 22px;
  padding: 16px;
  grid-template-columns: minmax(132px, auto) repeat(5, minmax(150px, 1fr)) repeat(3, auto);
  gap: 10px;
  align-items: end;
  background: var(--catalog-panel-strong);
  border: 1px solid var(--catalog-border);
  border-radius: 28px;
  box-shadow: var(--catalog-shadow);
  backdrop-filter: blur(18px);
}

.filter-bar label {
  color: var(--catalog-muted);
  letter-spacing: 0.06em;
}

.filter-bar select,
.catalog-check-filter-button,
.import-unlock input,
.import-unlock button,
.clear-filters {
  min-height: 46px;
  border-color: #d7e0ec;
  border-radius: 16px;
  background: #f8fafc;
  color: #243247;
  box-shadow: none;
}

.catalog-check-filter-button {
  justify-content: space-between;
  padding-inline: 14px;
}

.catalog-check-filter-button::after {
  color: #526173;
}

.import-unlock button,
.clear-filters {
  padding-inline: 18px;
  color: #111827;
  background: #fff;
  border: 1px solid #cbd8ea;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

#catalogUnlockImport,
.catalog-link-action,
.catalog-pdf-action {
  color: #1747b8;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.14);
}

#catalogUnlockImport {
  color: #ffffff;
  background: linear-gradient(135deg, #1f5fe5 0%, #123fba 100%);
  border-color: rgba(18, 63, 186, 0.34);
  box-shadow: 0 16px 32px rgba(31, 95, 229, 0.22);
}

.catalog-link-action {
  color: #075985;
  background: linear-gradient(180deg, #ffffff 0%, #e8f7ff 100%);
  border-color: rgba(14, 165, 233, 0.24);
}

.catalog-pdf-action {
  color: #8a1538;
  background: linear-gradient(180deg, #ffffff 0%, #fff0f4 100%);
  border-color: rgba(190, 18, 60, 0.2);
}

.clear-filters:hover,
.import-unlock button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(30, 41, 59, 0.14);
}

.catalog-check-filter-panel {
  top: calc(100% + 10px);
  border-color: var(--catalog-border);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(30, 41, 59, 0.16);
}

.style-grid {
  max-width: 1320px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 42px) 112px;
}

.style-card {
  gap: 12px;
  min-height: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--catalog-border);
  border-radius: 24px;
  box-shadow: 0 20px 52px rgba(39, 52, 78, 0.10);
  overflow: hidden;
}

.style-card:hover,
.style-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 28px 70px rgba(39, 52, 78, 0.16);
}

.style-media {
  min-height: 0;
  aspect-ratio: 1.28 / 1;
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #e8eef6);
}

.style-media::before,
.style-media::after {
  content: none;
}

.style-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 22px rgba(15, 23, 42, 0.12));
}

.style-card:hover .style-media img,
.style-card:focus-visible .style-media img {
  transform: scale(1.025);
}

.style-copy {
  text-align: center;
}

.style-copy h2 {
  margin: 8px 0 6px;
  color: #111827;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.05;
}

.style-meta {
  justify-content: center;
  margin: 5px 0;
}

.variant-tags,
.order-tags,
.line-meta,
.style-meta {
  gap: 5px;
}

.style-copy .data-chip,
.variant-card .data-chip,
.order-item .data-chip {
  min-height: 24px;
  padding: 4px 9px;
  color: #1f2937;
  background: #f8fafc;
  border-color: #d7e0ec;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.brand-chip {
  background: #eef6ff !important;
  border-color: #cfe0ff !important;
  color: #1d4ed8 !important;
}

.color-chip {
  background: #fff1f4 !important;
  border-color: #ffd2dc !important;
  color: #9f1239 !important;
}

.run-chip {
  background: #f0f7ff !important;
  border-color: #cfe0ff !important;
  color: #1d4ed8 !important;
}

.sku-chip {
  background: #ecfdf5 !important;
  border-color: #bbf7d0 !important;
  color: #047857 !important;
}

.lot-chip,
.collection-chip {
  background: #fff7ed !important;
  border-color: #fed7aa !important;
  color: #9a3412 !important;
}

.empty-order {
  grid-column: 1 / -1;
  justify-self: stretch;
  padding: 28px;
  color: #667085;
  background: rgba(255, 255, 255, 0.76);
  border: 1px dashed #c8d4e4;
  border-radius: 24px;
  text-align: center;
  box-shadow: none;
}

@media (max-width: 1080px) {
  .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .catalog-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    padding: max(12px, env(safe-area-inset-top)) 12px 8px;
  }

  .catalog-header .brand,
  .order-pill {
    justify-self: center;
  }

  .catalog-header nav {
    width: min(100%, 560px);
    justify-content: flex-start;
    overflow-x: auto;
    padding: 7px;
    white-space: nowrap;
  }

  .catalog-header nav a {
    min-height: 34px;
    padding: 0 13px;
  }

  .catalog-hero {
    padding-top: 10px;
  }

  .hero-copy h1 {
    font-size: clamp(30px, 10vw, 46px);
  }

  .filter-bar {
    grid-template-columns: 1fr;
    margin-inline: 12px;
    border-radius: 24px;
  }

  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-inline: 12px;
  }

  .style-card {
    border-radius: 20px;
    padding: 9px;
  }

  .style-media {
    border-radius: 16px;
  }

  .style-copy h2 {
    font-size: 16px;
  }

  .style-copy .data-chip {
    font-size: 10px;
    padding-inline: 7px;
  }
}

@media (max-width: 420px) {
  .style-grid {
    grid-template-columns: 1fr;
  }
}

/* Catalog filter layering: dropdowns must float above product photos. */
.filter-bar {
  position: relative !important;
  z-index: 360 !important;
  overflow: visible !important;
  isolation: isolate;
}

.filter-bar label {
  position: relative !important;
  z-index: 365 !important;
  overflow: visible !important;
}

.catalog-check-filter {
  position: relative !important;
  z-index: 370 !important;
}

.catalog-check-filter:focus-within,
.filter-bar label:focus-within {
  z-index: 520 !important;
}

.catalog-check-filter-panel {
  z-index: 620 !important;
}

.style-grid {
  position: relative !important;
  z-index: 1 !important;
}

.style-card {
  z-index: 1;
}

.style-card:hover,
.style-card:focus-visible {
  z-index: 2;
}

.catalog-card-meta {
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.style-copy .business-line-chip {
  background: #eef6ff !important;
  border-color: #cfe0ff !important;
  color: #1d4ed8 !important;
}

.style-copy .catalog-card-meta .data-chip {
  max-width: 100%;
  font-size: 11px;
}

.new-variant-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #064e3b !important;
  background: #d9fbe8;
  border: 1px solid #9ee6bd;
  font-size: 10px !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 22px rgba(6, 78, 59, 0.12);
}

.viewer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  max-width: min(760px, calc(100vw - 48px));
  margin: 12px auto 0;
}

.viewer-meta .data-chip {
  min-height: 26px;
  padding: 5px 10px;
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(209, 213, 219, 0.95);
  font-size: 11px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.variant-card .variant-color-name {
  justify-content: center;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.variant-card .variant-tags {
  justify-content: center;
  align-items: center;
}

.variant-card .run-chip {
  max-width: 100%;
  text-align: center;
}

.catalog-pdf-modal[hidden] {
  display: none !important;
}

.catalog-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 13, 24, 0.58);
  backdrop-filter: blur(18px);
}

.catalog-pdf-card {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 28px;
  color: #101828;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.96)),
    #ffffff;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
}

.catalog-pdf-card h2 {
  margin: 4px 0 6px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 0.98;
  letter-spacing: 0;
}

.catalog-pdf-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  color: #111827;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  font-size: 25px;
  font-weight: 900;
  cursor: pointer;
}

.catalog-pdf-summary {
  margin: 0 0 18px;
  color: #667085;
  font-weight: 800;
}

.catalog-pdf-field {
  display: grid;
  gap: 8px;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.catalog-pdf-field input,
.catalog-pdf-field select {
  min-height: 48px;
  border: 1px solid #d8e1ef;
  border-radius: 16px;
  padding: 0 15px;
  color: #111827;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.catalog-pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.catalog-pdf-grid.compact {
  margin: 14px 0 16px;
}

.catalog-pdf-grid label {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  border: 1px solid #d8e1ef;
  border-radius: 18px;
  padding: 10px 13px;
  color: #1f2937;
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.catalog-pdf-grid input {
  width: 18px;
  height: 18px;
  accent-color: #2456d6;
}

.catalog-pdf-price-row {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 14px;
}

.catalog-pdf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.catalog-pdf-actions button {
  min-height: 48px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  padding: 0 22px;
  color: #111827;
  background: #ffffff;
  font-weight: 950;
  cursor: pointer;
}

.catalog-pdf-actions .catalog-pdf-primary {
  border-color: rgba(37, 99, 235, 0.28);
  color: #ffffff;
  background: linear-gradient(135deg, #1f5fe5 0%, #123fba 100%);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.24);
}

@media (max-width: 720px) {
  .style-copy .catalog-card-meta .data-chip {
    font-size: 10px;
  }

  .catalog-pdf-modal {
    align-items: end;
    padding: 12px;
  }

  .catalog-pdf-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 24px 18px 18px;
    border-radius: 24px;
  }

  .catalog-pdf-grid,
  .catalog-pdf-price-row {
    grid-template-columns: 1fr;
  }

  .catalog-pdf-actions {
    flex-direction: column-reverse;
  }

  .catalog-pdf-actions button {
    width: 100%;
  }
}

/* Mantiene las tarjetas del catalogo con tamano constante al filtrar. */
@media (min-width: 721px) {
  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 240px)) !important;
    justify-content: center !important;
    align-items: start !important;
  }

  .style-card {
    width: 100% !important;
    max-width: 240px !important;
  }
}

/* Final filter usability fixes: dropdowns above cards and calmer action buttons. */
.filter-bar {
  position: relative !important;
  z-index: 1200 !important;
  overflow: visible !important;
}

.filter-bar label,
.catalog-check-filter {
  position: relative !important;
  z-index: 1210 !important;
  overflow: visible !important;
}

.catalog-check-filter:focus-within,
.catalog-check-filter.is-open,
.filter-bar label:focus-within {
  z-index: 1400 !important;
}

.catalog-check-filter-panel {
  z-index: 1500 !important;
  right: auto !important;
  min-width: 230px !important;
  max-width: min(320px, calc(100vw - 28px)) !important;
}

#catalogUnlockImport {
  color: #111827 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%) !important;
  border-color: rgba(148, 163, 184, 0.48) !important;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1) !important;
}

/* 2026-07-18: boton Mostrar todo uniforme con Stock/Galeria. */
.filter-bar .import-unlock #catalogUnlockImport,
#catalogUnlockImport {
  min-height: 42px !important;
  padding: 0 18px !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #c8102e 0%, #9f0c27 100%) !important;
  border-color: rgba(200, 16, 46, 0.34) !important;
  box-shadow: 0 16px 34px rgba(200, 16, 46, 0.2) !important;
}

.filter-bar .import-unlock #catalogUnlockImport:hover,
#catalogUnlockImport:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(200, 16, 46, 0.26) !important;
}

/* 2026-07-18: el boton del pedido vive en la esquina superior derecha.
   Queda por encima de la navegacion, pero debajo de visores y paneles. */
.order-pill {
  position: fixed !important;
  top: max(14px, calc(env(safe-area-inset-top) + 10px)) !important;
  right: max(16px, calc(env(safe-area-inset-right) + 16px)) !important;
  z-index: 1600 !important;
  justify-self: auto !important;
  white-space: nowrap !important;
}

.image-viewer {
  z-index: 2100 !important;
}

.order-drawer {
  z-index: 2200 !important;
}

.catalog-pdf-modal {
  z-index: 2300 !important;
}

@media (max-width: 720px) {
  .order-pill {
    top: max(10px, calc(env(safe-area-inset-top) + 8px)) !important;
    right: max(10px, calc(env(safe-area-inset-right) + 10px)) !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }
}

/* 2026-07-18: visor de catalogo compacto, con modelo/SKU arriba y boton visible. */
.image-viewer .viewer-stage {
  grid-template-rows: auto minmax(0, auto) auto;
  gap: clamp(12px, 2vh, 18px);
}

.image-viewer .viewer-stage > div {
  order: 1;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.image-viewer #viewerImage {
  order: 2;
  max-height: min(64vh, 620px);
}

.image-viewer .viewer-cart {
  order: 3;
  margin-bottom: max(6px, env(safe-area-inset-bottom));
}

.image-viewer #viewerCode {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 950;
}

.image-viewer #viewerCode::before {
  content: "SKU ";
}

.image-viewer #viewerTitle {
  margin: 0;
  font-size: clamp(24px, 3.3vw, 42px);
  line-height: 0.96;
}

.image-viewer .viewer-meta {
  margin: 0;
}

.image-viewer .viewer-meta .data-chip {
  min-height: 28px;
  padding: 5px 12px;
  color: #111827;
  font-size: 12px;
}

@media (max-width: 760px) {
  .image-viewer {
    padding-top: calc(env(safe-area-inset-top) + 46px) !important;
    padding-bottom: calc(env(safe-area-inset-bottom) + 18px) !important;
  }

  .image-viewer #viewerImage {
    max-height: min(50svh, 430px);
  }

  .image-viewer.has-order-panel #viewerImage {
    max-height: min(42svh, 340px);
  }

  .image-viewer #viewerTitle {
    font-size: clamp(24px, 7vw, 34px);
  }

  .image-viewer .viewer-cart {
    min-height: 48px;
  }
}

.catalog-share-modal {
  position: fixed;
  inset: 0;
  z-index: 1210;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 13, 24, 0.58);
  backdrop-filter: blur(18px);
}

.catalog-share-modal[hidden] {
  display: none !important;
}

.catalog-share-card {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 28px;
  color: #101828;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.96));
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
}

.catalog-share-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 1px solid #d8e1ef;
  border-radius: 999px;
  color: #111827;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  font-size: 25px;
  font-weight: 900;
  cursor: pointer;
}

.catalog-share-card h2 {
  margin: 4px 0 2px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.98;
}

.catalog-share-summary,
.catalog-share-status {
  margin: 0;
  color: #667085;
  font-size: 14px;
  font-weight: 800;
}

.catalog-share-field {
  display: grid;
  gap: 8px;
  color: #667085;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.catalog-share-field select,
.catalog-share-field input,
.catalog-share-result input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d8e1ef;
  border-radius: 16px;
  color: #111827;
  background: #f8fbff;
  font: inherit;
  font-weight: 900;
}

.catalog-share-field input::placeholder {
  color: #98a2b3;
}

.catalog-share-primary {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1261ed, #0aa574);
  box-shadow: 0 18px 36px rgba(18, 97, 237, .24);
  font-weight: 1000;
  cursor: pointer;
}

.catalog-share-primary:disabled {
  cursor: wait;
  opacity: .65;
}

.catalog-share-secondary {
  min-height: 44px;
  border: 1px solid #c7d5ea;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-weight: 950;
  cursor: pointer;
}

.catalog-share-history {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #d8e1ef;
  border-radius: 18px;
  background: #f8fbff;
}

.catalog-share-history[hidden] {
  display: none !important;
}

.catalog-share-history article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e1e8f2;
  border-radius: 14px;
  background: #fff;
}

.catalog-share-history strong,
.catalog-share-history small {
  display: block;
}

.catalog-share-history strong {
  color: #111827;
  font-size: 13px;
}

.catalog-share-history small {
  margin-top: 3px;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}

.catalog-share-history div:last-child {
  display: flex;
  gap: 6px;
}

.catalog-share-history button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #c7d5ea;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-size: 11px;
  font-weight: 950;
}

.catalog-share-result {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #bdebd2;
  border-radius: 20px;
  background: #f0fff8;
}

.catalog-share-result[hidden] {
  display: none !important;
}

.catalog-share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.catalog-share-actions button {
  min-height: 44px;
  border: 1px solid #c7d5ea;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-weight: 950;
  cursor: pointer;
}

.catalog-share-actions button:last-child {
  border-color: #bdebd2;
  color: #087f5b;
  background: #eafaf1;
}

/* 2026-07-30: estabilidad responsive y carga visual progresiva.
   Mantiene tarjetas pequenas aunque haya pocos resultados filtrados. */
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

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

@supports (content-visibility: auto) {
  .style-card,
  .variant-card,
  .order-item,
  .history-card {
    content-visibility: auto;
    contain-intrinsic-size: 260px 360px;
  }
}

@media (min-width: 721px) {
  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 240px)) !important;
    justify-content: center !important;
    align-items: start !important;
  }

  .style-card {
    width: 100% !important;
    max-width: 240px !important;
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  .style-grid {
    max-width: 820px !important;
  }

  .filter-bar {
    max-width: min(960px, calc(100vw - 28px)) !important;
  }
}

@media (max-width: 720px) {
  .catalog-hero,
  .style-grid,
  .filter-bar {
    width: min(100%, calc(100vw - 20px)) !important;
  }

  .style-grid {
    justify-content: center !important;
    padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
  }

  .style-media img,
  .variant-card img,
  .order-item img {
    transform: translateZ(0);
  }

  .image-viewer {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
}

/* 2026-08-11: filtros usables en celular/iPad.
   Los paneles dejan de vivir debajo de las tarjetas y se muestran como hoja flotante. */
.filter-bar {
  isolation: isolate;
  overflow: visible !important;
}

.catalog-check-filter {
  position: relative;
  z-index: 1800 !important;
}

.catalog-check-filter:focus-within,
.catalog-check-filter.is-open,
.catalog-check-filter:has(.catalog-check-filter-button[aria-expanded="true"]) {
  z-index: 10200 !important;
}

.catalog-check-filter-panel {
  z-index: 10220 !important;
}

@media (max-width: 1180px) {
  .filter-bar {
    position: relative !important;
    z-index: 9800 !important;
    overflow: visible !important;
  }

  .catalog-check-filter-panel {
    position: fixed !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    top: auto !important;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: min(58vh, 430px) !important;
    padding: 12px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3) !important;
    z-index: 10250 !important;
  }

.catalog-check-filter-panel[hidden] {
    display: none !important;
  }
}

/* 2026-08-11: dropdowns web encima de filtros vecinos.
   Evita que el panel abierto quede detras de los datos de otro filtro. */
@media (min-width: 1181px) {
  .filter-bar > label,
  .filter-bar > .catalog-check-filter {
    position: relative !important;
    z-index: 20 !important;
  }

  .filter-bar > label:focus-within,
  .filter-bar > .catalog-check-filter:focus-within,
  .filter-bar > .catalog-check-filter:has(.catalog-check-filter-panel:not([hidden])),
  .filter-bar > .catalog-check-filter:has(.catalog-check-filter-button[aria-expanded="true"]) {
    z-index: 30000 !important;
  }

  .filter-bar > .catalog-check-filter:has(.catalog-check-filter-panel:not([hidden])) .catalog-check-filter-panel,
  .filter-bar > .catalog-check-filter:has(.catalog-check-filter-button[aria-expanded="true"]) .catalog-check-filter-panel {
    z-index: 30010 !important;
  }
}
