/* =========================================================
   Tus Bodegas V3 — sistema de diseño
   Bootstrap 5.3 + tokens propios · claro/oscuro · mobile-first
   ========================================================= */

:root,
[data-bs-theme="light"] {
  --tb-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tb-bg: #f5f6f8;
  --tb-surface: #ffffff;
  --tb-surface-2: #f0f2f5;
  --tb-ink: #111827;
  --tb-ink-2: #344054;
  --tb-muted: #6b7280;
  --tb-border: #e5e7eb;
  --tb-primary: #0f766e;
  --tb-primary-600: #0d6560;
  --tb-primary-rgb: 15, 118, 110;
  --tb-primary-soft: rgba(15, 118, 110, .10);
  --tb-accent: #b45309;
  --tb-accent-soft: rgba(180, 83, 9, .10);
  --tb-success: #15803d;
  --tb-warning: #b45309;
  --tb-danger: #be123c;
  --tb-info: #0369a1;
  --tb-sidebar-bg: #0b1324;
  --tb-sidebar-ink: #c7cfdc;
  --tb-sidebar-muted: #6f7c92;
  --tb-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --tb-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --tb-shadow-lg: 0 24px 48px -16px rgba(16, 24, 40, .25);
  --tb-radius: 16px;
  --tb-radius-sm: 10px;
  --tb-sidebar-w: 268px;
  --tb-topbar-h: 64px;
  --tb-bottomnav-h: 64px;

  --bs-body-font-family: var(--tb-font);
  --bs-body-bg: var(--tb-bg);
  --bs-body-color: var(--tb-ink);
  --bs-border-color: var(--tb-border);
  --bs-primary: var(--tb-primary);
  --bs-primary-rgb: var(--tb-primary-rgb);
  --bs-link-color: var(--tb-primary);
  --bs-link-color-rgb: var(--tb-primary-rgb);
  --bs-link-hover-color: var(--tb-primary-600);
  --bs-border-radius: var(--tb-radius-sm);
  --bs-border-radius-lg: var(--tb-radius);
  --bs-secondary-color: var(--tb-muted);
  --bs-tertiary-bg: var(--tb-surface-2);
}

[data-bs-theme="dark"] {
  --tb-bg: #0b0f15;
  --tb-surface: #121821;
  --tb-surface-2: #18202b;
  --tb-ink: #e7ecf2;
  --tb-ink-2: #c3ccd8;
  --tb-muted: #8b97a7;
  --tb-border: #233041;
  --tb-primary: #2bb3a3;
  --tb-primary-600: #22a191;
  --tb-primary-rgb: 43, 179, 163;
  --tb-primary-soft: rgba(43, 179, 163, .14);
  --tb-accent: #f59e0b;
  --tb-accent-soft: rgba(245, 158, 11, .14);
  --tb-success: #4ade80;
  --tb-warning: #fbbf24;
  --tb-danger: #fb7185;
  --tb-info: #38bdf8;
  --tb-sidebar-bg: #080c12;
  --tb-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --tb-shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .7);

  --bs-body-bg: var(--tb-bg);
  --bs-body-color: var(--tb-ink);
  --bs-border-color: var(--tb-border);
  --bs-primary: var(--tb-primary);
  --bs-primary-rgb: var(--tb-primary-rgb);
  --bs-link-color: var(--tb-primary);
  --bs-link-color-rgb: var(--tb-primary-rgb);
  --bs-secondary-color: var(--tb-muted);
  --bs-tertiary-bg: var(--tb-surface-2);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tb-font);
  background: var(--tb-bg);
  color: var(--tb-ink);
  font-size: .9375rem;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-weight: 700; letter-spacing: -.02em; color: var(--tb-ink); }
.text-muted, .text-secondary { color: var(--tb-muted) !important; }
::selection { background: var(--tb-primary-soft); }
a { text-decoration: none; }
.fw-semibold { font-weight: 600 !important; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: var(--tb-radius-sm); padding: .55rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8125rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.35rem; font-size: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--tb-primary); --bs-btn-border-color: var(--tb-primary);
  --bs-btn-hover-bg: var(--tb-primary-600); --bs-btn-hover-border-color: var(--tb-primary-600);
  --bs-btn-active-bg: var(--tb-primary-600); --bs-btn-active-border-color: var(--tb-primary-600);
  --bs-btn-disabled-bg: var(--tb-primary); --bs-btn-disabled-border-color: var(--tb-primary);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.08), inset 0 1px 0 rgba(255,255,255,.12);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #04201d; --bs-btn-hover-color: #04201d; --bs-btn-active-color: #04201d; }
.btn-soft { background: var(--tb-primary-soft); color: var(--tb-primary); border: 0; }
.btn-soft:hover { background: rgba(var(--tb-primary-rgb), .18); color: var(--tb-primary); }
.btn-ghost { background: transparent; border: 1px solid var(--tb-border); color: var(--tb-ink-2); }
.btn-ghost:hover { background: var(--tb-surface-2); color: var(--tb-ink); border-color: var(--tb-border); }
.btn-danger-soft { background: rgba(190, 18, 60, .1); color: var(--tb-danger); border: 0; }
.btn-danger-soft:hover { background: rgba(190, 18, 60, .18); color: var(--tb-danger); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 32px; height: 32px; border-radius: 9px; }

/* ---------- Formularios ---------- */
.form-label { font-weight: 600; font-size: .8125rem; color: var(--tb-ink-2); margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: var(--tb-radius-sm); border-color: var(--tb-border); background-color: var(--tb-surface);
  padding: .6rem .85rem; font-size: 1rem; color: var(--tb-ink);
}
@media (min-width: 768px) { .form-control, .form-select { font-size: .9375rem; } }
.form-control:focus, .form-select:focus { border-color: var(--tb-primary); box-shadow: 0 0 0 4px var(--tb-primary-soft); }
.form-text { color: var(--tb-muted); }
.form-check-input:checked { background-color: var(--tb-primary); border-color: var(--tb-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--tb-primary-soft); border-color: var(--tb-primary); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--tb-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }

/* ---------- Tarjetas ---------- */
.card { --bs-card-bg: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: var(--tb-radius); box-shadow: var(--tb-shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--tb-border); padding: 1rem 1.25rem; font-weight: 700; }
.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--tb-border); }
.card-title { font-size: 1rem; margin: 0; }

.stat {
  position: relative; overflow: hidden; padding: 1.15rem 1.25rem; border-radius: var(--tb-radius);
  background: var(--tb-surface); border: 1px solid var(--tb-border); box-shadow: var(--tb-shadow-sm);
  display: flex; gap: 1rem; align-items: center; color: inherit;
}
a.stat:hover { box-shadow: var(--tb-shadow); color: inherit; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: var(--tb-primary-soft); color: var(--tb-primary); flex: none; }
.stat-icon.accent { background: var(--tb-accent-soft); color: var(--tb-accent); }
.stat-icon.info { background: rgba(3,105,161,.1); color: var(--tb-info); }
.stat-icon.danger { background: rgba(190,18,60,.1); color: var(--tb-danger); }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--tb-muted); font-size: .8125rem; font-weight: 500; }

/* ---------- Etiquetas de estado ---------- */
.badge-estado { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge-estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-success { background: rgba(21,128,61,.1); color: var(--tb-success); }
.badge-warning { background: rgba(180,83,9,.1); color: var(--tb-warning); }
.badge-danger { background: rgba(190,18,60,.1); color: var(--tb-danger); }
.badge-info { background: rgba(3,105,161,.1); color: var(--tb-info); }
.badge-primary { background: var(--tb-primary-soft); color: var(--tb-primary); }
.badge-secondary { background: var(--tb-surface-2); color: var(--tb-muted); }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--tb-surface-2); color: var(--tb-ink-2); font-size: .8125rem; font-weight: 600; border: 1px solid var(--tb-border); }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--tb-ink); --bs-table-border-color: var(--tb-border); margin: 0; font-size: .875rem; }
.table > thead th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tb-muted); background: var(--tb-surface-2); border-bottom: 1px solid var(--tb-border); white-space: nowrap; padding: .7rem .9rem; }
.table > tbody td { padding: .8rem .9rem; vertical-align: middle; border-color: var(--tb-border); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--tb-surface-2); }
.table tfoot th, .table tfoot td { background: var(--tb-surface-2); font-weight: 700; padding: .75rem .9rem; }
.table-card { border: 1px solid var(--tb-border); border-radius: var(--tb-radius); overflow: hidden; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm); }
.table-card .table > thead th:first-child { border-top-left-radius: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--tb-surface-2); border: 1px solid var(--tb-border); }

