/* Backend Sidebar - v1.22.0
   - Reusar sidebar del tema/Woo en páginas seleccionadas (layout 2 columnas)
   - NO se alteran estilos de .widget-area: hereda del tema
   - Carrusel arriba del loop en Tienda/archivos
   - Estilos del shortcode [bsb_sidebar] para tus filtros/ofertas/tienda (si los usás dentro del widget)
   - NUEVO 1.22.0: Tienda/Ofertas heredan escala/color/hover y grow desde
     “Carrusel de productos — Estilo” (por dispositivo), vía variables CSS.
*/

/* Contenedor para que no quede pegado al borde */
.bsb-template-wrap { max-width: var(--bsb-container, 1200px); margin: 0 auto; padding: 0 16px; }

/* Layout 2 columnas (solo cuando el tema no imprime sidebar por sí mismo) */
.bsb-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}
@media (max-width: 1024px) {
  .bsb-layout { grid-template-columns: 1fr; gap: 16px; }
}

/* Importante: no tocamos .widget-area/.shop-sidebar para respetar estilo del tema */

/* ===== Estilos de tu shortcode [bsb_sidebar] (filtros/accordion/ofertas/tienda) ===== */
.bsb-sidebar.bsb-desktop-sidebar { display:block; width:100%; }
.bsb-filters-box { border:1px solid #e5e7eb; border-radius:6px; background:#fff; padding:10px; overflow:visible; font-weight:400; }
.bsb-accordion .bsb-acc-item { border:0; background:transparent; overflow:visible; margin-bottom:0; }
.bsb-acc-header { display:flex; align-items:center; justify-content:space-between; width:100%; padding:10px 6px; background:#fff; border:0; cursor:pointer; font-weight:600; font-size:14px; line-height:1.2; }
.bsb-acc-header:hover { background:#f5f5f5; }
.bsb-acc-caret { display:inline-block; width:10px; height:10px; margin-left:10px; position:relative; }
.bsb-acc-caret::before { content:""; position:absolute; inset:0; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); }
.bsb-acc-header[aria-expanded="true"] .bsb-acc-caret::before { transform:rotate(45deg); }

/* Menor padding inferior de panel para compactar */
.bsb-acc-panel { padding:6px 0 8px; background:#fff; overflow:visible; font-weight:400; }

/* Línea divisoria (general) */
.bsb-divider { height:1px; background:#e5e7eb; margin:4px 0 2px; }

/* SOLO la línea que separa PRECIO del bloque Ofertas/Tienda: aún más cerca */
.bsb-filter-price + .bsb-divider { margin:0 0 0; }

/* Multiselect categorías (texto interno normal / sin negrita) */
.bsb-ms { position:relative; border:1px solid #d1d5db; border-radius:6px; padding:6px; font-weight:400; }
.bsb-ms:focus-within { border-color:#9ca3af; }
.bsb-ms-selected { display:flex; flex-wrap:wrap; gap:6px; font-weight:400; }
.bsb-ms-token { display:inline-flex; align-items:center; gap:6px; background:#f3f4f6; border:1px solid #e5e7eb; border-radius:999px; padding:4px 8px; font-size:13px; font-weight:400; }
.bsb-ms-remove { background:#e5e7eb; border:0; border-radius:999px; width:18px; height:18px; line-height:18px; text-align:center; cursor:pointer; font-weight:600; }
.bsb-ms-input { width:100%; border:0; outline:none; padding:6px 4px 0 4px; font-size:14px; font-weight:400; }
.bsb-ms-input::placeholder { font-weight:400; }
.bsb-ms-dropdown { position:absolute; left:-1px; right:-1px; top:100%; z-index:9999; background:#fff; border:1px solid #d1d5db; border-top:0; max-height:360px; overflow:auto; border-radius:0 0 6px 6px; box-shadow:0 8px 16px rgba(0,0,0,.08); }
.bsb-ms-opt { height:36px; display:flex; align-items:center; padding:0 10px; cursor:pointer; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bsb-ms-opt:hover { background:#f5f5f5; }

/* Precio */
.bsb-price-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.bsb-price-sep { opacity:.7; }

/* type=number sin spinners y sin negrita */
.bsb-price-form input[type="number"] {
  font-variant-numeric: lining-nums tabular-nums;
  -moz-appearance: textfield; /* Firefox */
  font-weight: 400;
}
/* Inputs precio 13px para que “Mínimo/Máximo” entren completos */
.bsb-price-form .bsb-input { font-size:13px; }

.bsb-price-form input[type="number"]::-webkit-outer-spin-button,
.bsb-price-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0; /* WebKit */
}

.bsb-input { flex:1 1 0; min-width:0; border:1px solid #d1d5db; border-radius:6px; padding:8px 10px; font-size:14px; outline:none; background:#fff; }
.bsb-input:focus { border-color:#9ca3af; }
.bsb-btn { display:inline-block; border:1px solid #d1d5db; border-radius:6px; padding:8px 14px; font-size:14px; background:#f3f4f6; cursor:pointer; }
.bsb-btn[disabled]{ opacity:.5; cursor:not-allowed; }
.bsb-btn:not([disabled]):hover{ background:#e5e7eb; }

/* ====== Listas (Ofertas y Tienda) ====== */
.bsb-offers, .bsb-store { margin-top:6px; }
.bsb-offers-title, .bsb-store-title { margin:2px 0 8px 0; font-size:16px; font-weight:600; text-transform:uppercase; }

/* NUEVO: variables para heredar estilo del carrusel de productos */
.bsb-offers-list,
.bsb-store-list {
  --bsb-list-text-scale: 100;                  /* 80–130, según Estilo (Desktop/Mobile) */
  --bsb-list-text-color: inherit;              /* color base */
  --bsb-list-text-hover-color: inherit;        /* color hover */
  transition: color .18s ease;
}
.bsb-offers-list, .bsb-store-list { transition: opacity .7s ease, filter .7s ease; will-change: opacity, filter; }

/* Ítems */
.bsb-off-item { display:grid; grid-template-columns:56px 1fr; gap:10px; align-items:center; padding:6px 0; text-decoration:none; color:inherit; width:100%; }
.bsb-off-thumb { width:56px; height:56px; border-radius:4px; overflow:hidden; background:#f2f2f2; }
.bsb-off-thumb img { width:100%; height:100%; object-fit:cover; display:block; transition: transform .18s ease; will-change: transform; }
.bsb-off-meta { display:flex; flex-direction:column; gap:4px; min-width:0; }

/* Título: usar escala del carrusel (base 12px, como el carrusel) */
.bsb-off-title {
  font-size: calc( (12px * var(--bsb-list-text-scale)) / 100 );
  line-height:1.2;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color: var(--bsb-list-text-color);
  transition: color .18s ease;
}

/* Precio: una sola línea con ellipsis, escala del carrusel */
.bsb-off-price {
  font-size: calc( (12px * var(--bsb-list-text-scale)) / 100 );
  line-height:1; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color: var(--bsb-list-text-color);
  transition: color .18s ease, transform .18s ease;
  will-change: transform;
}
.bsb-off-price .bsb-old { color:#9ca3af; text-decoration:line-through; margin-right:6px; }
.bsb-off-price .bsb-new { font-weight:600; }

/* Hover: aplicar color de hover solo a título y precio (la vieja oferta queda gris) */
.bsb-off-item:hover .bsb-off-title,
.bsb-off-item:focus .bsb-off-title,
.bsb-off-item:hover .bsb-off-price,
.bsb-off-item:focus .bsb-off-price {
  color: var(--bsb-list-text-hover-color);
}

/* ===== Grow opcional (heredado de Estilo del carrusel) ===== */
.bsb-list--zoom-img .bsb-off-item:hover .bsb-off-thumb img { transform: scale(1.05); }
.bsb-list--zoom-price .bsb-off-item:hover .bsb-off-price { transform: scale(1.03); }

/* ===== Ajustes específicos para TIENDA/OFERTAS (tamaños) ===== */
.bsb-store .bsb-off-item,
.bsb-dual-store .bsb-off-item { grid-template-columns:72px 1fr; }
.bsb-store .bsb-off-thumb,
.bsb-dual-store .bsb-off-thumb { width:72px; height:72px; }

.bsb-offers .bsb-off-item,
.bsb-dual-offers .bsb-off-item { grid-template-columns:72px 1fr; }
.bsb-offers .bsb-off-thumb,
.bsb-dual-offers .bsb-off-thumb { width:72px; height:72px; }

/* ===== Modo unificado (Ofertas ↔ Tienda en el mismo espacio) ===== */
.bsb-dual {
  margin-top:6px;
  position: relative;
  overflow: hidden;
  transition: height .7s ease;
}
.bsb-dual .bsb-dual-layer {
  position: relative; /* flujo normal hasta que el JS active el modo apilado */
  width: 100%;
  transition: opacity .7s ease, filter .7s ease;
}
.bsb-dual.is-layered .bsb-dual-layer {
  position: absolute;
  inset: 0;
  width: 100%;
}
.bsb-dual .bsb-dual-layer[hidden] {
  display: none !important;
}
