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

* {
  box-sizing: border-box;
}

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

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

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

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

.brand {
  width: 136px;
}

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

.stock-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: rgba(17, 18, 22, 0.68);
  font-size: 13px;
  font-weight: 800;
}

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

.stock-cart-button,
.stock-primary,
.stock-panel button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.stock-cart-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  color: var(--ink);
  background: var(--white);
  border-radius: 999px;
}

.stock-primary:disabled,
.stock-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.stock-hero {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: clamp(64px, 8vw, 110px) 18px 34px;
  text-align: center;
}

.stock-hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
}

.stock-hero img {
  width: min(320px, 70vw);
  filter: drop-shadow(0 18px 34px rgba(17, 18, 22, 0.12));
}

.stock-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto 26px;
  padding: 0 clamp(18px, 5vw, 70px);
}

.stock-tools input,
.stock-tools select,
.stock-check-filter-button,
.import-unlock button {
  min-height: 46px;
  padding: 0 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

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

.stock-tools label {
  position: relative;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-check-filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--ink);
  cursor: pointer;
}

.stock-check-filter-button::after {
  content: "⌄";
  color: #5f6d83;
  font-size: 16px;
}

.stock-check-filter-panel {
  position: absolute;
  z-index: 30;
  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;
}

.stock-check-filter-panel label {
  display: flex;
  grid-template-columns: none;
  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;
}

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

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

.stock-tools > input,
.stock-tools > select {
  align-self: end;
}

.stock-search-filter {
  grid-column: span 2;
}

.stock-catalog-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.stock-catalog-actions p {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stock-catalog-actions button {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.stock-catalog-actions .stock-pdf-button {
  border-color: #0f4ed8;
  background: linear-gradient(135deg, #082d73, #1261ed);
  color: #fff;
  box-shadow: 0 12px 28px rgba(18, 97, 237, 0.22);
}

.stock-catalog-actions .stock-share-button {
  border-color: #087f5b;
  background: linear-gradient(135deg, #087f5b, #12a875);
  color: #fff;
  box-shadow: 0 12px 28px rgba(8, 127, 91, 0.2);
}

.stock-catalog-actions button:disabled {
  cursor: wait;
  opacity: 0.64;
}

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

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

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

.stock-share-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 13, 31, 0.72);
  backdrop-filter: blur(8px);
}

.stock-share-modal[hidden] {
  display: none;
}

.stock-share-card {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(540px, 100%);
  max-height: calc(100svh - 40px);
  overflow: auto;
  padding: 32px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.stock-share-card h2,
.stock-share-card p {
  margin: 0;
}

.stock-share-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-share-card input,
.stock-share-card select {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.stock-share-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #edf1f7;
  font-size: 26px;
  cursor: pointer;
}

.stock-share-result {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #b9ead9;
  border-radius: 18px;
  background: #f0fbf7;
}

.stock-share-result[hidden] {
  display: none;
}

.stock-share-actions,
.shared-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.stock-share-actions button,
.shared-request-heading button,
.shared-request-actions button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.stock-share-actions button:last-child {
  border-color: #087f5b;
  background: #087f5b;
  color: #fff;
}

.shared-request-section {
  max-width: 1120px;
  margin: 42px auto;
  padding: 0 clamp(18px, 5vw, 70px);
}

.shared-request-section[hidden] {
  display: none;
}

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

.shared-request-heading p,
.shared-request-heading h2 {
  margin: 0;
}

.shared-request-heading p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.shared-request-list {
  display: grid;
  gap: 12px;
}

.shared-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.shared-request-card h3,
.shared-request-card p {
  margin: 0 0 6px;
}

.shared-request-card p:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.shared-request-card p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shared-request-actions .stock-primary {
  border-color: #1261ed;
  background: #1261ed;
  color: #fff;
}

.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;
}

.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);
}

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

.stock-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stock-card.is-sold-out {
  border-color: rgba(179, 25, 42, 0.28);
}

.stock-card.is-sold-out img {
  opacity: 0.66;
  filter: grayscale(0.34);
}