/* DataTables */
div.dataTables_wrapper { padding: 0; }
div.dataTables_wrapper .dt-top, div.dataTables_wrapper .dt-bottom { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .9rem 1rem; }
div.dataTables_wrapper .dt-bottom { border-top: 1px solid var(--tb-border); }
div.dataTables_wrapper div.dataTables_filter { margin: 0; flex: 1 1 220px; max-width: 360px; }
div.dataTables_wrapper .dt-right { flex: 1 1 220px; display: flex; justify-content: flex-end; }
@media (max-width: 575.98px) { div.dataTables_wrapper div.dataTables_filter { max-width: none; } div.dataTables_wrapper .dt-left:empty { display: none; } }
div.dataTables_wrapper div.dataTables_filter label { margin: 0; width: 100%; }
div.dataTables_wrapper div.dataTables_filter input { margin: 0 !important; width: 100% !important; min-width: 0; border-radius: var(--tb-radius-sm); padding: .5rem .85rem .5rem 2.2rem; background: var(--tb-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat .75rem center; }
div.dataTables_wrapper div.dataTables_length select { width: auto; display: inline-block; padding-right: 2rem; }
div.dataTables_wrapper div.dataTables_info { color: var(--tb-muted); font-size: .8125rem; padding: 0 !important; }
div.dataTables_wrapper div.dataTables_paginate { margin: 0 !important; }
.page-link { border-radius: 9px !important; margin: 0 2px; border: 1px solid var(--tb-border); color: var(--tb-ink-2); background: var(--tb-surface); font-weight: 600; font-size: .8125rem; }
.page-item.active .page-link { background: var(--tb-primary); border-color: var(--tb-primary); color: #fff; }
.dt-buttons .btn { margin-right: .35rem; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before { content: "\F285"; font-family: "bootstrap-icons"; color: var(--tb-primary); background: var(--tb-primary-soft); width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; font-size: .7rem; margin-right: .55rem; vertical-align: -2px; border: 0; box-shadow: none; transition: transform .15s; }
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before { content: "\F282"; }
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr.child ul.dtr-details > li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--tb-border); padding: .5rem 0; }
table.dataTable > tbody > tr.child span.dtr-title { color: var(--tb-muted); font-weight: 600; min-width: auto; }
table.dataTable { border-collapse: collapse !important; margin: 0 !important; width: 100% !important; }

/* =========================================================
   LAYOUT ADMIN
   ========================================================= */
.tb-shell { min-height: 100vh; }
.tb-sidebar {
  --bs-offcanvas-width: var(--tb-sidebar-w);
  --bs-offcanvas-bg: var(--tb-sidebar-bg);
  background: var(--tb-sidebar-bg) !important; color: var(--tb-sidebar-ink);
  width: var(--tb-sidebar-w);
}
@media (min-width: 992px) {
  .tb-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; display: flex; flex-direction: column; }
  .tb-main { margin-left: var(--tb-sidebar-w); }
}
.tb-brand { display: flex; align-items: center; gap: .7rem; padding: 1.15rem 1.25rem; color: #fff; }
.tb-brand:hover { color: #fff; }
.tb-logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #14b8a6, #0f766e); display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: 0 6px 16px -6px rgba(20,184,166,.7); flex: none; }
.tb-brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; line-height: 1.1; }
.tb-brand-sub { font-size: .72rem; color: var(--tb-sidebar-muted); font-weight: 500; }
.tb-nav { flex: 1; overflow-y: auto; padding: .25rem .85rem 1rem; scrollbar-width: thin; scrollbar-color: #243047 transparent; }
.tb-nav-group { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--tb-sidebar-muted); padding: 1.1rem .7rem .45rem; }
.tb-nav-link { display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: var(--tb-sidebar-ink); font-weight: 500; font-size: .875rem; transition: background .15s, color .15s; }
.tb-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .8; }
.tb-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.tb-nav-link.active { background: rgba(20,184,166,.16); color: #5eead4; font-weight: 600; }
.tb-nav-link.active i { opacity: 1; }
.tb-sidebar-foot { padding: .9rem; border-top: 1px solid rgba(255,255,255,.06); }
.tb-store-link { display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; border-radius: 10px; background: rgba(255,255,255,.04); color: var(--tb-sidebar-ink); font-size: .8125rem; font-weight: 600; }
.tb-store-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.tb-sidebar .btn-close { filter: invert(1); }

.tb-topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--tb-topbar-h);
  display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  background: color-mix(in srgb, var(--tb-bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--tb-border);
}
@media (min-width: 768px) { .tb-topbar { padding: 0 1.75rem; } }
.tb-topbar-title { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-bodega-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem .35rem .4rem; border-radius: 999px; background: var(--tb-surface); border: 1px solid var(--tb-border); font-weight: 600; font-size: .8125rem; color: var(--tb-ink-2); max-width: 220px; }
.tb-bodega-chip img, .tb-bodega-chip .ph { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--tb-primary-soft); color: var(--tb-primary); display: grid; place-items: center; font-size: .75rem; flex: none; }
.tb-bodega-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--tb-primary), #14b8a6); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8125rem; }
.tb-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--tb-ink-2); background: transparent; border: 1px solid transparent; font-size: 1.15rem; }
.tb-icon-btn:hover { background: var(--tb-surface); border-color: var(--tb-border); color: var(--tb-ink); }
.tb-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tb-danger); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--tb-bg); }
.tb-dot.d-none { display: none !important; }
.dropdown-menu { border: 1px solid var(--tb-border); border-radius: 14px; box-shadow: var(--tb-shadow-lg); padding: .4rem; background: var(--tb-surface); --bs-dropdown-link-active-bg: var(--tb-primary-soft); --bs-dropdown-link-active-color: var(--tb-primary); }
.dropdown-item { border-radius: 9px; padding: .55rem .75rem; font-size: .875rem; display: flex; align-items: center; gap: .6rem; color: var(--tb-ink-2); }
.dropdown-item:hover { background: var(--tb-surface-2); color: var(--tb-ink); }
.dropdown-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--tb-muted); }
.tb-notif-menu { width: min(360px, calc(100vw - 24px)); }
.tb-notif-item { display: flex; gap: .7rem; align-items: center; }
.tb-notif-item .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--tb-accent-soft); color: var(--tb-accent); display: grid; place-items: center; flex: none; }

.tb-content { padding: 1.25rem 1rem calc(var(--tb-bottomnav-h) + 1.5rem); max-width: 1440px; }
@media (min-width: 768px) { .tb-content { padding: 1.75rem 1.75rem 2.5rem; } }
@media (min-width: 992px) { .tb-content { padding-bottom: 2.5rem; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
@media (min-width: 768px) { .page-head h1 { font-size: 1.75rem; } }
.page-head p { margin: .25rem 0 0; color: var(--tb-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tb-primary); }

/* Barra inferior móvil */
.tb-bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 1035; height: calc(var(--tb-bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--tb-surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--tb-border);
}
.tb-bottomnav a, .tb-bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .66rem; font-weight: 600; color: var(--tb-muted); background: none; border: 0; position: relative; }
.tb-bottomnav i { font-size: 1.3rem; line-height: 1; }
.tb-bottomnav .active { color: var(--tb-primary); }
.tb-bottomnav .tb-dot { top: 6px; right: calc(50% - 22px); }
@media (min-width: 992px) { .tb-bottomnav.admin-only { display: none; } }

/* Estado vacío */
.empty { text-align: center; padding: 3rem 1rem; color: var(--tb-muted); }
.empty i { font-size: 2.4rem; color: var(--tb-border); display: block; margin-bottom: .75rem; }
.empty h3 { font-size: 1.05rem; color: var(--tb-ink); }

/* Lista tipo tarjeta (móvil) */
.list-cards { display: grid; gap: .75rem; }
.list-card { background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: 14px; padding: 1rem; display: flex; gap: .85rem; align-items: center; color: inherit; }
a.list-card:hover { border-color: rgba(var(--tb-primary-rgb), .4); color: inherit; }
.list-card .meta { color: var(--tb-muted); font-size: .8125rem; }

/* Modales */
.modal-content { border: 0; border-radius: 20px; background: var(--tb-surface); box-shadow: var(--tb-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--tb-border); padding: 1.1rem 1.4rem; }
.modal-title { font-weight: 700; font-size: 1.1rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top: 1px solid var(--tb-border); padding: .9rem 1.4rem; }
@media (max-width: 575.98px) {
  .modal-dialog:not(.modal-dialog-centered) { margin: 0; min-height: 100%; display: flex; align-items: flex-end; }
  .modal-dialog:not(.modal-dialog-centered) .modal-content { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .modal.fade .modal-dialog:not(.modal-dialog-centered) { transform: translateY(40px); }
  .modal.show .modal-dialog:not(.modal-dialog-centered) { transform: none; }
  .modal-body { overflow-y: auto; }
}

/* Escáner */
.scan-box { border: 2px dashed rgba(var(--tb-primary-rgb), .35); background: var(--tb-primary-soft); border-radius: var(--tb-radius); padding: 1.25rem; }
.scan-input { font-size: 1.25rem !important; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; padding: .85rem 1rem; }
.scan-flash-ok { animation: flashOk .6s; }
.scan-flash-err { animation: flashErr .6s; }
@keyframes flashOk { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.6); } 100% { box-shadow: 0 0 0 14px rgba(21,128,61,0); } }
@keyframes flashErr { 0% { box-shadow: 0 0 0 0 rgba(190,18,60,.6); } 100% { box-shadow: 0 0 0 14px rgba(190,18,60,0); } }

/* Progreso de unidades */
.progress { height: 8px; border-radius: 999px; background: var(--tb-surface-2); }
.progress-bar { background: var(--tb-primary); border-radius: 999px; }

/* =========================================================
   AUTENTICACIÓN
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth { grid-template-columns: minmax(420px, 1fr) 1.1fr; } }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.25rem; padding-top: max(2rem, env(safe-area-inset-top)); }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-art {
  display: none; position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(45, 212, 191, .35), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(245, 158, 11, .25), transparent 60%),
    linear-gradient(160deg, #0b1324 0%, #0f2a2b 55%, #0b1324 100%);
}
@media (min-width: 992px) { .auth-art { display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; } }
.auth-art h2 { color: #fff; font-size: 2.4rem; line-height: 1.1; max-width: 520px; }
.auth-art p { color: rgba(255,255,255,.72); max-width: 460px; font-size: 1.05rem; }
.auth-feature { display: flex; gap: .85rem; align-items: flex-start; color: rgba(255,255,255,.85); }
.auth-feature i { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.08); display: grid; place-items: center; flex: none; font-size: 1.1rem; color: #5eead4; }
.auth-grid-deco { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%); }
.bodega-option { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1px solid var(--tb-border); border-radius: 14px; background: var(--tb-surface); width: 100%; text-align: left; color: var(--tb-ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.bodega-option:hover { border-color: var(--tb-primary); box-shadow: 0 0 0 4px var(--tb-primary-soft); }
.bodega-option img, .bodega-option .ph { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--tb-primary-soft); color: var(--tb-primary); display: grid; place-items: center; font-weight: 700; flex: none; }

/* =========================================================
   TIENDA
   ========================================================= */
