:root {
  --accent: #0d71b4;
  --accent-dark: #0a5a8f;
  --green: #1a9c5b;
  --amber: #d98b00;
  --red: #d64545;
  --orange: #e0642f;
  --bg: #f2f4f7;
  --card: #ffffff;
  --border: #e3e8ee;
  --text: #1c2733;
  --muted: #6b7785;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ===== Barra superior ===== */
.topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 22px; }
.logo-img { width: 28px; height: 28px; border-radius: 7px; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-accent { color: #059669; }

.search-box {
  flex: 1;
  max-width: 640px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
}
.search-icon { opacity: 0.5; }
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  outline: none;
}

.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.btn-subir {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.btn-subir:hover { border-color: var(--accent); color: var(--accent); }

.branch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.caret { color: var(--muted); font-size: 11px; }

.cart {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}
.cart-count {
  position: absolute;
  top: -2px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* ===== Cuerpo (3 columnas) ===== */
.layout {
  display: grid;
  grid-template-columns: 60px 250px 1fr;
  min-height: calc(100vh - 60px);
}

/* --- Menú rail --- */
.icon-rail {
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 6px;
}
.rail-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
}
.rail-btn:hover { background: var(--bg); }
.rail-btn.active { background: #e7f1f9; color: var(--accent); }
.rail-spacer { flex: 1; }
.rail-btn.wa { color: #25d366; }

/* --- Panel droguerías --- */
.droguerias {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  overflow-y: auto;
}
.droguerias-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 10px;
}
.link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}
.droguerias-list { list-style: none; margin: 0; padding: 0; }
.drog {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.drog:hover { background: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-on { background: var(--green); box-shadow: 0 0 0 3px #e1f3e9; }
.dot-off { background: #c3ccd6; }

.subtitle {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.transfer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
}
.transfer-info { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.transfer-badge {
  background: #eef0f3;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.solicitar {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.solicitar:hover { border-color: var(--accent); color: var(--accent); }

.sin-web {
  margin-top: 16px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.agregar-drog {
  width: 100%;
  margin-top: 10px;
  border: 1px dashed var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}
.agregar-drog:hover { border-color: var(--accent); }

/* --- Contenido --- */
.content { padding: 20px 24px; overflow-y: auto; }

.banner {
  background: #e7f1f9;
  border: 1px solid #cfe3f5;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.banner-icon { font-size: 20px; }
.banner-text { flex: 1; display: flex; flex-direction: column; }
.banner-text strong { font-size: 14px; }
.banner-text span { color: var(--muted); font-size: 13px; }
.banner-link {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.banner-close { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }

.section { margin-bottom: 26px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 17px; }

.btn-export {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.btn-export:hover { border-color: var(--accent); color: var(--accent); }
.btn-export:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Grilla de productos --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.product-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.product-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-2px); }

.discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
}
.product-img {
  height: 112px;
  background: #f7f9fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.product-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}
.product-ing { color: var(--muted); font-size: 12px; }
.product-price { font-size: 16px; font-weight: 700; }
.agregar {
  margin-top: auto;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.agregar:hover { background: var(--accent); color: #fff; }

/* --- Estado --- */
.estado {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid;
  margin-top: 16px;
}
.estado.info { background: #eef5fb; border-color: #cfe3f5; color: #0a5a8f; }
.estado.error { background: #fdeeee; border-color: #f5caca; color: #a13333; }

/* --- Carrito drawer --- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-head h3 { margin: 0; font-size: 16px; }
#cart-close { border: none; background: none; font-size: 18px; cursor: pointer; }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 40px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; line-height: 1.3; }
.cart-item-unit { font-size: 12px; color: var(--muted); }
.cart-item-lista { display: inline-block; margin-left: 6px; text-decoration: line-through; color: var(--muted); }
.cart-item-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 22px; height: 22px; border: 1px solid var(--border);
  background: #fff; border-radius: 6px; cursor: pointer; font-weight: 700; line-height: 1;
}
.qty-num { min-width: 18px; text-align: center; font-weight: 600; font-size: 13px; }
.cart-item-price { font-weight: 700; white-space: nowrap; min-width: 70px; text-align: right; }
.cart-item-del { border: none; background: none; color: var(--red); cursor: pointer; font-size: 14px; }
.cart-drawer-foot { padding: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-resumen { padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.cart-ahorro { font-size: 13px; color: #15803d; }
.cart-ahorro strong { font-size: 16px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 14px; }
.cart-total strong { font-size: 20px; color: var(--foreground); }
.btn-finalizar {
  width: 100%; padding: 12px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent, #2563eb); color: #fff; font-weight: 700; font-size: 15px;
}
.btn-finalizar:hover { filter: brightness(1.05); }
.btn-vaciar { width: 100%; padding: 10px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* --- Badges de promos / baja de precio --- */
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 6px; margin: 2px 3px 0 0; white-space: nowrap;
}
.badge-baja { background: #fee2e2; color: #b91c1c; }
.badge-2x1 { background: #fef3c7; color: #92400e; }
.badge-bonif { background: #ede9fe; color: #6d28d9; }
.badge-escala { background: #e0f2fe; color: #0369a1; cursor: help; }

/* --- Modal pedido --- */
.pedido-drog { padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.pedido-drog-head { margin-bottom: 6px; }
.pedido-linea { font-size: 13px; padding: 3px 0; color: var(--muted); }
.pedido-total { margin-top: 8px; font-size: 15px; }
.pedido-ok { color: #15803d; font-weight: 600; margin-top: 6px; }
.pedido-error { color: #b91c1c; }

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.product-img.img-fallback::before {
  content: "💊";
  font-size: 40px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.modal-body label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.modal-body input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.modal-body input:focus { outline: none; border-color: var(--accent); }
.modal-hint { font-size: 11px; color: var(--muted); margin-top: 8px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.btn-ghost {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-dark); }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2733;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 200;
}

.search-box { position: relative; }
.search-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.search-btn:hover { background: var(--accent-dark); }

.autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.16);
  z-index: 60;
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}
.auto-group-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px; padding: 4px 6px 8px;
}
.auto-marca { font-size: 12px; font-weight: 700; color: var(--accent); padding: 4px 6px; }
.auto-droga {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 6px; font-size: 13px; font-weight: 600; color: var(--fg);
  border-radius: 6px; cursor: pointer;
}
.auto-droga:hover { background: var(--bg); }
.auto-count { font-size: 11px; font-weight: 500; color: var(--muted); }
.auto-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-radius: 8px; cursor: pointer;
}
.auto-card:hover { background: var(--bg); }
.auto-img {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: #f7f9fb; border-radius: 6px; overflow: hidden;
}
.auto-img img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.auto-info { flex: 1; min-width: 0; }
.auto-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auto-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auto-price { font-size: 14px; font-weight: 700; white-space: nowrap; }
.auto-agregar {
  flex-shrink: 0; border: none; background: var(--accent); color: #fff;
  border-radius: 6px; padding: 6px 10px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.auto-agregar:hover { background: var(--accent-dark); }
.auto-foot { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; text-align: center; }
.auto-ver-todo { border: none; background: none; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }

/* --- Dropdowns (avatar + sucursal) --- */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.14);
  z-index: 70;
  overflow: hidden;
}
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.active { color: var(--accent); font-weight: 600; }
.dropdown-item.muted { color: var(--muted); }
.dropdown-item.danger { color: var(--red); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* --- Resultados: filtros + grilla --- */
.ref-note { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.res-layout { display: flex; gap: 18px; align-items: flex-start; }
.filtros { width: 210px; flex-shrink: 0; }
.res-main { flex: 1; min-width: 0; }
.filtro-grupo { margin-bottom: 16px; }
.filtro-titulo {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px;
}
.filtro-item {
  padding: 6px 8px; font-size: 13px; cursor: pointer;
  border-radius: 6px; color: var(--fg);
}
.filtro-item:hover { background: var(--bg); }
.filtro-item.activo { background: var(--accent); color: #fff; font-weight: 600; }
.filtro-item.activo .filtro-count { color: #fff; }
.filtro-count { color: var(--muted); font-size: 12px; }
.filtro-limpiar { color: var(--accent); font-weight: 600; }
.filtros-vacio { color: var(--muted); font-size: 12px; }
.res-more { text-align: center; margin-top: 18px; }
.btn-ver-mas {
  border: 1px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 8px; padding: 10px 24px; font-weight: 700; cursor: pointer;
}
.btn-ver-mas:hover { background: var(--accent); color: #fff; }
.product-ean { font-size: 11px; color: var(--muted); font-family: monospace; }

/* --- Bloque "Resultados por principio activo" --- */
.pa-block { margin-bottom: 14px; }
.pa-title {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px;
}
.pa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pa-chip {
  border: 1px solid var(--border); background: #fff; color: var(--fg);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.pa-chip span { color: var(--muted); font-size: 12px; }
.pa-chip:hover { border-color: var(--accent); }
.pa-chip.activo { background: var(--accent); border-color: var(--accent); color: #fff; }
.pa-chip.activo span { color: #fff; }
.pa-chip.limpiar { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* --- Toggle en modal --- */
.toggle-line {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 13px; font-weight: 500; color: var(--fg); cursor: pointer;
}
.toggle-line input { width: auto; padding: 0; border: none; accent-color: var(--accent); }

/* --- Lista de resultados (estilo Extendeal) --- */
.res-lista { display: flex; flex-direction: column; gap: 10px; }
.res-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.res-item:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.res-check { position: relative; display: flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.res-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.res-check .checkmark {
  position: relative; width: 20px; height: 20px;
  border: 2px solid var(--border); border-radius: 5px; background: #fff;
  transition: 0.15s;
}
.res-check input:checked + .checkmark { background: var(--accent); border-color: var(--accent); }
.res-check input:checked + .checkmark::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.res-photo {
  width: 56px; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: #f7f9fb; border-radius: 8px; overflow: hidden;
}
.res-photo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.res-info { flex: 1; min-width: 0; }
.res-name { font-size: 14px; font-weight: 600; }
.drog-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
  background: #eef2f7; color: var(--muted);
}
.drog-badge[data-drog="Del Sud"] { background: #e0f2fe; color: #0369a1; }
.drog-badge[data-drog="Acofar"] { background: #dcfce7; color: #15803d; }
.res-ean { font-size: 11px; color: var(--muted); font-family: monospace; }
.res-lab { font-size: 12px; color: var(--muted); }
.res-price { text-align: right; min-width: 120px; }
.res-precio { font-size: 16px; font-weight: 700; }
.res-precio-lista { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.res-compara { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.res-compara .mejor { color: var(--accent); font-weight: 700; }
.res-desc {
  display: inline-block; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 4px; padding: 2px 6px; margin-top: 4px;
}
.res-agregar { flex-shrink: 0; }
.stock-badge { display: inline-block; font-size: 11px; font-weight: 600; margin-top: 3px; }
.stock-ok { color: #16a34a; }
.stock-no { color: #dc2626; }

/* --- "Seleccionar todos" en la cabecera --- */
.sel-todos {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer; margin-left: auto;
}
.sel-todos input { accent-color: var(--accent); width: 16px; height: 16px; }

/* --- Barra de selección flotante --- */
.sel-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  background: #1c2733; color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3); z-index: 150;
}
.sel-info { font-size: 14px; white-space: nowrap; }
.sel-actions { display: flex; gap: 8px; }
.sel-bar .btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; }
.sel-bar .btn-primary { background: var(--accent); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 56px 1fr; }
  .droguerias { display: none; }
}
@media (max-width: 640px) {
  .branch, .btn-subir { display: none; }
  .layout { grid-template-columns: 1fr; }
  .icon-rail { display: none; }
}

/* --- Selector de método de envío (checkout) --- */
.envio-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.envio-row label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.envio-row select { flex: 1; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; }
