@media (max-width: 768px) {
  #psqob2b-filters {
    position: relative;
    top: auto;
    z-index: auto;
    box-shadow: none;
  }
}

body#psquickorderb2b-quickorder main#page {
  overflow: visible !important;
}

/* Sticky filters bar (Quickorder B2B) */
#psqob2b-filters {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2000;
  background: #fff;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Opcional: efecto sutil para que se note que es una barra flotante */
#psqob2b-filters.is-sticky-shadow {
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
/* FIX: sticky no funciona si algún padre tiene overflow/transform */
#psqob2b-wrapper,
#content,
#content-wrapper,
#main,
.page-content,
.card,
.card-block {
  overflow: visible !important;
  transform: none !important;
  filter: none !important;
}
.applyfilters:hover{
	border: 1px solid #605ba8 !important;
	background-color: white !important;
	color: #605ba8 !important;
	border-radius: 30px !important;
	
}

.psqob2b-nav-link{
	text-align: center;
}

.psqob2b-nav-link::marker{
	content: '';
}

.psqob2b-add-single:active{
	background-color: #605BA8;
}

.psqob2b-add-single:focus{
	background-color: white;
	border: 1px solid #605BA8;
}

.psqob2b-add-single:active:focus{
	background-color: #605BA8;
	border: 1px solid #605BA8;
}

#psqob2b-add-all:active{
	background-color: #605BA8;
}

#psqob2b-add-all:focus{
	background-color: white;
	border: 1px solid #605BA8;
	color: #605BA8;
}

#psqob2b-add-all:active:focus{
	background-color: #605BA8;
	border: 1px solid #605BA8;
	color: white;
}

.psqob2b-nav-link > a {
    color: #ffffff !important;
    background-color: #605BA8;
    border: 1px solid #605BA8;
    border-radius: 20px;
    padding: 10px 170px;
    margin: 5px 10px;
	width: 100%
}

.psqob2b-nav-link > a:hover {
    color: #605BA8 !important;
    background-color: #fff;
    border: 1px solid #605BA8;
    border-radius: 20px;
    padding: 10px 170px;
    margin: 5px 10px;
	width: 100%
}

.psqob2b-wrapper {
  margin-top: 20px;
}

.table th, .table td {
    vertical-align: middle;
}

.psqob2b-filters .row {
  margin-bottom: 15px;
}

.psqob2b-filter-buttons {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 32px;
}

.psqob2b-table img {
  max-width: 80px;
  height: auto;
}

.psqob2b-qty-input {
  width: 80px;
}

.psqob2b-loader,
.psqob2b-no-more {
  margin-top: 15px;
}

.psqob2b-nav-link a {
  font-weight: 600;
}
/* Grid de combinaciones dentro de la celda de atributos */
.psqob2b-variant-grid {
  display: grid;
  grid-auto-flow: column;                /* las celdas se colocan en columnas */
  grid-auto-columns: minmax(90px, 1fr);  /* ancho mínimo 90px, se reparte el resto */
  column-gap: 8px;
  row-gap: 4px;
}

/* Celda de cada variante (columna) */
.psqob2b-variant-cell {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 6px;
  text-align: center;
  background: #fafafa;
}

/* Label de atributo (Talla S, color rojo, etc.) */
.psqob2b-variant-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}

/* Stock pequeño bajo el atributo */
.psqob2b-variant-stock {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 4px;
}

/* Input de cantidad centrado y estrecho */
.psqob2b-variant-qty .psqob2b-variant-input {
  width: 70px;
  margin: 0 auto;
}

th {
    text-align: center;
}

#main > header > h1{
	margin-left: 1.5%;
    margin-top: 2%;
}

div.psqob2b-filter-buttons > button.btn-primary{
	background-color: #605BA8;
	color: white;
}

div.psqob2b-filter-buttons > button.btn-primary:hover{
	color: #605BA8;
	background-color: white;
	border: 1px solid #605BA8;
}

#psqob2b-add-all{
	border-radius: 20px;
}

td.psqob2b-add-one > button{
	background-color: #605BA8;
	color: white;
	border-radius: 20px;
}

td.psqob2b-add-one > button:hover{
	color: #605BA8;
	background-color: white;
	border: 1px solid #605BA8;
}

