
/* ── Admin Orders ────────────────────────────────────────────── */

.orders-search-form {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.order-tabs {
  display: flex; gap: 0; overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}
.order-tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .6rem 1rem; font-size: .78rem; font-weight: 500;
  color: var(--color-muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.order-tab:hover  { color: var(--color-text); }
.order-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.order-tab__count {
  background: var(--color-bg); color: var(--color-muted);
  font-size: .68rem; font-weight: 700;
  padding: .1rem .4rem; border-radius: 20px;
}
.order-tab.active .order-tab__count { background: var(--color-primary); color: white; }

.row--highlight td { background: #FFFBEB !important; }

/* Detalle de pedido */
.order-detail-grid {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 1.25rem; align-items: start;
}
.order-detail-header { padding: 1.5rem 1.5rem 0; }
.order-detail-header__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.order-detail-header__number {
  font-size: 1.1rem; font-weight: 700; font-family: monospace; letter-spacing: .05em;
}

/* Timeline */
.status-timeline {
  display: flex; align-items: center;
  padding: 1.25rem 0; overflow-x: auto;
}
.status-timeline__step { display: flex; flex-direction: column; align-items: center; gap: .4rem; flex-shrink: 0; }
.status-timeline__dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-bg); border: 2px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; transition: all .2s;
}
.status-timeline__step.done .status-timeline__dot  { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.status-timeline__step.current .status-timeline__dot { border-color: currentColor; border-width: 3px; }
.status-timeline__label { font-size: .65rem; color: var(--color-muted); white-space: nowrap; font-weight: 500; }
.status-timeline__step.done .status-timeline__label    { color: var(--color-primary); }
.status-timeline__step.current .status-timeline__label { font-weight: 600; }
.status-timeline__line {
  flex: 1; height: 2px; background: var(--color-border);
  min-width: 2rem; margin: 0 .25rem; margin-bottom: 1.4rem;
  transition: background .2s;
}
.status-timeline__line.done { background: var(--color-primary); }

/* Comprobantes */
.proof-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: .875rem 1rem; border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.proof-item--pending  { border-color: #FDE68A; background: #FFFBEB; }
.proof-item--verified { border-color: #A7F3D0; background: #F0FDF4; }
.proof-item__left { display: flex; gap: .75rem; align-items: flex-start; }
.proof-item__left i { font-size: 1.25rem; color: var(--color-muted); margin-top: .1rem; }

/* Log de estados */
.log-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding-bottom: 1rem; position: relative;
}
.log-item:not(:last-child)::after {
  content: ''; position: absolute;
  left: 7px; top: 16px; bottom: 0; width: 2px;
  background: var(--color-border);
}
.log-item__dot {
  width: 16px; height: 16px; border-radius: 50%;
  flex-shrink: 0; margin-top: .15rem;
}
.log-item__content { flex: 1; }
.log-item__title   { display: flex; align-items: center; gap: .35rem; margin-bottom: .2rem; }
.log-item__note    { font-size: .78rem; color: var(--color-muted); margin-bottom: .2rem; font-style: italic; }
.log-item__meta    { font-size: .7rem; color: var(--color-muted); }

/* Detalle rows sidebar */
.order-detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .5rem; font-size: .82rem;
  padding: .4rem 0; border-bottom: 1px solid var(--color-border);
}
.order-detail-row:last-child { border-bottom: none; }
.order-detail-row span:first-child { color: var(--color-muted); flex-shrink: 0; }
.table-card--danger { border-color: #FECACA; }

@media (max-width: 1024px) {
  .order-detail-grid { grid-template-columns: 1fr; }
}

/* ── Portal mayoristas ───────────────────────────────────────── */
.wholesale-portal { min-height: 100vh; }

.wholesale-header {
  background: #fff;
  border-top: 1px solid #f8f3ec;
  border-bottom: 1px solid #f8f3ec;
  padding: 1.25rem 0 0;
}
.wholesale-header__inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; padding-bottom: 1.25rem;
}
.wholesale-header__eyebrow {
  font-size: .68rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--color-accent, #B87333); margin-bottom: .3rem;
}
.wholesale-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary, #0D0D0D);
}
.wholesale-header__sub {
  font-size: .85rem;
  color: var(--color-mid, #6b7280);
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.wholesale-header__badge {
  background: var(--color-light-bg, #f3f4f6);
  color: var(--color-primary, #0D0D0D);
  font-size: .65rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .15rem .5rem; border-radius: 20px;
  border: 1px solid #f8f3ec;
}
.wholesale-header__actions { display: flex; gap: .75rem; align-items: center; }

.wholesale-cart-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem; background: var(--color-accent, #B87333);
  border: none; border-radius: var(--radius-sm, 6px); color: white;
  font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.wholesale-cart-btn:hover { background: #c98444; transform: translateY(-1px); }
.wholesale-cart-btn__label { white-space: nowrap; }
.wholesale-cart-btn__count { font-weight: 700; opacity: 0.9; }
.wholesale-cart-btn__total { font-weight: 700; }
.wholesale-cart-btn__empty { font-size: 0.7rem; opacity: 0.75; font-weight: 500; }

/* Layout portal — reutiliza .catalog-page del catálogo público */
.page-wholesale .wholesale-page {
  padding-top: 2rem;
  padding-bottom: 4rem;
}
.wholesale-header__link {
  color: var(--color-primary, #0D0D0D);
  border-color: var(--color-rule, #e5e7eb);
}
.wholesale-cart-btn__empty {
  font-size: .7rem;
  opacity: .75;
}

/* Botón flotante del carrito (siempre visible al scrollear) */
.wholesale-cart-fab {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 450;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  background: var(--color-primary); color: white;
  border: none; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; font-family: inherit;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.wholesale-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.28); }
.wholesale-cart-fab__badge {
  min-width: 1.35rem; height: 1.35rem; padding: 0 0.35rem;
  background: var(--color-accent, #B87333); color: white;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.wholesale-cart-fab__label { white-space: nowrap; }

.page-wholesale .wholesale-cart-fab { display: inline-flex; }

@media (min-width: 1024px) {
  .wholesale-cart-fab { display: none !important; }
}
.wholesale-cart-panel__note {
  font-size: .72rem;
  color: var(--color-mid);
  text-align: center;
  margin-top: .5rem;
}
.wholesale-modal { max-width: 560px; }
.wholesale-modal--matrix { max-width: min(920px, 96vw); }
.wholesale-modal__loading,
.wholesale-modal__error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-mid);
  font-size: .9rem;
}
.wholesale-modal__preview {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
  align-items: start;
}
.wholesale-modal__thumb {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--color-secondary);
}
.wholesale-modal__product-name {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: .3rem;
}
.wholesale-modal__meta { font-size: .78rem; color: var(--color-mid); margin-bottom: .25rem; }
.wholesale-modal__price { font-weight: 700; font-size: 1.05rem; margin-bottom: .35rem; }
.wholesale-modal__excerpt { font-size: .8rem; color: var(--color-mid); line-height: 1.5; }
.wholesale-modal__field { margin-bottom: .75rem; }
.wholesale-modal__label {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--color-mid); margin-bottom: .4rem;
}

/* Matriz talle × color */
.wm-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #c8c8c8;
  margin-bottom: 1rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
.wm-matrix {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
  font-size: .82rem;
}
.wm-matrix th,
.wm-matrix td {
  border: 1px solid #c8c8c8;
  padding: .35rem .4rem;
  text-align: center;
  vertical-align: middle;
}
.wm-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f4f4;
}
.wm-matrix__corner {
  text-align: left !important;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-mid);
  white-space: nowrap;
  min-width: 4.5rem;
  left: 0;
  z-index: 3;
}
.wm-matrix__size {
  text-align: left !important;
  font-weight: 600;
  background: #fafafa;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 3.25rem;
}
.wm-matrix__color-head {
  min-width: 5.5rem;
  max-width: 7.5rem;
  padding: .5rem .35rem !important;
}
.wm-matrix__swatch {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: var(--color-swatch-radius, 50%);
  border: 1px solid rgba(0,0,0,.15);
  margin: 0 auto .3rem;
}
.wm-matrix__color-name {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--color-primary);
  word-break: break-word;
}
.wm-matrix__input {
  width: 100%;
  max-width: 4rem;
  margin: 0 auto;
  display: block;
  text-align: center;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 0;
  padding: .45rem .25rem;
  background: transparent;
  color: var(--color-primary);
  appearance: textfield;
  -moz-appearance: textfield;
}
.wm-matrix__input::-webkit-outer-spin-button,
.wm-matrix__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wm-matrix__input:focus {
  outline: none;
  background: #f3f3f3;
  box-shadow: none;
}
.wm-matrix__cell {
  background: #fff;
  padding: 0 !important;
  border-color: #c8c8c8;
}
.wm-matrix__cell--na {
  background: #f7f7f7;
  color: #bbb;
  font-size: .75rem;
  padding: .35rem .4rem !important;
}
.wm-matrix-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding-top: .25rem;
}
.wm-matrix-footer__total {
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-mid);
}
.wm-matrix-footer__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: .4rem;
  margin-left: auto;
  width: 100%;
  max-width: 100%;
}
.wm-matrix-footer__actions .btn {
  min-width: 0;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  font-weight: 600;
  box-sizing: border-box;
}
.wm-matrix-footer__actions .btn--cart-add {
  flex: 1 1 68%;
  padding: 1rem 1.15rem;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  font-weight: 700;
  white-space: nowrap;
}
.wm-matrix-footer__actions .btn--cart-view {
  flex: 0 0 auto;
  max-width: 38%;
  padding: 0.55rem 0.7rem;
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.wm-matrix-footer__actions .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.wm-matrix-footer__actions .btn.is-ready:not(:disabled) {
  opacity: 1;
  cursor: pointer;
}
.btn--cart-add {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, color 0.28s ease, letter-spacing 0.28s ease;
}
.btn--cart-add::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.38) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
  z-index: 1;
}
.btn--cart-add:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}
.btn--cart-add:hover:not(:disabled)::after {
  animation: cartAddShine 0.55s ease forwards;
}
.btn--cart-add:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
@keyframes cartAddShine {
  to { transform: translateX(130%); }
}
.wholesale-checkout-summary {
  background: var(--color-light-bg);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}
