:root{
  --bysaa-sc-bg:#fff;
  --bysaa-sc-ink:#111827;
  --bysaa-sc-muted:#6B7280;
  --bysaa-sc-brand:#0ea5e9;
  --bysaa-sc-danger:#ef4444;
  --bysaa-sc-radius:16px;
  --bysaa-sc-shadow:0 12px 32px rgba(0,0,0,.18);
  --bysaa-sc-bbar-h:60px;
}

/* ===== Botón cabecera (opcional) ===== */
.bysaa-sc-cart-button{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  position:relative; padding:10px 12px; background:transparent; color:var(--bysaa-sc-ink);
  border:1px solid #e5e7eb; border-radius:999px; cursor:pointer;
}
.bysaa-sc-cart-button:hover{ border-color:#d1d5db; }

/* Ocultar botón flotante legado */
.bysaa-sc-floating-cart-btn{ display:none !important; }

/* ===== Badge contador ===== */
.bysaa-sc-badge{
  position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 4px;
  background:var(--bysaa-sc-brand); color:#fff; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; line-height:1; font-weight:700; z-index:2;
}
.bysaa-sc-bottom-bar .bysaa-sc-tab .bysaa-sc-badge{ top:2px; right:18px; }

/* ===== Overlay ===== */
#bysaa-sc-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:2147483646;
}
#bysaa-sc-overlay[hidden]{ display:none; }

/* ===== Panel Carrito ===== */
.bysaa-sc-panel{
  position:fixed; top:0; right:0; height:100%; width:380px; max-width:100%;
  background:var(--bysaa-sc-bg); color:var(--bysaa-sc-ink);
  box-shadow:var(--bysaa-sc-shadow); transform:translateX(105%); transition:transform .25s ease;
  z-index:2147483647; display:flex; flex-direction:column;
}
.bysaa-sc-panel[data-open="1"]{ transform:none; }
@media (max-width:767px){
  .bysaa-sc-panel{
    left:0; right:0; width:100%; height:75vh; bottom:0; top:auto;
    border-top-left-radius:var(--bysaa-sc-radius); border-top-right-radius:var(--bysaa-sc-radius);
    transform:translateY(105%);
  }
  .bysaa-sc-panel[data-open="1"]{ transform:translateY(0); }
}

/* Header */
.bysaa-sc-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid #eee; font-weight:700;
}
.bysaa-sc-close{ background:transparent; border:0; font-size:28px; line-height:1; cursor:pointer; }