.shop-bar {
  position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--tb-surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tb-border); padding-top: env(safe-area-inset-top);
}
.shop-bar-inner { height: 64px; display: flex; align-items: center; gap: .75rem; }
.shop-brand { display: flex; align-items: center; gap: .65rem; color: var(--tb-ink); font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.shop-brand img, .shop-brand .ph { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; background: var(--tb-primary-soft); color: var(--tb-primary); display: grid; place-items: center; flex: none; }
.shop-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-search { flex: 1; max-width: 520px; }
.shop-search .form-control { border-radius: 999px; background-color: var(--tb-surface-2); border-color: transparent; }
.shop-search .form-control:focus { background-color: var(--tb-surface); }
.cats { display: flex; gap: .5rem; overflow-x: auto; padding: .75rem 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cats::-webkit-scrollbar { display: none; }
.cat-pill { flex: none; padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--tb-border); background: var(--tb-surface); color: var(--tb-ink-2); font-weight: 600; font-size: .8125rem; white-space: nowrap; }
.cat-pill:hover { color: var(--tb-ink); border-color: var(--tb-ink-2); }
.cat-pill.active { background: var(--tb-ink); border-color: var(--tb-ink); color: var(--tb-surface); }

.hero-shop {
  border-radius: 22px; padding: 1.5rem; color: #fff; position: relative; overflow: hidden; margin: 1rem 0 1.5rem;
  background: radial-gradient(600px 300px at 0% 0%, rgba(45,212,191,.45), transparent 60%), radial-gradient(500px 300px at 100% 100%, rgba(245,158,11,.35), transparent 60%), linear-gradient(135deg, #0b1324, #0f3a37);
}
@media (min-width: 768px) { .hero-shop { padding: 2.25rem 2.5rem; } }
.hero-shop h1 { color: #fff; font-size: 1.6rem; margin: 0; }
@media (min-width: 768px) { .hero-shop h1 { font-size: 2.2rem; } }
.hero-shop p { color: rgba(255,255,255,.75); margin: .35rem 0 0; }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product-card { display: flex; flex-direction: column; background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: 18px; overflow: hidden; color: inherit; transition: transform .2s, box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--tb-shadow); color: inherit; }
.product-media { position: relative; aspect-ratio: 1 / 1; background: var(--tb-surface-2); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product-card:hover .product-media img { transform: scale(1.04); }
.product-flag { position: absolute; top: .6rem; left: .6rem; background: rgba(17,24,39,.78); color: #fff; font-size: .68rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; backdrop-filter: blur(6px); }
.product-flag.accent { background: var(--tb-accent); }
.product-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.product-name { font-weight: 700; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-desc { color: var(--tb-muted); font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: 800; font-size: 1.05rem; margin-top: auto; padding-top: .35rem; letter-spacing: -.02em; }

.pd-media { border-radius: 22px; overflow: hidden; background: var(--tb-surface-2); aspect-ratio: 1/1; border: 1px solid var(--tb-border); }
.pd-media img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.pd-price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.opt-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; gap: .5rem; min-width: 52px; justify-content: center; padding: .55rem .9rem; border: 1.5px solid var(--tb-border); border-radius: 12px; font-weight: 600; font-size: .875rem; background: var(--tb-surface); cursor: pointer; transition: all .15s; user-select: none; }
.opt input:checked + span { border-color: var(--tb-ink); box-shadow: inset 0 0 0 1px var(--tb-ink); }
.opt input:disabled + span { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.opt .sw { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--tb-border); border-radius: 12px; overflow: hidden; background: var(--tb-surface); }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.15rem; color: var(--tb-ink); }
.qty input { width: 52px; text-align: center; border: 0; font-weight: 700; background: transparent; color: var(--tb-ink); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stars { color: #f59e0b; letter-spacing: 1px; }

.cart-item { display: flex; gap: .9rem; padding: 1rem; border-bottom: 1px solid var(--tb-border); align-items: center; }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--tb-surface-2); flex: none; }
.summary-row { display: flex; justify-content: space-between; padding: .4rem 0; }
.summary-total { font-size: 1.25rem; font-weight: 800; border-top: 1px solid var(--tb-border); margin-top: .5rem; padding-top: .9rem; }

.shop-footer { border-top: 1px solid var(--tb-border); background: var(--tb-surface); margin-top: 3rem; padding: 2rem 0 calc(var(--tb-bottomnav-h) + 2rem); font-size: .875rem; color: var(--tb-muted); }
@media (min-width: 992px) { .shop-footer { padding-bottom: 2rem; } }
.shop-footer h6 { color: var(--tb-ink); font-weight: 700; }
.shop-main { padding-bottom: calc(var(--tb-bottomnav-h) + 1rem); }
@media (min-width: 992px) { .shop-main { padding-bottom: 0; } .tb-bottomnav.shop-only { display: none; } }

/* Barra de acción fija (móvil) */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: calc(var(--tb-bottomnav-h) + env(safe-area-inset-bottom)); z-index: 1030; padding: .75rem 1rem; background: color-mix(in srgb, var(--tb-surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--tb-border); }
@media (min-width: 992px) { .sticky-cta { position: static; padding: 0; background: none; border: 0; backdrop-filter: none; } }

/* SweetAlert2 en el tema */
.swal2-popup { border-radius: 20px !important; font-family: var(--tb-font) !important; background: var(--tb-surface) !important; color: var(--tb-ink) !important; }
.swal2-title { color: var(--tb-ink) !important; font-size: 1.3rem !important; }
.swal2-html-container { color: var(--tb-ink-2) !important; }
.swal2-styled.swal2-confirm { background: var(--tb-primary) !important; border-radius: 10px !important; font-weight: 600 !important; }
.swal2-styled.swal2-cancel { border-radius: 10px !important; font-weight: 600 !important; }
.swal2-toast { box-shadow: var(--tb-shadow-lg) !important; }

/* Botón de apariencia claro/oscuro (como Agenda) */
.tb-tema-icono { display: inline-flex; align-items: center; justify-content: center; }
.tb-tema-icono svg, .tb-tema-flotante svg, [data-tb-tema-alternar] > svg { width: 20px; height: 20px; }
.tb-tema-flotante {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1060;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--tb-border);
  background: var(--tb-surface); color: var(--tb-ink); box-shadow: var(--tb-shadow);
  display: grid; place-items: center;
}
.tb-tema-flotante:hover { color: var(--tb-primary); }
.tb-tema-flotante svg { width: 22px; height: 22px; }
.tb-sidebar [data-tb-tema-alternar] { color: var(--tb-sidebar-ink); }
.tb-sidebar [data-tb-tema-alternar]:hover { color: #fff; }

/* Buscar o escanear (barra superior) */
.tb-buscar { position: relative; align-items: center; flex: 0 1 340px; margin-left: .5rem; }
.tb-buscar > i { position: absolute; left: .8rem; color: var(--tb-muted); pointer-events: none; }
.tb-buscar input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--tb-border); background: var(--tb-surface); color: var(--tb-ink); padding: 0 2.6rem 0 2.3rem; font-size: .875rem; outline: none; }
.tb-buscar input:focus { border-color: var(--tb-primary); box-shadow: 0 0 0 4px var(--tb-primary-soft); }
.tb-buscar-cam { position: absolute; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--tb-primary-soft); color: var(--tb-primary); display: grid; place-items: center; }
#lectorCamara video { width: 100% !important; object-fit: cover; }

