/* ===================================================
   CATÁLOGO INTERACTIVO B2B — ÉTNICO / D'ORIGEN
   Mobile-first · Paleta D'Origen · Minimalista
=================================================== */

:root {
  --primary:        #0b542b;
  --primary-light:  #1a7040;
  --primary-dark:   #073d1f;
  --accent:         #6fb85d;
  --accent-light:   #9dd18e;
  --bg:             #f1f5f3;
  --bg-alt:         #e8efe9;
  --surface:        #ffffff;
  --surface-alt:    #f7faf8;
  --border:         #d8e5dc;
  --border-light:   #eaf2ec;
  --text:           #0d1f14;
  --text-muted:     #5a7462;
  --text-light:     #8faa97;
  --success:        #6fb85d;
  --shadow-sm:      0 1px 4px rgba(11,84,43,.08);
  --shadow-md:      0 4px 16px rgba(11,84,43,.10);
  --shadow-lg:      0 12px 32px rgba(11,84,43,.14);
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --transition:     0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

/* ─── TOPBAR ─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: white;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(11,84,43,.22);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.topbar-brand .brand-main {
  font-size: 15px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topbar-brand .brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 500;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.18);
  flex-shrink: 0;
}

.topbar-search {
  flex: 1;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,.10);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 4px;
  padding: 0 14px 0 40px;
  color: white;
  font-size: 13.5px;
  font-weight: 400;
  outline: none;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.topbar-search input::placeholder { color: rgba(255,255,255,.45); }

.topbar-search input:focus {
  background: rgba(255,255,255,.16);
  border-color: var(--accent);
}

.topbar-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.5);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-partner-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: 16px;
}

.partner-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.btn-filter-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.85);
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-toggle:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.4);
  color: white;
}

.btn-filter-toggle .filter-badge {
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ─── LAYOUT ─────────────────────────────────────── */
/* ─── TAB BAR ────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 64px;
  z-index: 90;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  cursor: pointer;
  transition: all .18s;
}
.tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}

/* ─── SIDEBAR FILTROS ────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  display: none;
  padding: 24px 16px;
}

.sidebar.open { display: block; }

.sidebar-section { margin-bottom: 28px; }

.sidebar-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  padding-left: 2px;
}

.filter-chip-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-muted);
  transition: var(--transition);
  user-select: none;
  border: 1.5px solid transparent;
  font-weight: 500;
  background: transparent;
}

.filter-chip:hover {
  background: rgba(11,84,43,.05);
  border-color: rgba(11,84,43,.12);
  color: var(--primary);
}

.filter-chip.active {
  background: rgba(11,84,43,.07);
  border-color: rgba(11,84,43,.18);
  color: var(--primary);
  font-weight: 600;
}

.filter-chip .chip-count {
  font-size: 10px;
  color: var(--text-light);
  background: transparent;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.filter-chip:hover .chip-count {
  color: var(--primary);
}

.filter-chip.active .chip-count {
  background: var(--primary);
  color: white;
}

.sidebar-separator {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0 16px;
}

.btn-clear-filters {
  width: 100%;
  padding: 9px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.btn-clear-filters:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(11,84,43,.04);
}

/* ─── CONTENT AREA ───────────────────────────────── */
.content {
  flex: 1;
  padding: 20px 20px 60px;
  overflow-x: hidden;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.results-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.results-count strong {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

/* ─── PRODUCT GRID ───────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 14px;
}

/* ─── PRODUCT CARD ───────────────────────────────── */
.product-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 1/1;
  background: var(--surface-alt);
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.3s ease;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.card-family-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(11,84,43,.82);
  color: white;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 8px;
  border-radius: 3px;
  max-width: calc(100% - 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
}

.card-pais-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-body {
  padding: 10px 13px 7px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 1px;
}

.card-code {
  font-size: 9.5px;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-pais {
  font-size: 9px;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
  word-break: break-word;
}

.card-peso {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.card-marca {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Tags SECO / CONGELADO en la imagen */
.card-tipo-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 3px;
}

.card-tipo-seco {
  background: rgba(111,184,93,.15);
  color: var(--primary);
  border: 1px solid rgba(111,184,93,.3);
}

.card-tipo-congelado {
  background: rgba(70,130,180,.12);
  color: #2a6496;
  border: 1px solid rgba(70,130,180,.25);
}

.card-footer {
  padding: 8px 13px 11px;
}

/* ─── CARD ORDER ROW ─────────────────────────────── */
.card-order-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-order-row .qty-control { flex: 1; min-width: 0; }
.card-order-row .btn-added   { flex: 1; justify-content: center; }

/* Input de cantidad en tarjeta */
.card-qty-input {
  width: 44px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: white;
  outline: none;
  flex-shrink: 0;
  transition: border-color var(--transition);
}

.card-qty-input:focus { border-color: var(--primary); }

/* Selector de unidad */
.card-unit-select {
  flex: 1;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: white;
  padding: 0 6px;
  outline: none;
  cursor: pointer;
  appearance: auto;
  transition: border-color var(--transition);
  min-width: 0;
}

.card-unit-select:focus { border-color: var(--primary); }

/* Botón + añadir */
.btn-add-card {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.btn-add-card:hover  { background: var(--primary-light); }
.btn-add-card:active { opacity: 0.85; }

/* Hint uds/cj bajo la fila */
.card-uds-hint {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 500;
}

/* Estado en pedido */
.card-unit-info {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

.btn-added {
  height: 32px;
  padding: 0 8px;
  background: rgba(11,84,43,.08);
  color: var(--primary);
  border: 1.5px solid rgba(11,84,43,.2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-added:hover {
  background: rgba(220,38,38,.08);
  color: #dc2626;
  border-color: rgba(220,38,38,.2);
}

/* Badge en carrito */
.cart-unit-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.cart-unit-cajas    { background: rgba(11,84,43,.10);  color: var(--primary); }
.cart-unit-unidades { background: rgba(111,184,93,.15); color: var(--primary-light); }
.cart-unit-pallet   { background: rgba(212,168,83,.15); color: #8a6800; }

.btn-add {
  width: 100%;
  height: 34px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition);
}

.btn-add:hover { background: var(--primary-light); }
.btn-add:active { opacity: 0.88; }

.btn-add.in-cart { background: var(--success); }

/* Quantity control inline */
.qty-control {
  display: flex;
  align-items: center;
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}

.qty-control button {
  width: 32px;
  height: 100%;
  background: var(--surface-alt);
  border: none;
  color: var(--primary);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.qty-control button:hover { background: var(--bg-alt); }

.qty-control .qty-value {
  flex: 1;
  height: 100%;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  min-width: 0;
}

/* ─── EMPTY STATE ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

.empty-state svg { opacity: 0.2; margin-bottom: 16px; }

.empty-state h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p { font-size: 13px; line-height: 1.6; }

/* ─── CART FAB ───────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 200;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(11,84,43,.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.cart-fab:hover {
  background: var(--primary-light);
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(11,84,43,.45);
}

.cart-fab:active { transform: scale(0.96); }

.cart-fab .cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  min-width: 21px;
  height: 21px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

.cart-fab.hidden { display: none; }

/* ─── CART OVERLAY + DRAWER ──────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,61,31,.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(2px);
}

.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 14px 14px 0 0;
  z-index: 301;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(11,84,43,.18);
}

.cart-drawer.open { transform: translateY(0); }

.cart-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.cart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.cart-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.cart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.btn-close-cart {
  width: 34px;
  height: 34px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-close-cart:hover {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--border);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  object-fit: contain;
  padding: 5px;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-code {
  font-size: 10.5px;
  color: var(--text-light);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.cart-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cart-item-qty button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.cart-item-qty button:hover {
  background: var(--surface-alt);
  border-color: var(--primary);
}

.cart-item-qty .qty-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  min-width: 22px;
  text-align: center;
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  flex-shrink: 0;
  border-radius: 50%;
}

.btn-remove-item:hover {
  color: #d32f2f;
  background: rgba(211,47,47,.08);
}

/* Cart empty */
.cart-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.cart-empty svg { opacity: 0.18; margin-bottom: 14px; }
.cart-empty p { font-size: 13.5px; line-height: 1.6; }

/* Cart Footer */
.cart-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--surface);
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.cart-summary strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.cart-notice {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

/* ─── CHECKOUT FORM ──────────────────────────────── */
.checkout-form {
  margin-bottom: 12px;
}

.checkout-form label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.checkout-form input {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
  font-weight: 500;
}

.checkout-form input:focus { border-color: var(--primary); }
.checkout-form input.error { border-color: #d32f2f; }

.btn-whatsapp {
  width: 100%;
  height: 50px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--transition);
  box-shadow: 0 4px 14px rgba(37,211,102,.30);
}

.btn-whatsapp:hover { background: #1fba59; }
.btn-whatsapp:active { opacity: 0.9; }

/* ─── FILTER DRAWER (MOBILE) ─────────────────────── */
.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,61,31,.4);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(2px);
}

.filter-overlay.open { opacity: 1; pointer-events: all; }

.filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(290px, 84vw);
  background: var(--surface);
  z-index: 251;
  overflow-y: auto;
  padding: 24px 16px;
  transform: translateX(-100%);
  transition: transform 0.30s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 8px 0 32px rgba(11,84,43,.14);
}

.filter-drawer.open { transform: translateX(0); }

.filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.filter-drawer-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.btn-close-filters {
  width: 32px;
  height: 32px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-close-filters:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* ─── TOAST ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--primary-dark);
  color: white;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  letter-spacing: 0.02em;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── RESPONSIVE ─────────────────────────────────── */

/* Mobile first — pantallas pequeñas */
@media (max-width: 599px) {
  .card-unit-info { display: none; }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 8px;
  }

  .topbar-logo {
    flex: 1;
    min-width: 0;
  }

  .topbar-logo-img {
    height: 32px;
  }

  .topbar-brand .brand-main { font-size: 12px; }
  .topbar-brand .brand-sub  { font-size: 9px; }

  .topbar-partner-logos {
    gap: 8px;
  }

  .partner-logo {
    height: 26px;
  }

  /* Buscador ocupa fila completa en móvil */
  .topbar-search {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0;
  }

  .tab-bar {
    top: 0;
    position: relative;
    padding: 8px 12px;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .content { padding: 12px 12px 80px; }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 16px;
  }

  .topbar { padding: 0 28px; gap: 18px; }
  .content { padding: 24px 28px 60px; }

  .cart-drawer {
    max-width: 440px;
    left: auto;
    border-radius: 14px 0 0 14px;
    top: 0;
    bottom: 0;
    max-height: 100vh;
    transform: translateX(100%);
  }

  .cart-drawer.open { transform: translateX(0); }
  .cart-handle { display: none; }
}

@media (min-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 18px;
  }

  .content { padding: 28px 32px 80px; }
}

@media (min-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ─── ANIMATIONS ─────────────────────────────────── */
@keyframes badge-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.cart-badge.bump { animation: badge-bump 0.24s ease; }
