/* Backend Sidebar - v1.21.1
   - 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)
*/

/* 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:700; 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); }
.bsb-acc-panel { padding:6px 0 10px; background:#fff; overflow:visible; font-weight:400; }
.bsb-acc-panel[hidden]{ display:none !important; }
.bsb-divider { height:1px; background:#e5e7eb; margin:6px 0 4px; }

/* Multiselect categorías */
.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; }
.bsb-ms-remove { background:#e5e7eb; border:0; border-radius:999px; width:18px; height:18px; line-height:18px; text-align:center; cursor:pointer; font-weight:700; }
.bsb-ms-input { width:100%; border:0; outline:none; padding:6px 4px 0 4px; font-size:14px; }
.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; }
.bsb-price-form input[type="number"] { font-variant-numeric: lining-nums tabular-nums; }
.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 comparten estilos) */
.bsb-offers, .bsb-store { margin-top:6px; }
.bsb-offers-title, .bsb-store-title { margin:2px 0 8px 0; font-size:16px; font-weight:700; text-transform:uppercase; }
.bsb-offers-list, .bsb-store-list { transition: opacity .7s ease, filter .7s ease; will-change: opacity, filter; }

/* Ítems (reuso de clases .bsb-off-*) */
.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; }
.bsb-off-meta { display:flex; flex-direction:column; gap:4px; min-width:0; }
.bsb-off-title { font-size:14px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bsb-off-price { font-size:14px; line-height:1; display:flex; align-items:center; }
.bsb-off-price .bsb-old { color:#9ca3af; text-decoration:line-through; margin-right:6px; }
.bsb-off-price .bsb-new { font-weight:700; }

/* ===== Modo unificado (Ofertas ↔ Tienda en el mismo espacio) ===== */
/* Fallback visible por defecto: capas en flujo normal (se ven incluso si JS no corre) */
.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;
}
/* Cuando el JS activa el modo apilado, superpone capas y el contenedor anima su altura */
.bsb-dual.is-layered .bsb-dual-layer {
  position: absolute;
  inset: 0;
  width: 100%;
}
.bsb-dual .bsb-dual-layer[hidden] {
  display: none !important;
}