.wholesale-checkout-summary__title {
  font-size: .8rem; font-weight: 600; margin-bottom: .25rem;
}
.wholesale-checkout-summary__body { font-size: .82rem; color: var(--color-mid); }
.form-label__optional { color: var(--color-muted); font-weight: 400; }
.cart-line-item__name { font-size: .82rem; font-weight: 500; }
.cart-line-item__meta { font-size: .73rem; color: var(--color-muted); }
.cart-line-item__subtotal { font-size: .8rem; font-weight: 600; margin-left: .5rem; }
.cart-line-item__remove { color: var(--color-error-txt); margin-left: .25rem; }

.product-card--wholesale .product-card__body { padding-top: 0.1rem; }
.product-card--wholesale .product-card__name { margin-bottom: 0.15rem; }

.wholesale-rules-box {
  background: var(--color-secondary); border-radius: var(--radius-md);
  padding: .875rem 1rem; margin-top: 1.5rem;
}
.wholesale-rules-box__title {
  font-size: .73rem; font-weight: 600; color: var(--color-mid);
  margin-bottom: .6rem;
}
.wholesale-rule-item { font-size: .78rem; color: var(--color-mid); line-height: 1.7; font-weight: 500; }

/* Product card wholesale extras */
.wholesale-in-cart-badge {
  position: absolute; bottom: .5rem; left: .5rem; right: .5rem;
  background: var(--color-primary); color: white;
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  text-align: center; padding: .25rem .5rem;
}
.wholesale-add-btn {
  width: 100%; margin-top: .6rem; padding: .5rem;
  background: var(--color-light-bg); border: 1px solid var(--color-rule);
  font-size: .75rem; font-weight: 500; color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  transition: all .15s;
}
.wholesale-add-btn:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* Cart panel lateral — debajo del header / encima del tabnav mobile */
.wholesale-cart-panel {
  position: fixed;
  top: var(--wholesale-chrome-top, 0px);
  right: 0;
  bottom: var(--wholesale-chrome-bottom, 0px);
  width: 380px;
  background: white; z-index: 1050;
  transform: translateX(100%); transition: transform .3s;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.wholesale-cart-panel.open { transform: none; }
.wholesale-cart-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-rule);
  font-weight: 600;
}
.wholesale-cart-panel__header button { color: var(--color-mid); font-size: 1.1rem; }
.wholesale-cart-panel__body   { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.wholesale-cart-panel__footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--color-rule); }
.wholesale-cart-empty         { text-align: center; padding: 3rem 1rem; color: var(--color-mid); font-size: .85rem; }
.wholesale-cart-summary       { margin-bottom: 1rem; }
.wholesale-cart-summary__row  { display: flex; justify-content: space-between; font-size: .85rem; padding: .3rem 0; }
.wholesale-cart-summary__row--total { font-size: 1rem; font-weight: 700; border-top: 1px solid var(--color-rule); padding-top: .6rem; margin-top: .3rem; }