div.psqob2b-actions > button{
	background-color: #605BA8;
	color: white;
	border-radius: 30px;
}


div.psqob2b-actions > button:hover{
	color: #605BA8;
	background-color: white;
	border: 1px solid #605BA8;
}


/* En pantallas estrechas dejamos que se parta en varias filas */
@media (max-width: 768px) {
  .psqob2b-variant-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
@media (min-width: 1320px) {
    .container {
        width: 1450px !important;
    }
}

select#psqob2b-season {
	border: 2px solid #605BA8 !important;
	color: #605BA8;
	font-weight: 600;
	height: auto;
}

/* ====== Toast de Quick Order B2B ====== */

.psqob2b-toast {
  position: fixed;
  top: 80px;                 /* ajusta si quieres más arriba/abajo */
  right: 20px;
  z-index: 9999;

  padding: 8px 14px;
  border-radius: 6px;

  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;

  transition: opacity 0.2s ease, transform 0.2s ease;
}

.psqob2b-toast-success {
  background: #4caf50;       /* verde éxito */
}

.psqob2b-toast-error {
  background: #e53935;       /* rojo error */
}

.psqob2b-toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* Contenedor input + botones */
.psqob2b-variant-qty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Input centrado y no tan ancho */
.psqob2b-variant-qty .psqob2b-variant-input {
  width: 62px;
  text-align: center;
  margin: 0 auto;
}

/* Botones abajo en una fila */
.psqob2b-qty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

/* Botones +/- */
.psqob2b-qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #d5d5e3;
  background: #ffffff;
  color: #605BA8;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.psqob2b-qty-btn:hover {
  background: #f4f3fb;
  border-color: #c9c7e6;
}

.psqob2b-qty-btn:active {
  transform: scale(0.96);
}

/* ====== Semáforo stock en tarjetas de variante ====== */

/* Base: transición suave */
.psqob2b-variant-cell {
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

/* Sin stock -> rojo suave */
.psqob2b-variant-cell.psqob2b-stock-zero {
  background: rgba(229, 57, 53, 0.10);
  border-color: rgba(229, 57, 53, 0.35);
}

/* Stock bajo (<10) -> amarillo suave */
.psqob2b-variant-cell.psqob2b-stock-low {
  background: rgba(255, 193, 7, 0.14);
  border-color: rgba(255, 193, 7, 0.40);
}

/* Stock ok (>=10) -> verde suave */
.psqob2b-variant-cell.psqob2b-stock-ok {
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.35);
}

/* Texto de stock un pelín más contrastado */
.psqob2b-variant-cell.psqob2b-stock-zero .psqob2b-variant-stock {
  color: rgba(229, 57, 53, 0.95);
}
.psqob2b-variant-cell.psqob2b-stock-low .psqob2b-variant-stock {
  color: rgba(160, 110, 0, 0.95);
}
.psqob2b-variant-cell.psqob2b-stock-ok .psqob2b-variant-stock {
  color: rgba(46, 125, 50, 0.95);
}

/* ===== Ajuste de proporciones de columnas (desktop) ===== */
@media (min-width: 992px) {
  /* Imagen más compacta */
  .psqob2b-table td.psqob2b-image,
  .psqob2b-table th:nth-child(1) {
    width: 90px;
    white-space: nowrap;
  }

  /* Producto: limitar ancho para no comerse las tallas */
  .psqob2b-table td.psqob2b-name,
  .psqob2b-table th:nth-child(2) {
    width: 260px;            /* ajusta 240-320 según te guste */
    max-width: 260px;
  }

  /* Tallas: darle prioridad de ancho */
  .psqob2b-table td.psqob2b-attrs,
  .psqob2b-table th:nth-child(3) {
    width: auto;             /* que sea la columna “flexible” */
  }

  /* Precio */
  .psqob2b-table td.psqob2b-price,
  .psqob2b-table th:nth-child(4) {
    width: 110px;
    white-space: nowrap;
    text-align: right;
  }

  /* Añadir */
  .psqob2b-table td.psqob2b-add-one,
  .psqob2b-table th:nth-child(5) {
    width: 120px;
    white-space: nowrap;
    text-align: right;
  }
}