.stock-soldout-ribbon {
  position: absolute;
  top: 18px;
  right: -42px;
  z-index: 2;
  width: 164px;
  padding: 8px 10px;
  color: var(--white);
  background: var(--red);
  box-shadow: 0 12px 24px rgba(179, 25, 42, 0.28);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(36deg);
}

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

.stock-card img {
  aspect-ratio: 1.12 / 1;
  width: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.stock-card h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.05;
}

.stock-card p {
  margin: 0;
  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;
}

.stock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.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);
}

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

.lot-chip {
  color: var(--gold);
  background: rgba(154, 106, 0, 0.09);
  border-color: rgba(154, 106, 0, 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);
}

.stock-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stock-breakdown span {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 6px 4px 5px;
  color: var(--violet);
  background: rgba(102, 80, 200, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.stock-breakdown strong {
  color: var(--green);
  font-size: 13px;
}

.stock-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
}

.stock-total.is-empty {
  background: var(--red);
}

.stock-restock-button {
  background: var(--red);
}

.stock-restock-button:hover {
  background: #8f1020;
}

.stock-readonly-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  color: var(--ink);
  background: #eef1f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.stock-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(17, 18, 22, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.stock-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.stock-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(620px, 100%);
  max-height: 100dvh;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stock-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stock-panel-head p,
.stock-panel-head h2,
.stock-panel-head h3,
.stock-panel-meta {
  margin: 0;
}

.stock-panel-head p,
.stock-panel-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-panel-head h2,
.stock-panel-head h3 {
  font-size: 24px;
  line-height: 1.05;
}

.stock-panel-head.compact h3 {
  font-size: 18px;
}

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

.stock-package-rule {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  color: var(--violet);
  background: rgba(102, 80, 200, 0.09);
  border: 1px solid rgba(102, 80, 200, 0.18);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
}

.stock-size-point {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stock-line-point {
  grid-column: 1 / -1;
}

.stock-size-point small {
  color: var(--red);
}

.stock-size-point input,
.stock-cart input,
.stock-cart textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.stock-cart {
  display: grid;
  gap: 14px;
}

.stock-step {
  display: grid;
  gap: 14px;
  animation: step-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stock-step[hidden] {
  display: none;
}

.stock-step-kicker {
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  color: var(--white);
  background: var(--red);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-step h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

.stock-print-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stock-print-summary p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stock-print-summary span {
  color: var(--ink);
  text-align: right;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stock-cart label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-cart-item,
.stock-command-row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stock-command-row {
  grid-template-columns: 1fr auto auto auto;
  margin-top: 8px;
}

.stock-command-row.is-cancelled {
  color: #8f1020;
  background: rgba(179, 25, 42, 0.08);
  border-color: rgba(179, 25, 42, 0.28);
}

.stock-command-row.is-cancelled strong::after {
  content: "CANCELADO";
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 8px;
  color: #b3192a;
  background: rgba(179, 25, 42, 0.12);
  border: 1px solid rgba(179, 25, 42, 0.26);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.stock-cart-photo {
  cursor: zoom-in;
  width: 112px;
  min-height: 112px;
  padding: 0;
  overflow: hidden;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
}

.stock-cart-photo img,
.stock-cart-item img {
  width: 100%;
  height: 112px;
  object-fit: contain;
  background: #fff;
}

.stock-cart-copy,
.stock-command-row div {
  display: grid;
  gap: 4px;
}

.stock-cart-copy > strong {
  font-size: 16px;
}

.stock-cart-line {
  color: var(--violet) !important;
}

.stock-cart-item span,
.stock-command-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock-cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stock-cart-actions button:not(.stock-primary),
.stock-command-row button,
.stock-panel-head button {
  color: var(--ink);
  background: #f3f4f6;
}

.stock-command-history {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.stock-history-hidden .stock-command-history {
  display: none;
}

.stock-return-search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stock-return-search label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-return-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.stock-return-card {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: #fffaf0;
  border: 1px solid #eedaa8;
  border-left: 5px solid #b38600;
  border-radius: var(--radius);
}

.stock-return-card.is-cancelled {
  background: rgba(179, 25, 42, 0.08);
  border-color: rgba(179, 25, 42, 0.28);
  border-left-color: #b3192a;
}

.stock-return-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock-return-card strong {
  font-size: 18px;
}

.stock-return-lines {
  display: grid;
  gap: 10px;
}

.stock-return-line {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stock-return-line h4 {
  margin: 0;
  font-size: 14px;
}

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

.stock-return-line-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.stock-return-line-grid input {
  width: 100%;
  min-height: 34px;
  padding: 6px;
  text-align: center;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.stock-return-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stock-return-actions .danger {
  color: var(--white);
  background: var(--red);
}

.stock-image-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(18px, 4vw, 44px);
  background: rgba(17, 18, 22, 0.78);
}

.stock-image-modal[hidden] {
  display: none;
}

.stock-image-modal img {
  justify-self: center;
  max-width: min(980px, 100%);
  max-height: 86vh;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stock-image-modal #closeStockImageModal {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 999px;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

.stock-image-nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 72px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 44px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.stock-image-prev {
  left: 18px;
}

.stock-image-next {
  right: 18px;
}

.stock-image-nav[hidden] {
  display: none;
}

.stock-image-controls {
  display: grid;
  gap: 14px;
  width: 100%;
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stock-image-controls[hidden] {
  display: none;
}

.stock-image-controls p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stock-image-controls .stock-panel-kicker {
  justify-self: start;
  padding: 9px 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
}

.stock-image-sku {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 7px 12px;
  background: #fff0f4;
  border-radius: 999px;
  color: var(--red) !important;
  font-size: 13px !important;
}

.stock-image-controls h2 {
  margin: -8px 0 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

.stock-image-controls #stockImageMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.35;
}

.stock-image-line-table {
  display: grid;
  gap: 9px;
}

.stock-image-line-row {
  display: grid;
  grid-template-columns: 72px minmax(92px, 1fr) 92px minmax(78px, 0.8fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stock-image-line-row.is-active {
  background: #eefaf4;
  border-color: rgba(0, 128, 73, 0.28);
}

.stock-image-line-row.is-invalid {
  background: #fff1f2;
  border-color: rgba(193, 18, 45, 0.42);
}

.stock-line-name,
.stock-line-available,
.stock-line-remaining {
  font-size: 12px;
  font-weight: 900;
}

.stock-line-name {
  color: var(--violet);
}

.stock-line-available strong {
  color: var(--blue);
}

.stock-line-remaining strong {
  color: #008049;
}

.stock-image-controls input {
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  text-align: center;
}

.stock-image-status {
  min-height: 20px;
  color: #008049 !important;
}

.stock-image-separate {
  min-height: 54px;
  padding: 0 18px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.stock-image-separate:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stock-image-separate[hidden] {
  display: none;
}

/* Galeria-style visual refresh for stock. Keeps all existing data actions intact. */
.stock-hero {
  max-width: 980px;
  margin: 0 auto 10px;
  padding-top: clamp(18px, 4vw, 42px);
  text-align: center;
}

.stock-hero h1 {
  letter-spacing: 0;
}

.stock-tools {
  max-width: 1180px;
  margin: 0 auto 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(204, 214, 229, 0.9);
  border-radius: 22px;
  box-shadow: 0 22px 58px rgba(25, 39, 71, 0.1);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 360;
  overflow: visible;
  isolation: isolate;
}

.stock-tools label {
  gap: 7px;
  position: relative;
  z-index: 365;
  overflow: visible;
}

.stock-check-filter {
  position: relative;
  z-index: 370;
}

.stock-check-filter:focus-within,
.stock-tools label:focus-within {
  z-index: 520;
}

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

.stock-tools input,
.stock-tools select,
.stock-check-filter-button {
  min-height: 52px;
  background: #f7f9fc;
  border-radius: 16px;
}

.stock-catalog-actions {
  padding: 0;
  background: transparent;
  border: 0;
}

.stock-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  max-width: 1180px;
  gap: 18px;
}

.stock-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-color: rgba(207, 217, 231, 0.92);
  border-radius: 24px;
  box-shadow: 0 22px 54px rgba(25, 39, 71, 0.09);
}

.stock-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 68px rgba(25, 39, 71, 0.14);
}

.stock-card-media {
  display: grid;
}

.stock-card img {
  aspect-ratio: 1.18 / 1;
  padding: 10px;
  background: linear-gradient(180deg, #f8fafc, #eef3f9);
  border: 1px solid rgba(219, 226, 237, 0.9);
  border-radius: 18px;
}

.stock-card-action {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(17, 18, 22, 0.16);
}

.stock-separate-card-button {
  background: #111827;
}

.stock-card-info {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.stock-card-info h2 {
  flex-basis: 100%;
}

.stock-card h2 {
  font-size: clamp(20px, 2.2vw, 25px);
}

.stock-breakdown {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}

.stock-breakdown span {
  min-height: 54px;
  background: #f4f1ff;
  border-color: #ded8ff;
  border-radius: 12px;
}

.stock-breakdown strong {
  font-size: 17px;
}

.stock-total {
  width: 100%;
  min-height: 46px;
  margin-top: auto;
  color: #ffffff;
  background: linear-gradient(135deg, #0b8f5a, #087348);
  font-size: 17px;
  box-shadow: 0 14px 30px rgba(17, 18, 22, 0.12);
}

.stock-drawer {
  justify-content: flex-end;
  padding: clamp(12px, 2vw, 24px);
  background: rgba(8, 12, 22, 0.46);
  backdrop-filter: blur(12px);
}

.stock-panel {
  width: min(560px, 100%);
  border-radius: 24px;
  box-shadow: 0 28px 74px rgba(8, 12, 22, 0.28);
}

.stock-panel-head button,
.stock-image-modal #closeStockImageModal {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #111827;
  background: #f5f7fb;
  border: 1px solid rgba(207, 217, 231, 0.96);
  border-radius: 999px;
  line-height: 1;
}

.stock-size-point,
.stock-cart-item,
.stock-command-row,
.stock-print-summary,
.stock-policy-check {
  background: #f8fafc;
  border-radius: 16px;
}

.stock-image-modal {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  background: rgba(5, 7, 12, 0.86);
}

.stock-image-modal img {
  width: min(980px, 100%);
  max-height: 82vh;
  border-radius: 22px;
}

.stock-image-controls {
  border-radius: 24px;
  box-shadow: 0 28px 74px rgba(8, 12, 22, 0.28);
}

.stock-image-line-row {
  grid-template-columns: 82px minmax(88px, 1fr) 88px minmax(76px, 0.8fr);
  border-radius: 16px;
}

.stock-image-separate {
  min-height: 56px;
  box-shadow: 0 16px 30px rgba(17, 18, 22, 0.16);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
  text-align: center;
}

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

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

  .stock-catalog-actions {
    grid-column: 1 / -1;
  }

  .stock-search-filter {
    grid-column: span 2;
  }

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

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

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

  .stock-image-modal img {
    max-height: 52svh;
  }

  .stock-image-controls {
    max-height: none;
  }

  .stock-image-line-row {
    grid-template-columns: 70px 1fr;
  }
}

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

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

  .stock-header nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .stock-tools,
  .stock-grid {
    grid-template-columns: 1fr;
  }

  .stock-tools {
    margin-inline: 14px;
    border-radius: 20px;
  }

  .stock-card {
    border-radius: 22px;
  }

  .stock-panel {
    align-self: end;
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
  }

  .stock-image-controls {
    padding: 18px;
  }

  .stock-image-line-row {
    grid-template-columns: 1fr 1fr;
  }

  .stock-catalog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-search-filter {
    grid-column: auto;
  }

  .stock-share-card {
    padding: 28px 20px 20px;
  }

  .stock-share-actions,
  .shared-request-actions,
  .shared-request-card {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .shared-request-card {
    display: grid;
  }

  .stock-catalog-actions p {
    margin: 0;
    text-align: center;
  }

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

  .stock-image-nav {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom) + 42vh);
    width: 42px;
    height: 50px;
    font-size: 34px;
    transform: none;
  }

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

  .stock-panel {
    min-height: 100svh;
    max-height: 100svh;
    border-radius: 0;
  }

  .stock-size-grid,
  .stock-cart-item,
  .stock-command-row,
  .stock-return-search,
  .stock-return-line-grid {
    grid-template-columns: 1fr;
  }

  .stock-cart-item img {
    width: 100%;
    height: 160px;
  }
}

@media (max-width: 420px) {
  .stock-image-controls {
    padding-inline: 16px;
  }

  .stock-image-line-row {
    grid-template-columns: 1fr;
  }

  .stock-image-line-row input {
    min-height: 46px;
  }

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

/* Evita que una sola tarjeta filtrada se estire y agrande la foto en escritorio. */
@media (min-width: 761px) {
  .stock-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 270px)) !important;
    justify-content: center;
    align-items: start;
  }

  .stock-card {
    width: 100%;
    max-width: 270px;
  }

  .stock-card-media,
  .stock-card img {
    max-height: 218px;
  }
}

/* Stock viewer: foto protagonista y boton Separar debajo de la imagen.
   Mantiene intacto el panel lateral que captura las corridas y pares. */
.stock-image-stage {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  min-width: 0;
}

.stock-image-modal .stock-image-stage img {
  width: min(1040px, 100%);
  max-height: min(78vh, 760px);
}

.stock-image-open-separate {
  min-width: min(360px, 82vw);
  min-height: 56px;
  padding: 0 34px;
  color: #fff;
  background: #111318;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 20px 48px rgba(5, 7, 12, 0.28);
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0;
  cursor: pointer;
}

.stock-image-open-separate:hover {
  transform: translateY(-1px);
}

.stock-image-open-separate[hidden] {
  display: none !important;
}

.stock-image-modal .stock-image-controls {
  align-self: center;
}

@media (max-width: 920px) {
  .stock-image-stage {
    gap: 12px;
  }

  .stock-image-modal .stock-image-stage img {
    max-height: 50svh;
  }

  .stock-image-open-separate {
    min-height: 52px;
  }
}

@media (max-width: 560px) {
  .stock-image-modal {
    align-content: start;
    gap: 14px;
  }

  .stock-image-stage {
    width: 100%;
  }

  .stock-image-modal .stock-image-stage img {
    width: 100%;
    max-height: 50svh;
    border-radius: 20px;
  }

  .stock-image-open-separate {
    width: min(100%, 320px);
    min-width: 0;
  }
}

/* Mantiene las tarjetas de stock con tamano constante al filtrar. */
@media (min-width: 761px) {
  .stock-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 270px)) !important;
    justify-content: center !important;
    align-items: start !important;
  }

  .stock-card,
  .stock-grid > * {
    width: 100% !important;
    max-width: 270px !important;
  }
}

/* Final filter usability fixes: keep dropdowns readable and above stock cards. */
.stock-tools {
  position: relative !important;
  z-index: 1200 !important;
  overflow: visible !important;
}

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

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

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

/* 2026-07-18: pulido visual final para filtros, grid y visor de Stock. */
.stock-tools .import-unlock #stockUnlockImport,
#stockUnlockImport {
  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;
}

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

.stock-tools {
  max-width: 1180px !important;
  gap: 10px !important;
}

.stock-tools label {
  gap: 5px !important;
  font-size: 10px !important;
}

.stock-tools input,
.stock-tools select,
.stock-tools button,
.stock-check-filter-button {
  min-height: 42px !important;
  padding-inline: 12px !important;
  font-size: 12px !important;
}

.stock-check-filter-panel {
  min-width: 210px !important;
  max-width: min(290px, calc(100vw - 28px)) !important;
}

@media (min-width: 1120px) {
  .stock-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    max-width: 1180px !important;
    justify-content: center !important;
    align-items: start !important;
  }

  .stock-card,
  .stock-grid > * {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (min-width: 820px) and (max-width: 1119px) {
  .stock-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-width: 920px !important;
  }
}

@media (min-width: 560px) and (max-width: 819px) {
  .stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 620px !important;
  }
}

.stock-image-modal:not(.is-separating) {
  grid-template-columns: minmax(0, min(1080px, calc(100vw - 96px))) !important;
  justify-content: center !important;
  justify-items: center !important;
}

.stock-image-modal:not(.is-separating) .stock-image-stage {
  width: 100% !important;
}

.stock-image-modal:not(.is-separating) .stock-image-controls {
  display: none !important;
}

.stock-image-modal.is-separating {
  grid-template-columns: minmax(0, min(980px, 56vw)) minmax(340px, 430px) !important;
  justify-content: center !important;
}

.stock-image-open-separate {
  color: #ffffff !important;
  background: linear-gradient(135deg, #10131a 0%, #243047 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.26) !important;
  box-shadow: 0 22px 48px rgba(5, 7, 12, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.stock-image-open-separate::after {
  content: "  +";
  color: #ffffff;
}

/* Ajuste puntual: boton Separar del visor de stock sin + y con color de accion claro. */
.stock-image-open-separate {
  color: #ffffff !important;
  background: linear-gradient(135deg, #16a34a 0%, #0f8a3b 100%) !important;
  border: 1px solid rgba(22, 163, 74, 0.35) !important;
  box-shadow: 0 20px 48px rgba(22, 163, 74, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.stock-image-open-separate::before,
.stock-image-open-separate::after {
  content: none !important;
  display: none !important;
}

.stock-image-open-separate:hover {
  box-shadow: 0 24px 54px rgba(22, 163, 74, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 920px) {
  .stock-image-modal:not(.is-separating),
  .stock-image-modal.is-separating {
    grid-template-columns: 1fr !important;
  }
}

/* 2026-07-30: estabilidad responsive y carga visual progresiva.
   Evita que pocas tarjetas filtradas se estiren y reduce trabajo de pintado. */
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

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

@supports (content-visibility: auto) {
  .stock-card,
  .stock-cart-item,
  .stock-command-row {
    content-visibility: auto;
    contain-intrinsic-size: 280px 420px;
  }
}

.stock-card img {
  transform: translateZ(0);
}

@media (min-width: 1120px) {
  .stock-grid {
    grid-template-columns: repeat(4, minmax(0, 270px)) !important;
    justify-content: center !important;
    align-items: start !important;
  }

  .stock-card,
  .stock-grid > * {
    max-width: 270px !important;
  }
}

@media (min-width: 820px) and (max-width: 1119px) {
  .stock-grid {
    grid-template-columns: repeat(3, minmax(0, 270px)) !important;
    justify-content: center !important;
  }
}

@media (min-width: 560px) and (max-width: 819px) {
  .stock-grid {
    grid-template-columns: repeat(2, minmax(0, 270px)) !important;
    justify-content: center !important;
  }
}

@media (max-width: 560px) {
  .stock-page,
  .stock-main,
  .stock-tools,
  .stock-grid {
    width: min(100%, calc(100vw - 20px)) !important;
  }

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

  .stock-card img {
    max-height: 220px;
    object-fit: contain;
  }

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

/* 2026-08-11: filtros usables en celular/iPad.
   En pantallas tactiles los dropdowns flotan encima del contenido y no quedan bajo cards. */
.stock-tools {
  isolation: isolate;
  overflow: visible !important;
}

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

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

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

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

  .stock-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;
  }

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

/* 2026-08-11: dropdowns web encima de filtros vecinos.
   Evita que un filtro abierto se esconda debajo de otro control. */
@media (min-width: 1181px) {
  .stock-tools > label,
  .stock-tools > .stock-check-filter,
  .stock-tools > .stock-search-filter {
    position: relative !important;
    z-index: 20 !important;
  }

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

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