/* Cart line items */
.cart-line-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--color-rule);
  font-size: .82rem;
}
.cart-line-item:last-child { border-bottom: none; }
.cart-line-item__controls  { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.cart-line-item__controls button {
  width: 22px; height: 22px; border: 1px solid var(--color-rule);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--color-mid);
}
.cart-line-item__controls button:hover { background: var(--color-light-bg); }
.cart-line-item__controls span { min-width: 1.5rem; text-align: center; font-weight: 600; }

/* Modales (producto + checkout) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: white;
  border-radius: var(--radius-lg, 12px);
  width: 100%; max-width: 480px;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: wholesaleModalIn 0.2s ease;
}
@keyframes wholesaleModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-rule);
  flex-shrink: 0;
}
.modal__title  { font-size: 1rem; font-weight: 600; }
.modal__close  {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--color-mid); font-size: 1.1rem;
}
.modal__close:hover { background: var(--color-light-bg); color: var(--color-primary); }
.modal__body   { padding: 1.25rem; overflow-y: auto; }
.modal__footer {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-rule);
  flex-shrink: 0;
}

/* Backdrop carrito lateral — no cubre el header del sitio */
.wholesale-cart-backdrop {
  position: fixed;
  top: var(--wholesale-chrome-top, 0px);
  right: 0;
  bottom: var(--wholesale-chrome-bottom, 0px);
  left: 0;
  z-index: 1045;
  background: rgba(0,0,0,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.wholesale-cart-backdrop.visible {
  opacity: 1; pointer-events: auto;
}
.wholesale-cart-backdrop[hidden] { display: none; }

/* Cantidad en modal */
.wholesale-qty-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.wholesale-qty-row__label {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-mid);
}
.wholesale-qty-control {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--color-rule); border-radius: var(--radius-sm);
}
.wholesale-qty-control button {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--color-mid);
}
.wholesale-qty-control button:hover { background: var(--color-light-bg); }
.wholesale-qty-control input {
  width: 48px; text-align: center; border: none; border-left: 1px solid var(--color-rule);
  border-right: 1px solid var(--color-rule); font-size: 0.9rem; font-weight: 600;
  padding: 0.4rem 0; font-family: inherit;
}
.wholesale-modal__hint {
  font-size: 0.78rem; color: var(--color-mid); margin-top: 0.35rem;
}