/* Contenido carrito */
.bysaa-sc-content{ overflow:auto; padding-bottom:12px; }
.bysaa-sc-skeleton{ padding:16px; }
.bysaa-sc-skeleton .line{ height:14px; background:#eee; margin:10px 0; border-radius:8px; }

/* Lista de items */
.bysaa-sc-items{ list-style:none; margin:0; padding:8px 12px; display:grid; gap:12px; }
.bysaa-sc-item{ display:grid; grid-template-columns:72px 1fr; gap:12px; align-items:start; }
.bysaa-sc-img img{ width:72px; height:72px; object-fit:cover; border-radius:12px; }
.bysaa-sc-meta{ display:flex; flex-direction:column; gap:6px; }
.bysaa-sc-title{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-weight:600; color:var(--bysaa-sc-ink); text-decoration:none; }
.bysaa-sc-price{ color:var(--bysaa-sc-ink); font-weight:600; }

/* Acciones fila */
.bysaa-sc-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.bysaa-sc-qty{ display:inline-flex; align-items:center; gap:8px; }
.bysaa-sc-btn{ border:1px solid #e5e7eb; background:#fff; padding:6px 10px; border-radius:999px; cursor:pointer; }
.bysaa-sc-btn:hover{ background:#f3f4f6; }
.bysaa-sc-num{ min-width:20px; text-align:center; }
.bysaa-sc-remove{ border-color:#fca5a5; color:var(--bysaa-sc-danger); }
.bysaa-sc-remove:hover{ background:#fff1f2; }

/* Resumen carrito */
.bysaa-sc-summary{ padding:12px 16px; border-top:1px solid #eee; position:sticky; bottom:0; background:#fff; }
.bysaa-sc-sumrow{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.bysaa-sc-actions{ display:flex; gap:10px; }
.bysaa-sc-primary{ background:var(--bysaa-sc-brand); color:#fff; border-color:transparent; }
.bysaa-sc-primary:hover{ filter:brightness(0.95); }
.bysaa-sc-ghost{ background:#fff; color:var(--bysaa-sc-ink); }
.bysaa-sc-note{ color:var(--bysaa-sc-muted); font-size:12px; margin-top:8px; }

/* Vacío */
.bysaa-sc-empty{ padding:24px; text-align:center; color:var(--bysaa-sc-muted); }
.bysaa-sc-link{ color:var(--bysaa-sc-brand); font-weight:600; }

/* ===== Barra inferior (3 tabs: Inicio / Carrito / Cuenta) ===== */
.bysaa-sc-bottom-bar{
  position:fixed; left:0; right:0; bottom:0; height:var(--bysaa-sc-bbar-h);
  background:#fff; box-shadow:0 -10px 24px rgba(0,0,0,.08);
  display:none; z-index:2147483645;
  padding:6px 8px; gap:8px;
}
.bysaa-sc-tab{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; text-decoration:none; color:var(--bysaa-sc-ink); font-size:13px; background:transparent; border:0; position:relative;
  font-weight:600;
}
.bysaa-sc-tab .ic{ width:24px; height:24px; display:inline-flex; }
@supports not (gap: 1rem) {
  .bysaa-sc-bottom-bar .bysaa-sc-tab + .bysaa-sc-tab { margin-left:8px; }
}
@media (max-width:767px){ .bysaa-sc-bottom-bar{ display:flex; } }
body.bysaa-sc-has-bbar{ padding-bottom:var(--bysaa-sc-bbar-h); }

/* Oculta barra si hay sheet (Cuenta o Carrito) abierto en móvil */
@media (max-width:767px){
  .bysaa-sc-panel[data-open="1"] ~ .bysaa-sc-bottom-bar,
  .bysaa-sc-accounts[data-open="1"] ~ .bysaa-sc-bottom-bar{ visibility:hidden; }
}

/* ===== Mini-menú Cuenta (sheet con FLEX, robusto a overlays) ===== */
.bysaa-sc-accounts{
  position:fixed; inset:0; z-index:2147483647;
  display:flex; align-items:center; justify-content:center;
  visibility:hidden; opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.bysaa-sc-accounts[data-open="1"]{ visibility:visible; opacity:1; pointer-events:auto; }
.bysaa-sc-acc-wrap{
  width:420px; max-width:90vw; background:#fff; border-radius:16px; box-shadow:var(--bysaa-sc-shadow); overflow:hidden;
  transform:translateY(8px); transition:transform .2s ease;
}
.bysaa-sc-accounts[data-open="1"] .bysaa-sc-acc-wrap{ transform:translateY(0); }
.bysaa-sc-acc-header{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #eee; font-weight:700; }
.bysaa-sc-acc-body{ padding:16px; display:grid; gap:12px; }
.bysaa-sc-acc-btn{ display:flex; align-items:center; justify-content:center; padding:12px 14px; border-radius:12px; text-decoration:none; border:1px solid #e5e7eb; color:var(--bysaa-sc-ink); }
.bysaa-sc-acc-btn.bysaa-sc-primary{ background:var(--bysaa-sc-brand); border-color:transparent; color:#fff; }
.bysaa-sc-acc-btn.bysaa-sc-ghost:hover{ background:#f9fafb; }
@media (max-width:767px){
  .bysaa-sc-accounts{ align-items:flex-end; }
  .bysaa-sc-acc-wrap{
    width:100%; max-width:100%;
    border-top-left-radius:var(--bysaa-sc-radius); border-top-right-radius:var(--bysaa-sc-radius);
  }
}

/* ====== Parche anti-overlays/stacking cuando hay UI abierta ====== */
html[data-bysaa-open], body[data-bysaa-open]{ transform:none !important; overflow:hidden; }
body[data-bysaa-open] .site-overlay,
body[data-bysaa-open] .offcanvas-overlay,
body[data-bysaa-open] .drawer-overlay,
body[data-bysaa-open] .header-search-overlay,
body[data-bysaa-open] .mm-ocd,
body[data-bysaa-open] .mfp-bg,
body[data-bysaa-open] .mfp-wrap { display:none !important; }