/* ===== Nombre del producto más compacto ===== */
.psqob2b-name a {
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* máximo 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}

.psqob2b-ref-inline {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;    /* evita que la referencia estire la celda */
  max-width: 100%;
}
.psqob2b-attrs .psqob2b-variant-grid {
  width: 100%;
}


/* =========================================================
   TABLETS HORIZONTAL (9"–14") - Quickorder table
   Estrategia:
   - A partir de 1181px intentamos que quepa.
   - En 1024–1180px hacemos scroll horizontal del bloque tabla.
   ========================================================= */

/* 1) Tablets grandes / portátiles pequeños (1181px–1366px)
   - Ajuste fino: producto más compacto, grid de tallas auto-fit */
@media (min-width: 1182px) and (max-width: 1366px) {
  /* columnas */
  .psqob2b-table td.psqob2b-image { width: 85px; }
  .psqob2b-table td.psqob2b-name  { width: 240px; max-width: 240px; }
  .psqob2b-table td.psqob2b-price { width: 110px; }
  .psqob2b-table td.psqob2b-add-one { width: 120px; }

  /* nombre máximo 2 líneas */
  .psqob2b-name a {
    -webkit-line-clamp: 2;
  }

  /* grid: que "envuelva" bien sin aplastar demasiado */
  .psqob2b-variant-grid {
    grid-auto-flow: unset;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 10px;
  }

  /* cards un poco más compactas */
  .psqob2b-variant-cell { padding: 8px 8px 10px; }
  .psqob2b-variant-label { font-size: 0.76rem; }
  .psqob2b-variant-stock { font-size: 0.70rem; }
  .psqob2b-variant-qty .psqob2b-variant-input { width: 56px; }
  .psqob2b-qty-btn { width: 26px; height: 26px; }
}


/* 2) Tablets medias (1024px–1180px) — iPad landscape / 10"-11"
   - Aquí es normal que NO quepa todo si hay muchas tallas.
   - Solución UX: scroll horizontal SOLO en el bloque de la tabla,
     manteniendo tamaño legible de las cards */
@media (min-width: 1024px) and (max-width: 1181px) {
  /* Hacemos que el contenedor de la tabla pueda scrollear */
  .psqob2b-table-wrap,
  .psqob2b-table-responsive,
  .psqob2b-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Si no tienes wrapper, aplica al parent típico: */
  .psqob2b-table {
    min-width: 1120px; /* fuerza scroll cuando sea necesario */
  }

  /* columnas más compactas */
  .psqob2b-table td.psqob2b-image { width: 80px; }
  .psqob2b-table td.psqob2b-name  { width: 220px; max-width: 220px; }
  .psqob2b-table td.psqob2b-price { width: 110px; white-space: nowrap; }
  .psqob2b-table td.psqob2b-add-one { width: 120px; white-space: nowrap; }

  /* nombre 2 líneas */
  .psqob2b-name a { -webkit-line-clamp: 2; }

  /* grid de tallas: mantenemos tamaño legible */
  .psqob2b-variant-grid {
    grid-auto-flow: column;                 /* se mantiene "en línea" */
    grid-auto-columns: minmax(115px, 1fr);  /* cards con tamaño cómodo */
    gap: 10px;
  }

  /* cards */
  .psqob2b-variant-cell { padding: 8px 8px 10px; }
  .psqob2b-variant-label { font-size: 0.76rem; }
  .psqob2b-variant-stock { font-size: 0.70rem; }
  .psqob2b-variant-qty .psqob2b-variant-input { width: 56px; }
  .psqob2b-qty-btn { width: 26px; height: 26px; }
}


/* 3) Tablets pequeñas (<= 1023px en horizontal, algunas 9" Android)
   - Aquí el scroll ya es prácticamente obligatorio si hay muchas tallas. */
@media (max-width: 1023px) and (orientation: landscape) {
  .psqob2b-table-wrap,
  .psqob2b-table-responsive,
  .psqob2b-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .psqob2b-table {
    min-width: 1180px; /* más margen para que no se aplaste */
  }

  .psqob2b-table td.psqob2b-name { width: 210px; max-width: 210px; }

  .psqob2b-variant-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr);
    gap: 10px;
  }
}