/* Indicador de sonido de pedidos */
.tb-sonido { display: inline-flex; align-items: center; gap: .4rem; height: 36px; padding: 0 .7rem; border-radius: 999px; border: 1px solid var(--tb-border); background: var(--tb-surface); font-size: .8rem; font-weight: 600; color: var(--tb-ink-2); }
.tb-sonido i { font-size: 1.05rem; }
.tb-sonido.sonido-ok { color: var(--tb-success); }
.tb-sonido.sonido-off { color: #fff; background: var(--tb-danger); border-color: var(--tb-danger); animation: pulsoSonido 1.6s infinite; }
@keyframes pulsoSonido { 0% { box-shadow: 0 0 0 0 rgba(190,18,60,.55); } 100% { box-shadow: 0 0 0 12px rgba(190,18,60,0); } }

/* Monitor de pedidos */
.monitor-estado { border-radius: 22px; padding: 1.4rem; color: #fff; background: linear-gradient(135deg, #0b1324, #0f3a37); }
.monitor-estado.alerta { background: linear-gradient(135deg, #7f1d1d, #b45309); animation: alertaFondo 1s infinite alternate; }
@keyframes alertaFondo { from { filter: brightness(1); } to { filter: brightness(1.25); } }
.monitor-reloj { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.monitor-check { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: 12px; background: rgba(255,255,255,.08); font-size: .85rem; }
.monitor-check i { font-size: 1.1rem; }
.monitor-check.ok i { color: #5eead4; } .monitor-check.mal i { color: #fca5a5; }
.pedido-nuevo { animation: entra .6s ease; border-color: var(--tb-accent) !important; box-shadow: 0 0 0 4px var(--tb-accent-soft); }
@keyframes entra { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Utilidades */
.divider { height: 1px; background: var(--tb-border); margin: 1.25rem 0; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--tb-border); font-size: .875rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--tb-muted); }
.gap-2 { gap: .5rem !important; }
.min-w-0 { min-width: 0; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.color-sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: -2px; }
.skeleton { background: linear-gradient(90deg, var(--tb-surface-2), var(--tb-border), var(--tb-surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
@media print {
  .tb-sidebar, .tb-topbar, .tb-bottomnav, .page-actions, .dt-buttons, .dataTables_filter, .dataTables_paginate { display: none !important; }
  .tb-main { margin: 0 !important; }
}

/* =========================================================
   TIENDA v2 — disponibilidad, matriz de tallas y encargos
   ========================================================= */
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: space-between; margin: .25rem 0 1rem; }
.shop-toolbar .form-select { width: auto; border-radius: 999px; font-size: .85rem; padding: .4rem 2rem .4rem .9rem; }
.shop-toggle { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--tb-border); background: var(--tb-surface); font-size: .85rem; font-weight: 600; color: var(--tb-ink-2); cursor: pointer; user-select: none; }
.shop-toggle.on { background: var(--tb-primary-soft); border-color: rgba(var(--tb-primary-rgb), .35); color: var(--tb-primary); }
.shop-cats-sticky { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 1010; background: var(--tb-bg); margin: 0 -12px; padding: 0 12px; }
@media (min-width: 576px) { .shop-cats-sticky { margin: 0; padding: 0; } }

.stock { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock.ok { background: rgba(21,128,61,.1); color: var(--tb-success); }
.stock.poco { background: var(--tb-accent-soft); color: var(--tb-accent); }
.stock.encargo { background: rgba(3,105,161,.1); color: var(--tb-info); }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; padding-top: .45rem; }
.product-meta .product-price { margin: 0; padding: 0; }
.size-strip { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .45rem; }
.size-strip span { font-size: .66rem; font-weight: 700; min-width: 24px; text-align: center; padding: .1rem .3rem; border-radius: 6px; border: 1px solid var(--tb-border); color: var(--tb-ink-2); }
.size-strip span.off { color: var(--tb-muted); opacity: .55; text-decoration: line-through; }

.color-pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.color-pick button { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .8rem .45rem .5rem; border-radius: 999px; border: 1.5px solid var(--tb-border); background: var(--tb-surface); font-weight: 600; font-size: .85rem; color: var(--tb-ink); }
.color-pick button i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); display: inline-block; }
.color-pick button small { color: var(--tb-muted); font-weight: 600; }
.color-pick button.on { border-color: var(--tb-ink); box-shadow: inset 0 0 0 1px var(--tb-ink); }

.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.size-cell { border: 1.5px solid var(--tb-border); border-radius: 14px; padding: .6rem .55rem .55rem; background: var(--tb-surface); display: flex; flex-direction: column; gap: .35rem; transition: border-color .15s, box-shadow .15s; }
.size-cell.has { border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-primary-soft); }
.size-cell .t { font-size: 1.15rem; font-weight: 800; line-height: 1; text-align: center; }
.size-cell .d { font-size: .68rem; font-weight: 700; text-align: center; }
.size-cell .d.ok { color: var(--tb-success); } .size-cell .d.poco { color: var(--tb-accent); } .size-cell .d.encargo { color: var(--tb-info); }
.size-cell .step { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; border: 1px solid var(--tb-border); border-radius: 10px; overflow: hidden; }
.size-cell .step button { height: 32px; border: 0; background: var(--tb-surface-2); color: var(--tb-ink); font-size: 1.05rem; font-weight: 700; }
.size-cell .step input { width: 100%; border: 0; text-align: center; font-weight: 800; background: transparent; color: var(--tb-ink); height: 32px; -moz-appearance: textfield; padding: 0; font-size: 1rem; }
.size-cell .step input::-webkit-outer-spin-button, .size-cell .step input::-webkit-inner-spin-button { -webkit-appearance: none; }
.size-cell .encargo-nota { font-size: .64rem; color: var(--tb-info); text-align: center; font-weight: 600; min-height: .8rem; }

.order-bar { position: sticky; bottom: calc(var(--tb-bottomnav-h) + env(safe-area-inset-bottom) + 8px); z-index: 1025; margin-top: 1rem; padding: .75rem .85rem; border-radius: 18px; background: var(--tb-ink); color: var(--tb-surface); display: flex; align-items: center; gap: .75rem; box-shadow: var(--tb-shadow-lg); }
.order-bar .info { flex: 1; min-width: 0; line-height: 1.2; }
.order-bar .info b { font-size: 1.1rem; }
.order-bar .info small { display: block; opacity: .75; font-size: .75rem; }
.order-bar .btn { white-space: nowrap; }
[data-bs-theme="dark"] .order-bar { background: #e7ecf2; color: #0b0f15; }
@media (min-width: 992px) { .order-bar { bottom: 16px; } }
.aviso-encargo { display: flex; gap: .6rem; padding: .7rem .85rem; border-radius: 12px; background: rgba(3,105,161,.08); color: var(--tb-info); font-size: .82rem; font-weight: 600; }
.product-meta { flex-wrap: wrap; }
.product-meta .product-price { white-space: nowrap; }
.size-cell .t { font-size: clamp(.85rem, 3.4vw, 1.15rem); overflow-wrap: anywhere; min-height: 1.15rem; display: flex; align-items: center; justify-content: center; }

/* =========================================================
   TIENDA v3 — acabado editorial, mobile-first (Android/iOS)
   ========================================================= */
body.shop { background: var(--tb-bg); -webkit-tap-highlight-color: transparent; }
body.shop .shop-bar { border-bottom-color: transparent; box-shadow: 0 1px 0 var(--tb-border); }
body.shop .shop-search .form-control { height: 44px; font-size: 16px; } /* 16px evita el zoom de iOS al enfocar */

/* Hero */
.hero-shop {
  margin: .75rem 0 1rem; padding: 1.6rem 1.35rem 1.4rem; border-radius: 26px;
  background:
    radial-gradient(520px 260px at 110% -10%, rgba(45,212,191,.38), transparent 60%),
    radial-gradient(420px 240px at -10% 120%, rgba(245,158,11,.28), transparent 60%),
    linear-gradient(150deg, #07111f 0%, #0c2b2c 55%, #0f3a37 100%);
  box-shadow: 0 20px 40px -24px rgba(7,17,31,.6);
}
.hero-shop::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px; -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 60%); mask-image: linear-gradient(120deg, #000 0%, transparent 60%); }
.hero-inner { position: relative; z-index: 1; max-width: 620px; }
.hero-hola { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; color: #99f6e4; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: .3rem .7rem; border-radius: 999px; margin-bottom: .75rem; }
.hero-shop h1 { font-size: clamp(1.65rem, 6.5vw, 2.6rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.hero-shop p { font-size: .92rem; line-height: 1.5; color: rgba(255,255,255,.72); margin-top: .6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.btn-hero { background: #fff; color: #07111f; font-weight: 700; border-radius: 999px; padding: .65rem 1.15rem; border: 0; }
.btn-hero:hover { background: #e6fffa; color: #07111f; }
.btn-hero-ghost { color: #fff; font-weight: 600; border-radius: 999px; padding: .65rem 1.1rem; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); }
.btn-hero-ghost:hover { color: #fff; background: rgba(255,255,255,.14); }
@media (min-width: 768px) { .hero-shop { padding: 2.75rem 2.75rem 2.5rem; margin-top: 1.25rem; } .hero-shop p { font-size: 1rem; } }

/* Beneficios */
.perks { display: flex; gap: .6rem; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 1rem; padding: 0 12px .25rem; scroll-snap-type: x mandatory; }
.perks::-webkit-scrollbar { display: none; }
.perk { flex: 0 0 auto; min-width: 210px; scroll-snap-align: start; display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 16px; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.perk > i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--tb-primary-soft); color: var(--tb-primary); font-size: 1.1rem; flex: none; }
.perk b { display: block; font-size: .82rem; line-height: 1.2; }
.perk span { font-size: .74rem; color: var(--tb-muted); }
@media (min-width: 768px) { .perks { margin: 0 0 1.5rem; padding: 0; overflow: visible; } .perk { flex: 1; } }

/* Categorías */
.shop-cats-sticky { background: color-mix(in srgb, var(--tb-bg) 88%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); }
.cats { padding: .6rem 0; }
.cat-pill { padding: .5rem 1rem; font-size: .82rem; border-color: transparent; box-shadow: 0 0 0 1px var(--tb-border); transition: background .15s, color .15s; }
.cat-pill.active { background: var(--tb-ink); color: var(--tb-surface); box-shadow: 0 6px 14px -8px rgba(17,24,39,.6); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin: 1rem 0 .85rem; }
.section-head h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.section-head span { font-size: .78rem; color: var(--tb-muted); }
.shop-toolbar h2 { font-weight: 800; letter-spacing: -.02em; }

/* Tarjetas */
.product-grid { gap: .75rem; }
@media (min-width: 768px) { .product-grid { gap: 1.25rem; } }
.product-card { border: 0; border-radius: 20px; padding: .45rem; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px rgba(16,24,40,.35), 0 0 0 1px var(--tb-border); }
.product-card:active { transform: scale(.985); }
.product-media { border-radius: 15px; aspect-ratio: 4 / 5; }
.media-stock { position: absolute; left: .5rem; top: .5rem; font-size: .66rem; font-weight: 700; padding: .28rem .55rem; border-radius: 999px; background: rgba(255,255,255,.88); color: #111827; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: inline-flex; align-items: center; gap: .3rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.media-stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #16a34a; }
.media-stock.poco::before { background: #d97706; }
.media-stock.encargo::before { background: #0284c7; }
.media-star { position: absolute; right: .5rem; top: .5rem; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tb-accent); color: #fff; font-size: .7rem; }
.media-add { position: absolute; right: .5rem; bottom: .5rem; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tb-ink); color: var(--tb-surface); font-size: 1rem; box-shadow: 0 6px 14px -6px rgba(0,0,0,.5); transition: transform .2s; }
.product-card:hover .media-add { transform: rotate(90deg); }
.product-body { padding: .7rem .4rem .35rem; gap: .15rem; }
.product-name { font-weight: 600; font-size: .86rem; color: var(--tb-ink-2); }
.product-price { font-size: 1.05rem; margin-top: .1rem; padding-top: 0; color: var(--tb-ink); }
.size-strip { margin-top: .4rem; }
.size-strip span { border: 0; background: var(--tb-surface-2); font-size: .64rem; padding: .15rem .35rem; }
.size-strip span.off { text-decoration: none; opacity: .4; }
.size-strip span.mas { background: transparent; color: var(--tb-muted); }

/* Ficha */
.pd-media { border: 0; border-radius: 26px; aspect-ratio: 4 / 5; box-shadow: var(--tb-shadow); }
@media (max-width: 575.98px) { .pd-media { margin: 0 -4px; } }
.pd-price { font-size: 1.75rem; color: var(--tb-primary); }
.color-pick button { padding: .5rem .9rem .5rem .55rem; box-shadow: var(--tb-shadow-sm); }
.size-cell { border-radius: 16px; border-width: 1px; box-shadow: var(--tb-shadow-sm); }
.size-cell .step { border: 0; background: var(--tb-surface-2); border-radius: 12px; }
.size-cell .step button { background: transparent; height: 36px; }
.size-cell .step input { height: 36px; }
.order-bar { border-radius: 22px; padding: .7rem .7rem .7rem 1.1rem; background: rgba(17,24,39,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.order-bar .btn { border-radius: 16px; }
[data-bs-theme="dark"] .order-bar { background: rgba(231,236,242,.96); }

/* Carrito */
body.shop .cart-item img { width: 76px; height: 92px; border-radius: 14px; }
body.shop .card { border-radius: 22px; }

/* Barra inferior flotante con carrito central */
.tb-bottomnav.shop-only {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--tb-bottomnav-h); padding-bottom: 0;
  border: 0; border-radius: 22px; box-shadow: 0 12px 32px -12px rgba(16,24,40,.35), 0 0 0 1px var(--tb-border);
  background: color-mix(in srgb, var(--tb-surface) 90%, transparent);
}
.tb-bottomnav.shop-only a { font-size: .64rem; }
.tb-bottomnav.shop-only a.active { color: var(--tb-ink); }
.tb-bottomnav.shop-only a.active i { color: var(--tb-primary); }
.cart-fab { position: relative; width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--tb-primary), #115e59); box-shadow: 0 10px 22px -8px rgba(15,118,110,.7), 0 0 0 4px var(--tb-bg); }
.cart-fab i { font-size: 1.35rem; color: #fff; }
.nav-cart .cart-fab .tb-dot { top: -4px; right: -4px; }
body.shop .shop-main { padding-bottom: calc(var(--tb-bottomnav-h) + 28px + env(safe-area-inset-bottom)); }
body.shop .shop-footer { padding-bottom: calc(var(--tb-bottomnav-h) + 40px + env(safe-area-inset-bottom)); }
body.shop .order-bar { bottom: calc(var(--tb-bottomnav-h) + 20px + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { body.shop .shop-main, body.shop .shop-footer { padding-bottom: 2rem; } body.shop .order-bar { bottom: 16px; } }
.empty .btn i { font-size: 1rem; display: inline; margin: 0; opacity: 1; color: inherit; }
.tb-bottomnav.shop-only a.nav-cart i, .tb-bottomnav.shop-only a.nav-cart.active i { color: #fff; }
.tb-bottomnav.shop-only a.nav-cart.active .cart-fab { box-shadow: 0 10px 22px -8px rgba(15,118,110,.8), 0 0 0 4px var(--tb-bg), 0 0 0 6px rgba(var(--tb-primary-rgb),.35); }
@media (max-width: 575.98px) { .pd-media { aspect-ratio: auto; height: 56vh; max-height: 460px; } }

/* =========================================================
   TIENDA v4 — pedidos del cliente, confirmación y ficha
   ========================================================= */
.page-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; padding: 1rem 0 .9rem; }
.page-hello h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.page-hello p { color: var(--tb-muted); margin: .25rem 0 0; font-size: .88rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.filtro-plegable { background: var(--tb-surface); border-radius: 16px; padding: .75rem 1rem; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.filtro-plegable summary { list-style: none; display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--tb-ink-2); }
.filtro-plegable summary::-webkit-details-marker { display: none; }
.filtro-plegable[open] summary .bi-chevron-down { transform: rotate(180deg); }

.order-list { display: grid; gap: .6rem; }
.order-row { display: flex; align-items: center; gap: .85rem; padding: .75rem .85rem; border-radius: 18px; background: var(--tb-surface); color: inherit; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); transition: transform .15s, box-shadow .15s; }
.order-row:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(16,24,40,.4), 0 0 0 1px var(--tb-border); }
.order-row .meta { font-size: .76rem; color: var(--tb-muted); }
.order-fotos { position: relative; width: 64px; height: 56px; flex: none; }
.order-fotos img, .order-fotos .ph { position: absolute; top: 4px; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; border: 2px solid var(--tb-surface); background: var(--tb-surface-2); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.order-fotos img:nth-child(1) { left: 0; } .order-fotos img:nth-child(2) { left: 9px; top: 8px; } .order-fotos img:nth-child(3) { left: 18px; top: 4px; }
.order-fotos .ph { left: 0; display: grid; place-items: center; color: var(--tb-primary); background: var(--tb-primary-soft); font-size: 1.2rem; }

.steps-line { list-style: none; padding: .9rem 1rem; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--tb-surface); border-radius: 18px; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); position: relative; }
.steps-line li { display: flex; flex-direction: column; align-items: center; gap: .3rem; position: relative; color: var(--tb-muted); }
.steps-line li + li::before { content: ""; position: absolute; top: 17px; right: 50%; width: 100%; height: 2px; background: var(--tb-border); z-index: 0; }
.steps-line li.done + li::before, .steps-line li.done + li.now::before { background: var(--tb-primary); }
.steps-line span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tb-surface-2); position: relative; z-index: 1; }
.steps-line small { font-size: .72rem; font-weight: 700; }
.steps-line li.done span { background: var(--tb-primary); color: #fff; }
.steps-line li.now span { background: var(--tb-primary-soft); color: var(--tb-primary); box-shadow: 0 0 0 3px rgba(var(--tb-primary-rgb), .25); }
.steps-line li.done, .steps-line li.now { color: var(--tb-ink); }

.line-item { display: flex; gap: .85rem; padding: .9rem 1rem; border-bottom: 1px solid var(--tb-border); }
.line-item:last-child { border-bottom: 0; }
.line-item img { width: 72px; height: 86px; border-radius: 14px; object-fit: cover; background: var(--tb-surface-2); flex: none; }
@media (min-width: 992px) { .sticky-lg { position: sticky; top: 84px; } }

.done-wrap { max-width: 480px; margin: 0 auto; padding: 2rem 0 1rem; text-align: center; }
.done-wrap h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.done-check { width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; color: #fff;
  background: linear-gradient(145deg, var(--tb-primary), #115e59); box-shadow: 0 0 0 10px var(--tb-primary-soft), 0 18px 34px -14px rgba(15,118,110,.7); animation: done-pop .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes done-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .done-check { animation: none; } }
.done-card { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.25rem 0 1rem; border-radius: 18px; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); overflow: hidden; }
.done-card > div { padding: .85rem .5rem; display: flex; flex-direction: column; gap: .15rem; }
.done-card > div + div { border-left: 1px solid var(--tb-border); }
.done-card small { font-size: .7rem; color: var(--tb-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.done-card b { font-size: .98rem; white-space: nowrap; }

.pd-facts { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .45rem; }
.pd-facts li { display: flex; align-items: center; gap: .6rem; font-size: .84rem; color: var(--tb-ink-2); }
.pd-facts i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--tb-primary-soft); color: var(--tb-primary); flex: none; }
@media (min-width: 992px) { .pd-sticky { position: sticky; top: 84px; } }
.size-cell { gap: .3rem; padding: .55rem .5rem .5rem; }
.size-cell .encargo-nota:empty { display: none; }

/* =========================================================
   Verificación en dos pasos (Google Authenticator)
   ========================================================= */
.qr-caja { width: 220px; max-width: 70vw; aspect-ratio: 1; margin: .5rem auto 0; padding: 10px; background: #fff; border-radius: 18px; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.qr-caja svg { width: 100%; height: 100%; display: block; }
.qr-clave { margin: .4rem auto 0; width: fit-content; max-width: 100%; padding: .45rem .8rem; border-radius: 10px; background: var(--tb-surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; font-size: .9rem; text-align: center; cursor: copy; overflow-wrap: anywhere; }
.codigo-input { text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.codigo-input::placeholder { color: var(--tb-border); letter-spacing: .35em; }
.codigos-respaldo { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.codigos-respaldo li { padding: .55rem; border-radius: 10px; background: var(--tb-surface-2); text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .08em; }
.dos-pasos-icono { width: 64px; height: 64px; margin: 0 auto .9rem; border-radius: 20px; display: grid; place-items: center; font-size: 1.8rem; color: var(--tb-primary); background: var(--tb-primary-soft); }
.paso-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tb-primary); color: #fff; font-size: .78rem; margin-right: .35rem; }
.opcion-modo { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 12px; border: 1.5px solid var(--tb-border); cursor: pointer; font-size: .88rem; font-weight: 600; transition: border-color .15s, background .15s; }
.opcion-modo input { accent-color: var(--tb-primary); width: 18px; height: 18px; }
.opcion-modo:has(input:checked) { border-color: var(--tb-primary); background: var(--tb-primary-soft); }
.card-link { transition: box-shadow .15s, transform .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--tb-shadow); }
@media print { .codigos-respaldo li { background: none; border: 1px solid #999; } }

/* =========================================================
   Visor de cámara (escanear con el celular)
   ========================================================= */
.escaner { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; display: none; }
.escaner.abierto { display: block; }
body.escaner-activo { overflow: hidden; }
.escaner-video { position: absolute; inset: 0; }
.escaner-video video { width: 100% !important; height: 100% !important; object-fit: cover; }
.escaner-video #qr-shaded-region, .escaner-video [id$="__dashboard"], .escaner-video img { display: none !important; }
.escaner-video > div { border: 0 !important; }
.escaner-marco { position: absolute; left: 50%; top: 46%; width: min(86vw, 360px); aspect-ratio: 2 / 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); pointer-events: none; }
.escaner-marco::before, .escaner-marco::after { content: ""; position: absolute; inset: 0; border-radius: 22px; border: 3px solid rgba(255,255,255,.9); -webkit-mask: linear-gradient(#000 0 0) top/100% 26% no-repeat, linear-gradient(#000 0 0) bottom/100% 26% no-repeat; mask: linear-gradient(#000 0 0) top/100% 26% no-repeat, linear-gradient(#000 0 0) bottom/100% 26% no-repeat; }
.escaner-marco span { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #2dd4bf; box-shadow: 0 0 12px #2dd4bf; animation: escaner-linea 1.8s ease-in-out infinite; }
@keyframes escaner-linea { 0%, 100% { transform: translateY(-34px); } 50% { transform: translateY(34px); } }
@media (prefers-reduced-motion: reduce) { .escaner-marco span { animation: none; } }
.escaner-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: calc(14px + env(safe-area-inset-top)) 16px 30px; background: linear-gradient(rgba(0,0,0,.65), transparent); }
.escaner-top b { display: block; font-size: 1.1rem; }
.escaner-top small { display: block; opacity: .75; font-size: .8rem; }
.escaner-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.16); color: #fff; font-size: 1.15rem; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.escaner-btn.on { background: #fde047; color: #111; }
.escaner-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.75)); display: grid; gap: .75rem; }
.escaner-estado { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border-radius: 16px; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 600; font-size: .92rem; min-height: 52px; }
.escaner-estado i { font-size: 1.25rem; flex: none; }
.escaner-estado span { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.escaner-estado.ok { background: rgba(22,163,74,.92); }
.escaner-estado.error { background: rgba(220,38,38,.92); }
.escaner-estado.procesando { background: rgba(255,255,255,.22); }
.escaner-acciones { display: flex; align-items: center; gap: .6rem; }
.escaner-acciones .btn-light { border-radius: 16px; }
.escaner-contador { min-width: 52px; height: 48px; padding: 0 .75rem; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-weight: 800; font-size: 1.2rem; }
.escaner-contador::after { content: " ✓"; font-size: .8rem; opacity: .8; }

/* Botón grande de cámara en pantallas de escaneo */
.btn-camara { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.scan-box .btn-camara { white-space: nowrap; }
tr.verificada td:first-child { box-shadow: inset 4px 0 0 var(--tb-success); }
tr.verificada .verif-ico { color: var(--tb-success); }
.tb-icon-btn--cam { background: var(--tb-primary); color: #fff; }
.tb-icon-btn--cam:hover { background: var(--tb-primary-600); color: #fff; }
.escaner, .escaner-top b, .escaner-top small { color: #fff; }
.escaner-contador { display: flex; align-items: center; justify-content: center; gap: .15rem; white-space: nowrap; }

/* =========================================================
   Identidad por rol: avatar, insignia y franja
   super = dorado · admin = índigo · secretaria = rosa · cliente = verde azulado
   ========================================================= */
:root { --rol-super-1: #fbbf24; --rol-super-2: #b45309; --rol-admin-1: #818cf8; --rol-admin-2: #4338ca; --rol-secretaria-1: #f472b6; --rol-secretaria-2: #be185d; --rol-cliente-1: #2dd4bf; --rol-cliente-2: #0f766e; }
.tb-avatar { position: relative; flex: none; overflow: visible; }
.tb-avatar .ini { line-height: 1; }
.tb-avatar.rol-super { background: linear-gradient(135deg, var(--rol-super-1), var(--rol-super-2)); color: #1c1203; box-shadow: 0 0 0 2px var(--tb-surface), 0 0 0 4px rgba(245,158,11,.55); }
.tb-avatar.rol-admin { background: linear-gradient(135deg, var(--rol-admin-1), var(--rol-admin-2)); box-shadow: 0 0 0 2px var(--tb-surface), 0 0 0 4px rgba(99,102,241,.4); }
.tb-avatar.rol-secretaria { background: linear-gradient(135deg, var(--rol-secretaria-1), var(--rol-secretaria-2)); }
.tb-avatar.rol-cliente { background: linear-gradient(135deg, var(--rol-cliente-1), var(--rol-cliente-2)); }
.tb-avatar-badge { position: absolute; right: -4px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: .56rem; color: #fff; border: 2px solid var(--tb-surface); }
.rol-super .tb-avatar-badge, .tb-avatar.rol-super .tb-avatar-badge { background: #92400e; color: #fde68a; }
.tb-avatar.rol-admin .tb-avatar-badge { background: #312e81; }
.tb-avatar.rol-secretaria .tb-avatar-badge { background: #9d174d; }
.tb-avatar.rol-cliente .tb-avatar-badge { background: #115e59; }
.tb-avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.tb-avatar-sm .tb-avatar-badge { width: 15px; height: 15px; font-size: .5rem; }
.tb-avatar-lg { width: 44px; height: 44px; font-size: .95rem; }
.tb-avatar-xl { width: 64px; height: 64px; font-size: 1.25rem; }
.tb-avatar-xl .tb-avatar-badge { width: 24px; height: 24px; font-size: .75rem; right: -2px; bottom: -2px; }

.rol-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.rol-chip.rol-super { background: linear-gradient(90deg, rgba(251,191,36,.22), rgba(180,83,9,.18)); color: #92400e; box-shadow: inset 0 0 0 1px rgba(217,119,6,.35); }
.rol-chip.rol-admin { background: rgba(99,102,241,.13); color: #4338ca; }
.rol-chip.rol-secretaria { background: rgba(236,72,153,.13); color: #be185d; }
.rol-chip.rol-cliente { background: rgba(20,184,166,.13); color: #0f766e; }
[data-bs-theme="dark"] .rol-chip.rol-super { color: #fcd34d; }
[data-bs-theme="dark"] .rol-chip.rol-admin { color: #a5b4fc; }
[data-bs-theme="dark"] .rol-chip.rol-secretaria { color: #f9a8d4; }
[data-bs-theme="dark"] .rol-chip.rol-cliente { color: #5eead4; }

/* Tarjeta de sesión en el menú lateral */
.tb-sesion { display: flex; align-items: center; gap: .7rem; margin: .25rem .9rem .5rem; padding: .7rem .75rem; border-radius: 14px; background: rgba(255,255,255,.06); color: var(--tb-sidebar-ink); text-decoration: none; }
.tb-sesion:hover { background: rgba(255,255,255,.1); color: #fff; }
.tb-sesion .tb-avatar .tb-avatar-badge { border-color: var(--tb-sidebar-bg); }
.tb-sesion .tb-avatar { box-shadow: none; }
.tb-sesion-nombre { display: block; font-weight: 700; font-size: .86rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: .2rem; }
.tb-sesion .rol-chip.rol-super { color: #fcd34d; }
.tb-sesion .rol-chip.rol-admin { color: #c7d2fe; }
.tb-sesion .rol-chip.rol-secretaria { color: #fbcfe8; }
.tb-sesion .rol-chip.rol-cliente { color: #99f6e4; }
body.rol-super .tb-sesion { background: linear-gradient(135deg, rgba(251,191,36,.16), rgba(180,83,9,.08)); box-shadow: inset 0 0 0 1px rgba(251,191,36,.25); }

/* Botón de cuenta en la barra superior */
.tb-cuenta-btn { display: flex; align-items: center; gap: .55rem; border: 0; background: none; padding: .2rem .25rem; border-radius: 999px; color: inherit; }
.tb-cuenta-txt { flex-direction: column; align-items: flex-start; line-height: 1.15; padding-right: .35rem; }
.tb-cuenta-txt b { font-size: .82rem; }
.tb-cuenta-txt small { font-size: .7rem; color: var(--tb-muted); font-weight: 600; }
body.rol-super .tb-cuenta-txt small { color: #b45309; }
[data-bs-theme="dark"] body.rol-super .tb-cuenta-txt small { color: #fcd34d; }

/* Franja: el superadmin ve una línea dorada bajo la barra superior */
body.rol-super .tb-topbar { box-shadow: inset 0 -2px 0 rgba(245,158,11,.75); }
body.rol-admin .tb-topbar { box-shadow: inset 0 -2px 0 rgba(99,102,241,.45); }
body.rol-secretaria .tb-topbar { box-shadow: inset 0 -2px 0 rgba(236,72,153,.4); }

/* Gestor viendo la tienda */
.tb-vista-tienda { background: var(--tb-surface); border-bottom: 1px solid var(--tb-border); font-size: .8rem; padding: .4rem 0; }
.tb-vista-tienda .container { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--tb-muted); }
.tb-vista-tienda a { font-weight: 700; margin-left: auto; }
@media (max-width: 459.98px) { .tb-bodega-chip > span, .tb-bodega-chip > .bi-chevron-expand { display: none; } .tb-bodega-chip { padding: .25rem; } }

/* =========================================================
   TIENDA — «Catálogo primero» (tb-tienda-catalogo)
   ========================================================= */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 0 .4rem; }
.sh-bodega { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.sh-bodega img, .sh-bodega .ph { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; flex: none; background: var(--tb-primary-soft); color: var(--tb-primary); display: grid; place-items: center; font-size: 1.2rem; box-shadow: var(--tb-shadow-sm); }
.sh-bodega h1 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-bodega p { margin: .1rem 0 0; font-size: .8rem; color: var(--tb-muted); }
.sh-bodega p b { color: var(--tb-success); }

/* Volver a pedir */
.reorder { display: flex; gap: .65rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -12px; padding: 0 12px .35rem; }
.reorder::-webkit-scrollbar { display: none; }
.reorder-item { flex: 0 0 132px; scroll-snap-align: start; background: var(--tb-surface); border-radius: 16px; padding: .4rem .4rem .5rem; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); display: flex; flex-direction: column; gap: .3rem; }
.reorder-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--tb-surface-2); display: block; }
.reorder-item .ri-nombre { font-size: .74rem; font-weight: 600; line-height: 1.25; color: var(--tb-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.85rem; }
.reorder-item b { font-size: .82rem; white-space: nowrap; }
.ri-add { width: 30px; height: 30px; border-radius: 10px; border: 0; background: var(--tb-primary); color: #fff; display: grid; place-items: center; flex: none; }
@media (min-width: 768px) { .reorder { margin: 0; padding: 0 0 .35rem; } .reorder-item { flex-basis: 150px; } }

/* Tarjeta: el «+» es un botón real encima de la foto */
.product-card { position: relative; }
.product-card .product-media { display: block; }
.product-card .product-body { color: inherit; text-decoration: none; }
.media-stock.encargo { background: rgba(241,245,249,.92); color: #475569; }
.media-stock.encargo::before { background: #94a3b8; }
.stock.encargo { background: rgba(100,116,139,.12); color: #475569; }
[data-bs-theme="dark"] .stock.encargo { color: #cbd5e1; background: rgba(148,163,184,.16); }

/* Vista lista / cuadrícula */
.vista-toggle { display: inline-flex; border-radius: 999px; padding: 3px; background: var(--tb-surface); box-shadow: 0 0 0 1px var(--tb-border); }
.vista-toggle button { width: 34px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--tb-muted); display: grid; place-items: center; }
.vista-toggle button.on { background: var(--tb-ink); color: var(--tb-surface); }
.catalogo[data-vista="grid"] .vista-lista, .catalogo[data-vista="lista"] .vista-grid { display: none; }
.product-list { display: grid; gap: .5rem; }
@media (min-width: 992px) { .product-list { grid-template-columns: 1fr 1fr; gap: .75rem; } }
.product-row { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem .5rem .5rem; border-radius: 16px; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.pr-foto img { width: 64px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--tb-surface-2); display: block; }
.pr-info { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: .2rem; }
.pr-nombre { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-meta { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.pr-tallas { font-size: .72rem; color: var(--tb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-add { width: 42px; height: 42px; flex: none; border: 0; border-radius: 14px; background: var(--tb-ink); color: var(--tb-surface); font-size: 1.1rem; display: grid; place-items: center; }

/* Hoja de tallas */
.hoja-tallas { --bs-offcanvas-bg: var(--tb-surface); }
.hoja-tallas.offcanvas-bottom { height: auto; max-height: 88vh; border-radius: 24px 24px 0 0; border: 0; }
.hoja-tallas.offcanvas-end { width: 440px; border: 0; }
.hoja-asa { width: 40px; height: 4px; border-radius: 4px; background: var(--tb-border); margin: .6rem auto 0; }
.offcanvas-end .hoja-asa { display: none; }
.hoja-foto { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--tb-surface-2); flex: none; }
.hoja-tallas .offcanvas-title { font-size: 1rem; font-weight: 800; }
.hoja-tallas .size-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.hoja-pie { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--tb-border); background: var(--tb-surface); }
.hoja-pie .info { flex: 1; min-width: 0; line-height: 1.2; }
.hoja-pie .info b { display: block; }
.hoja-pie .info small { color: var(--tb-muted); font-size: .78rem; }
.hoja-pie .btn { border-radius: 14px; white-space: nowrap; }
.media-wrap { position: relative; }
.media-wrap > .media-add { border: 0; z-index: 2; cursor: pointer; }
.media-wrap > .media-add:hover { transform: rotate(90deg); }
.size-cell .d.encargo { color: #64748b; }
[data-bs-theme="dark"] .size-cell .d.encargo { color: #94a3b8; }
.st-titulo { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
@media (max-width: 767.98px) { .shop-toolbar { flex-direction: column; align-items: stretch; } .shop-toolbar > .d-flex { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .shop-toolbar > .d-flex > * { flex: none; } }
@media (min-width: 768px) { .st-titulo { gap: 1.25rem; } }

/* =========================================================
   TIENDA PS — estructura estilo PrestaShop (Hummingbird) con los colores del tema (tb-tienda-prestashop)
   ========================================================= */
body.ps { background: var(--tb-bg); }
body.ps .container { max-width: 1280px; }

/* Franja superior */
.ps-topbar { background: var(--tb-ink); color: rgba(255,255,255,.78); font-size: .78rem; }
.ps-topbar .container { min-height: 36px; }
.ps-topbar a, .ps-topbar span { color: inherit; text-decoration: none; white-space: nowrap; }
.ps-topbar a:hover { color: #fff; }
.ps-topbar i { margin-right: .25rem; }
.ps-tema { border: 0; background: none; color: inherit; padding: 0; }
[data-bs-theme="dark"] .ps-topbar { background: #05080d; }

/* Cabecera principal */
.ps-header { position: sticky; top: 0; z-index: 1020; background: var(--tb-surface); box-shadow: 0 1px 0 var(--tb-border); padding-top: env(safe-area-inset-top); }
.ps-header-inner { display: flex; align-items: center; gap: .75rem; min-height: 68px; }
@media (min-width: 992px) { .ps-header-inner { min-height: 84px; gap: 1.5rem; } }
.ps-burger { border: 0; background: none; font-size: 1.6rem; color: var(--tb-ink); padding: 0; line-height: 1; }
.ps-logo { display: flex; align-items: center; gap: .6rem; color: var(--tb-ink); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; text-decoration: none; flex: none; }
.ps-logo img, .ps-logo .ph { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--tb-primary-soft); color: var(--tb-primary); display: grid; place-items: center; }
@media (min-width: 992px) { .ps-logo img, .ps-logo .ph { width: 48px; height: 48px; } .ps-logo { font-size: 1.2rem; } }
.ps-search { flex: 1; display: flex; max-width: 640px; margin: 0 auto; border: 2px solid var(--tb-border); border-radius: 999px; overflow: hidden; background: var(--tb-surface); transition: border-color .15s; }
.ps-search:focus-within { border-color: var(--tb-primary); }
.ps-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: .55rem 1rem; font-size: 16px; color: var(--tb-ink); }
.ps-search button { border: 0; background: var(--tb-primary); color: #fff; padding: 0 1rem; font-weight: 700; font-size: .9rem; }
.ps-search button:hover { background: var(--tb-primary-600); }
@media (max-width: 575.98px) { .ps-header-inner { flex-wrap: wrap; padding-bottom: .6rem; } .ps-search { order: 5; flex-basis: 100%; } }
.ps-acciones { display: flex; align-items: center; gap: .9rem; flex: none; }
.ps-cuenta { display: flex; align-items: center; gap: .5rem; border: 0; background: none; color: var(--tb-ink); padding: 0; }
.ps-cuenta .txt, .ps-carrito .txt { flex-direction: column; line-height: 1.1; text-align: left; }
.ps-cuenta .txt { display: flex; }
.ps-cuenta small, .ps-carrito small { font-size: .7rem; color: var(--tb-muted); }
.ps-cuenta b, .ps-carrito b { font-size: .86rem; }
.ps-carrito { display: flex; align-items: center; gap: .55rem; color: var(--tb-ink); text-decoration: none; }
.ps-carrito .ico { position: relative; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--tb-primary-soft); color: var(--tb-primary); font-size: 1.25rem; }
.ps-carrito .tb-dot { top: -5px; right: -5px; }
.ps-carrito:hover .ico { background: var(--tb-primary); color: #fff; }

/* Menú de categorías */
.ps-menu { border-top: 1px solid var(--tb-border); }
.ps-menu .container { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.ps-menu a { position: relative; padding: .8rem .95rem; font-size: .86rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tb-ink-2); text-decoration: none; white-space: nowrap; }
.ps-menu a::after { content: ""; position: absolute; left: .95rem; right: .95rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--tb-primary); transform: scaleX(0); transition: transform .2s; }
.ps-menu a:hover, .ps-menu a.on { color: var(--tb-primary); }
.ps-menu a:hover::after, .ps-menu a.on::after { transform: scaleX(1); }
.ps-menu-movil { --bs-offcanvas-width: 320px; }
.ps-menu-movil .offcanvas-body a, .ps-menu-movil .offcanvas-body button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem .25rem; border: 0; border-bottom: 1px solid var(--tb-border); background: none; color: var(--tb-ink); text-decoration: none; font-weight: 600; font-size: .95rem; text-align: left; }
.ps-menu-movil .offcanvas-body a span { margin-left: auto; color: var(--tb-muted); font-size: .8rem; }
.ps-menu-titulo { margin: 1rem 0 .25rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--tb-muted); }
.ps-main { padding-top: 1rem; }

/* Migas de pan */
.ps-migas { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .82rem; color: var(--tb-muted); margin: .25rem 0 1rem; }
.ps-migas a { color: var(--tb-ink-2); text-decoration: none; }
.ps-migas a:hover { color: var(--tb-primary); }
.ps-migas i { font-size: .65rem; }
.ps-migas span { color: var(--tb-ink); font-weight: 600; }

/* Carrusel de portada */
.ps-carrusel { border-radius: 24px; overflow: hidden; margin-bottom: 1.5rem; background: linear-gradient(135deg, #07111f 0%, #0c2b2c 55%, var(--tb-primary) 140%); box-shadow: 0 24px 48px -28px rgba(7,17,31,.7); }
.ps-slide { display: grid; grid-template-columns: 1fr; min-height: 340px; color: #fff; }
@media (min-width: 768px) { .ps-slide { grid-template-columns: 1.1fr .9fr; min-height: 400px; } }
.ps-slide-txt { padding: 1.75rem 1.5rem 2.75rem; display: flex; flex-direction: column; justify-content: center; gap: .6rem; order: 2; }
@media (min-width: 768px) { .ps-slide-txt { padding: 3rem 3.25rem; order: 1; } }
.ps-slide-eyebrow { align-self: flex-start; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #1c1203; background: var(--tb-accent); padding: .3rem .7rem; border-radius: 999px; }
[data-bs-theme="dark"] .ps-slide-eyebrow { color: #1c1203; }
.ps-slide h2 { color: #fff; font-size: clamp(1.7rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 0; }
.ps-slide p { color: rgba(255,255,255,.75); margin: 0; }
.ps-slide-precio { font-size: 1.9rem; font-weight: 800; color: #5eead4; letter-spacing: -.02em; margin-bottom: .4rem; }
.ps-slide-img { order: 1; position: relative; min-height: 220px; }
@media (min-width: 768px) { .ps-slide-img { order: 2; } }
.ps-slide-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { .ps-slide-img img { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%); mask-image: linear-gradient(90deg, transparent 0, #000 22%); } }
.ps-carrusel .carousel-indicators { margin-bottom: .9rem; }
.ps-carrusel .carousel-indicators [data-bs-target] { width: 26px; height: 4px; border-radius: 4px; border: 0; }
.ps-carrusel .carousel-control-prev, .ps-carrusel .carousel-control-next { width: 64px; opacity: 1; }
.ps-flecha { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 1.1rem; }
@media (max-width: 767.98px) { .ps-carrusel .carousel-control-prev, .ps-carrusel .carousel-control-next { display: none; } }

/* Categorías destacadas (portada) */
.ps-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.ps-cats a { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: 16px; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); color: var(--tb-ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.ps-cats a:hover { transform: translateY(-2px); box-shadow: var(--tb-shadow), 0 0 0 1px rgba(var(--tb-primary-rgb), .4); }
.ps-cats .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tb-primary-soft); color: var(--tb-primary); flex: none; }
.ps-cats b { display: block; font-size: .92rem; }
.ps-cats small { color: var(--tb-muted); font-size: .74rem; }

/* Secciones de portada */
.ps-seccion { margin-bottom: 2rem; }
.ps-seccion-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--tb-border); }
.ps-seccion-cab h2 { position: relative; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.ps-seccion-cab h2::after { content: ""; position: absolute; left: 0; bottom: calc(-.6rem - 1px); width: 56px; height: 3px; background: var(--tb-primary); border-radius: 3px; }
.ps-seccion-cab a { font-size: .84rem; font-weight: 700; white-space: nowrap; text-decoration: none; }
@media (min-width: 992px) { .ps-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ps-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .ps-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Miniatura de producto */
.ps-mini { padding: .5rem; display: flex; flex-direction: column; }
.ps-mini .product-media { aspect-ratio: 1 / 1; }
.ps-mini .product-body { padding: .75rem .35rem .3rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.ps-mini .product-name { color: var(--tb-ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; min-height: 2.35rem; }
.ps-mini .product-name:hover { color: var(--tb-primary); }
.ps-mini-precio { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.ps-mini-precio .product-price { font-size: 1.15rem; color: var(--tb-ink); white-space: nowrap; }
.ps-disp { font-size: .72rem; font-weight: 700; color: var(--tb-success); white-space: nowrap; }
.ps-flags { position: absolute; left: .5rem; top: .5rem; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; z-index: 1; pointer-events: none; }
.ps-flag { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: .25rem .5rem; border-radius: 6px; color: #fff; }
.ps-flag.nuevo { background: var(--tb-primary); }
.ps-flag.destacado { background: var(--tb-accent); }
.ps-flag.poco { background: #c2410c; }
.ps-flag.encargo { background: rgba(71,85,105,.88); }
.ps-vista-rapida { position: absolute; left: 50%; bottom: .75rem; transform: translate(-50%, 8px); opacity: 0; border: 0; border-radius: 999px; padding: .45rem .9rem; background: rgba(255,255,255,.95); color: #111827; font-weight: 700; font-size: .8rem; box-shadow: 0 8px 20px -8px rgba(0,0,0,.45); transition: opacity .2s, transform .2s; white-space: nowrap; z-index: 2; }
.ps-mini:hover .ps-vista-rapida, .ps-vista-rapida:focus-visible { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .ps-vista-rapida { opacity: 1; transform: none; left: auto; right: .5rem; bottom: .5rem; padding: .45rem; width: 36px; height: 36px; } .ps-vista-rapida span { display: none; } }
.ps-swatches { display: flex; align-items: center; gap: .3rem; }
.ps-swatches span { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 2px var(--tb-surface), 0 0 0 3px var(--tb-border); }
.ps-swatches small { font-size: .7rem; color: var(--tb-muted); margin-left: .2rem; }
.ps-btn-carrito { margin-top: auto; width: 100%; border-radius: 12px; font-weight: 700; font-size: .86rem; padding: .55rem .5rem; background: var(--tb-primary); color: #fff; border: 0; }
.ps-btn-carrito:hover { background: var(--tb-primary-600); color: #fff; }
.ps-btn-ver { background: var(--tb-surface-2); color: var(--tb-ink); }
.ps-btn-ver:hover { background: var(--tb-border); color: var(--tb-ink); }
.ps-mini > .media-wrap .media-add { display: none; }

/* Listado */
.ps-filtros-col { position: sticky; top: 150px; }
.ps-filtros { background: var(--tb-surface); border-radius: 18px; padding: 1rem; box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.ps-filtros-movil .ps-filtros { box-shadow: none; padding: 0; }
.ps-faceta { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--tb-border); }
.ps-faceta-tit { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; color: var(--tb-ink); }
.ps-faceta > a { display: block; padding: .25rem 0; font-size: .88rem; color: var(--tb-ink-2); text-decoration: none; }
.ps-faceta > a span, .ps-color-fac span { color: var(--tb-muted); font-size: .78rem; }
.ps-faceta > a.on { color: var(--tb-primary); font-weight: 700; }
.ps-tallas-fac { display: flex; flex-wrap: wrap; gap: .35rem; }
.ps-tallas-fac label { position: relative; min-width: 42px; padding: .35rem .5rem; text-align: center; font-size: .8rem; font-weight: 700; border-radius: 10px; border: 1.5px solid var(--tb-border); cursor: pointer; }
.ps-tallas-fac input { position: absolute; opacity: 0; pointer-events: none; }
.ps-tallas-fac label.on, .ps-tallas-fac label:has(input:checked) { border-color: var(--tb-primary); background: var(--tb-primary-soft); color: var(--tb-primary); }
.ps-color-fac { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; font-size: .88rem; cursor: pointer; }
.ps-color-fac i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); display: inline-block; }
.ps-listado-cab { margin-bottom: 1rem; }
.ps-listado-cab h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .5rem; }
.ps-listado-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 14px; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); font-size: .86rem; }
.ps-listado-barra .form-select { width: auto; border-radius: 10px; }
.ps-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .75rem; }
.ps-chip { display: inline-flex; align-items: center; gap: .2rem; padding: .25rem .4rem .25rem .7rem; border-radius: 999px; background: var(--tb-primary-soft); color: var(--tb-primary); font-size: .78rem; font-weight: 700; text-decoration: none; }
.ps-paginacion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--tb-border); }

/* Vista rápida */
.ps-qv .modal-content { border: 0; border-radius: 24px; overflow: hidden; }
.ps-qv-cerrar { position: absolute; right: 1rem; top: 1rem; z-index: 3; background-color: var(--tb-surface); border-radius: 50%; padding: .6rem; opacity: .9; }
.ps-qv-grid { display: grid; grid-template-columns: 1fr; min-height: 0; flex: 1; overflow: hidden; }
@media (min-width: 768px) { .ps-qv-grid { grid-template-columns: 5fr 7fr; max-height: min(86vh, 760px); } }
.ps-qv-foto { background: var(--tb-surface-2); }
.ps-qv-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-qv-cuerpo { display: flex; flex-direction: column; min-height: 0; }
.ps-qv-cab { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 3.5rem .5rem 1.25rem; }
.ps-qv-cab h5 { font-weight: 800; font-size: 1.15rem; }
.ps-qv-precio { font-size: 1.4rem; font-weight: 800; color: var(--tb-primary); }
.ps-qv-scroll { flex: 1; overflow-y: auto; padding: .5rem 1.25rem 1rem; }
.ps-qv .hoja-pie { border-top: 1px solid var(--tb-border); }
@media (max-width: 767.98px) {
  .ps-qv .modal-dialog { margin: 0; position: fixed; left: 0; right: 0; bottom: 0; max-width: none; height: auto; max-height: 90vh; align-items: flex-end; transform: translateY(100%); transition: transform .28s ease-out; }
  .ps-qv.show .modal-dialog { transform: none; }
  .ps-qv .modal-content { border-radius: 24px 24px 0 0; max-height: 90vh; }
  .ps-qv-cerrar { top: .9rem; }
}

/* Producto añadido */
.ps-agregado .modal-content { border: 0; border-radius: 20px; }
.ps-agregado .modal-header { background: var(--tb-primary); color: #fff; border: 0; }
.ps-agregado .modal-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; color: #fff; }
.ps-agregado .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.ps-ag-foto { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; background: var(--tb-surface-2); flex: none; }
@media (min-width: 768px) { .ps-ag-resumen { border-left: 1px solid var(--tb-border); padding-left: 1.5rem; } }

/* Garantías */
.ps-garantias { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 768px) { .ps-garantias { grid-template-columns: repeat(3, 1fr); } }
.ps-garantias > div { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 16px; background: var(--tb-surface); box-shadow: var(--tb-shadow-sm), 0 0 0 1px var(--tb-border); }
.ps-garantias i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tb-primary-soft); color: var(--tb-primary); font-size: 1.15rem; flex: none; }
.ps-garantias b { display: block; font-size: .88rem; }
.ps-garantias small { color: var(--tb-muted); font-size: .76rem; }
.ps-garantias-pie { padding: 2rem 0 0; margin-top: 2rem; border-top: 1px solid var(--tb-border); }

/* Ficha: pestañas y detalles */
.ps-tabs .nav-tabs { border-bottom: 1px solid var(--tb-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ps-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; color: var(--tb-muted); font-weight: 700; padding: .75rem 1rem; white-space: nowrap; background: none; }
.ps-tabs .nav-link.active { color: var(--tb-primary); border-bottom-color: var(--tb-primary); background: none; }
.ps-tabs .tab-content { padding: 1.25rem 0; }
.ps-detalles { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: .5rem 1rem; margin: 0; }
.ps-detalles dt { font-weight: 700; color: var(--tb-ink-2); }
.ps-detalles dd { margin: 0; color: var(--tb-muted); }
@media (max-width: 575.98px) { .ps-detalles { grid-template-columns: 1fr; } .ps-detalles dd { margin-bottom: .5rem; } }

/* Pie de página */
.ps-footer { margin-top: 2rem; background: var(--tb-surface); border-top: 1px solid var(--tb-border); padding: 2.5rem 0 0; font-size: .86rem; color: var(--tb-muted); }
.ps-footer h6 { color: var(--tb-ink); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; margin-bottom: .9rem; }
.ps-footer a, .ps-footer span { display: block; color: var(--tb-muted); text-decoration: none; padding: .2rem 0; }
.ps-footer a:hover { color: var(--tb-primary); }
.ps-footer .ps-logo { display: flex; color: var(--tb-ink); }
.ps-footer .ps-logo span { display: inline; color: var(--tb-ink); padding: 0; }
.ps-copy { margin-top: 2rem; padding: 1rem 0 calc(var(--tb-bottomnav-h) + 34px + env(safe-area-inset-bottom)); border-top: 1px solid var(--tb-border); text-align: center; font-size: .78rem; }
@media (min-width: 992px) { .ps-copy { padding-bottom: 1rem; } }
body.ps .shop-footer { display: none; }
body.ps .shop-main { padding-bottom: 0; }
.ps-acciones { margin-left: auto; }
@media (max-width: 575.98px) { .ps-listado-barra > .ms-auto { margin-left: 0 !important; width: 100%; } .ps-listado-barra .form-select { flex: 1; min-width: 0; } .ps-slide-txt { padding: 1.25rem 1.25rem 2.5rem; } .ps-slide-img { min-height: 190px; } .ps-slide-precio { font-size: 1.5rem; } }

/* =========================================================
   WhatsApp de Tus Bodegas (tb-whatsapp-clientes): marca, plantillas, vista previa y línea de tiempo
   ========================================================= */
.wa-marca { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: var(--tb-primary); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .02em; text-transform: none; vertical-align: middle; }
.wa-marca.sm { padding: .1rem .45rem; font-size: .64rem; margin-right: .25rem; }
.wa-marca.lg { font-size: .95rem; padding: .3rem .8rem; margin-right: .35rem; }
.stat-agenda { opacity: .75; }
.stat-agenda .stat-icon { background: var(--tb-surface-2); color: var(--tb-muted); }
.wa-checks { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; font-size: .86rem; color: var(--tb-muted); }
.wa-checks li.ok { color: var(--tb-ink); }
.wa-checks li.ok i { color: var(--tb-success); }
.wa-pasos { padding-left: 1.1rem; font-size: .88rem; display: grid; gap: .35rem; }
.wa-plantillas { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.wa-pl.apagada { opacity: .6; }
.wa-burbuja { position: relative; background: #dcf8c6; color: #111b21; border-radius: 4px 14px 14px 14px; padding: .65rem .8rem; font-size: .84rem; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.12); white-space: normal; word-break: break-word; }
.wa-burbuja .wa-pie { margin-top: .4rem; color: #667781; font-size: .74rem; }
.wa-burbuja .wa-boton { margin: .55rem -.8rem -.65rem; padding: .5rem; border-top: 1px solid rgba(0,0,0,.08); text-align: center; color: #027eb5; font-weight: 600; }
.wa-telefono { position: sticky; top: 84px; border-radius: 22px; overflow: hidden; box-shadow: var(--tb-shadow), 0 0 0 1px var(--tb-border); }
.wa-tel-cab { background: #075e54; color: #fff; padding: .7rem 1rem; font-weight: 700; font-size: .88rem; }
.wa-chat { background: #efeae2; padding: 1.25rem 1rem 1.5rem; min-height: 260px; }
.wa-vars { display: flex; flex-wrap: wrap; gap: .35rem; }
.wa-vars .chip { border: 0; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wa-vars .chip:hover { background: var(--tb-primary-soft); color: var(--tb-primary); }
.wa-texto summary { cursor: pointer; }
.wa-texto pre { white-space: pre-wrap; font-family: inherit; font-size: .8rem; background: var(--tb-surface-2); padding: .5rem .65rem; border-radius: 10px; margin: .35rem 0 0; max-width: 420px; }
.wa-linea { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.wa-linea li { position: relative; padding-left: 1rem; border-left: 2px solid rgba(var(--tb-primary-rgb), .35); }
.wa-linea li.entrante { border-left-color: var(--tb-accent); }
.wa-respuesta { margin-top: .3rem; padding: .45rem .6rem; border-radius: 10px; background: var(--tb-accent-soft); font-size: .84rem; }
[data-bs-theme="dark"] .wa-burbuja { background: #005c4b; color: #e9edef; }
[data-bs-theme="dark"] .wa-burbuja .wa-pie { color: #8696a0; }
[data-bs-theme="dark"] .wa-chat { background: #0b141a; }