/* Toast de confirmación */
.wholesale-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 700;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}
.wholesale-toast:empty {
  display: none;
}
.wholesale-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (max-width: 767.98px) {
  [data-design-template="isostasia"] .wholesale-toast {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

.wholesale-cart-btn--pulse { animation: cartPulse 0.5s ease; }
@keyframes cartPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* Ficha de producto — misma matriz que la vista rápida */
.product-order-matrix {
  margin: 1.25rem 0 0;
  min-width: 0;
  max-width: 100%;
}
.product-order-matrix__label {
  margin: 0 0 .65rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-text-muted, #6b7280);
}
.product-order-matrix__wrap {
  margin: 0;
  max-width: 100%;
}
.product-order-matrix .wm-matrix-wrap {
  max-height: none !important;
  overflow-x: auto;
  overflow-y: visible !important;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.product-order-matrix .wm-matrix {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.product-order-matrix .wm-matrix__color-head {
  min-width: 0;
  max-width: none;
  padding: .4rem .2rem !important;
  text-align: center !important;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 1;
}
.product-order-matrix .wm-matrix__corner,
.product-order-matrix .wm-matrix__size {
  min-width: 0;
  white-space: normal;
}
.product-order-matrix .wm-matrix__color-name {
  display: block;
  font-size: .6rem;
  word-break: break-word;
}
.product-order-matrix .wm-matrix__input {
  max-width: none;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: .45rem .15rem;
  box-shadow: none;
}
.product-order-matrix .wm-matrix__input:focus {
  background: #f3f3f3;
  box-shadow: none;
  border: none;
}
.product-order-matrix .wm-matrix__cell {
  border-color: #c8c8c8;
}
.product-order-matrix .qv-color-swatch {
  display: block;
  margin: 0 auto .25rem;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}
.wm-matrix--sizes-cols .wm-matrix__size-head {
  font-weight: 600;
  min-width: 3.25rem;
  white-space: nowrap;
}
.wm-matrix--sizes-cols .wm-matrix__color-head {
  text-align: left !important;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fafafa;
  min-width: 7rem;
  max-width: 10rem;
  padding: .45rem .5rem !important;
  white-space: nowrap;
}
.wm-matrix--sizes-cols .wm-matrix__swatch {
  display: inline-block;
  vertical-align: middle;
  margin: 0 .45rem 0 0;
}
.wm-matrix--sizes-cols .wm-matrix__color-name {
  display: inline;
  vertical-align: middle;
  word-break: normal;
}
.product-order-matrix .wm-matrix--sizes-cols .wm-matrix__color-head {
  min-width: 0;
  max-width: none;
  padding: .4rem .2rem !important;
  white-space: normal;
  background: #fff;
}
.product-order-matrix .wm-matrix--sizes-cols .wm-matrix__swatch {
  display: block;
  margin: 0 auto .25rem;
}
.product-order-matrix .wm-matrix--sizes-cols .wm-matrix__color-name {
  display: block;
}
.product-order-matrix__footer {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid rgba(0,0,0,.08);
}
.product-order-matrix__retail-off {
  margin: 0;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--color-text-muted, #6b7280);
}
.product-order-matrix__retail-off a {
  color: inherit;
  text-decoration: underline;
}
.product-order-matrix__msg {
  margin: .65rem 0 0;
  font-size: .9rem;
  color: var(--color-success, #166534);
}
.product-order-matrix .size-guide-link {
  margin-top: .75rem;
}

/* Matriz de pedido (admin / detalle) — solo lectura */
.order-item-matrices {
  padding: 1.35rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.order-item-matrix {
  margin: 0;
}
.order-item-matrix__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .85rem;
  padding: 0 .15rem;
}
.order-item-matrix__name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
}
.order-item-matrix__meta {
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--color-muted, #6b7280);
}
.order-item-matrix__subtotal {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  padding-top: .1rem;
}
.order-item-matrix__wrap {
  max-height: none;
  margin: 0;
  overflow-x: auto;
}
.wm-matrix--readonly .wm-matrix__qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 2.1rem;
  padding: .25rem .4rem;
  font-size: .92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text, #1a1a1a);
  background: #f4f7f2;
  border-radius: 4px;
}
.order-item-matrices__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .25rem;
  padding: 1rem 0.15rem 0.15rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  font-size: .9rem;
}
.order-item-matrices__total strong {
  font-size: 1.2rem;
}

/* Responsive portal */
@media (max-width: 768px) {
  .wholesale-header__inner { flex-direction: column; align-items: stretch; }
  .wholesale-header__actions { flex-wrap: wrap; }
  .wholesale-cart-panel { width: 100%; }
  .wholesale-modal__preview { grid-template-columns: 80px 1fr; }
  .wholesale-modal--matrix { max-width: 100%; }
  .wm-matrix-footer { flex-direction: column; align-items: stretch; }
  .wm-matrix-footer__actions { margin-left: 0; }
  .wm-matrix-footer__actions .btn--cart-add {
    flex: 1 1 66%;
    padding: 0.95rem 0.7rem;
    font-size: 0.8rem;
  }
  .wm-matrix-footer__actions .btn--cart-view {
    flex: 0 1 auto;
    max-width: 34%;
    padding: 0.5rem 0.5rem;
    font-size: 0.6rem;
  }
  .modal__footer { flex-direction: column-reverse; }
  .modal__footer .btn { width: 100%; justify-content: center; }

  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__color-name {
    display: none !important;
  }
  .product-order-matrix .quick-view__color-hint {
    display: flex;
  }
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__color-head,
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__corner {
    width: 2.35rem !important;
    min-width: 2.35rem !important;
    max-width: 2.35rem !important;
    padding: 0.3rem 0.1rem !important;
    text-align: center !important;
    white-space: normal;
    box-sizing: border-box;
  }
  .product-order-matrix .wm-matrix__corner {
    font-size: 0.55rem;
    line-height: 1.15;
  }
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__swatch {
    display: block;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0 auto;
  }
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__swatch.is-active-row {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__size-head,
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__cell {
    width: auto !important;
    min-width: 2.4rem !important;
    max-width: none !important;
    box-sizing: border-box;
    padding: 0 !important;
  }
  .product-order-matrix .wm-matrix--sizes-cols .wm-matrix__size-head {
    font-size: 0.68rem;
    font-weight: 700;
  }
  .product-order-matrix .wm-matrix__input {
    font-size: 16px !important;
    line-height: 1.1;
    min-height: 2.4rem;
    padding: 0.3rem 0;
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
  }
  .product-order-matrix .wm-matrix-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .product-order-matrix .wm-matrix {
    table-layout: fixed;
    width: max(100%, calc(2.35rem + (var(--qv-size-cols, 6) * 2.4rem)));
    min-width: 0;
    border-collapse: collapse;
  }
  .product-order-matrix .qv-color-bubble {
    display: none !important;
  }
  .product-order-matrix__footer {
    padding-bottom: .25rem;
  }
}

@media (max-width: 480px) {
  .wm-matrix-footer__actions .btn--cart-add {
    white-space: normal;
    line-height: 1.15;
    font-size: 0.78rem;
    padding: 0.9rem 0.55rem;
  }
}
