/* ============================================================
   BASE — COMPONENTES COMPARTIDOS
   Componentes que usan todos los módulos
   ============================================================ */

/* ============================================================
   DESKTOP HEADER (dentro del main-area)
   ============================================================ */

.desktop-header {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px 0;
  position: sticky;
  top: 0;
  z-index: 90;
}

.dh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dh-title-group { flex: 1; }

.dh-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.dh-subtitle {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 300;
}

.dh-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-primary {
  font-family: 'Syne', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-primary:hover { background: var(--accent-2); }

@media (min-width: 1024px) {
  .desktop-header { display: block; }
}

/* ============================================================
   MODULE HEADER (para el title en móvil)
   ============================================================ */

.module-head {
  padding: 20px 20px 16px;
}

.module-head h1 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.module-head p {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 300;
}

@media (min-width: 1024px) {
  .module-head { display: none; }
}

/* ============================================================
   SEARCH BAR
   ============================================================ */

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 14px;
  margin: 0 20px 14px;
  background: var(--surface-2);
}

.search-row input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Epilogue', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  outline: none;
}

.search-row input::placeholder { color: var(--text-3); }
.search-row svg { color: var(--text-3); flex-shrink: 0; }

@media (min-width: 1024px) {
  .search-row { margin: 0 0 16px; max-width: 460px; }
}

/* ============================================================
   TABS
   ============================================================ */

.tab-row {
  display: flex;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}

.tab-row::-webkit-scrollbar { display: none; }

.tab {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 16px 12px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-badge {
  font-family: 'Epilogue', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 10px;
}

.tab.active .tab-badge {
  color: var(--accent-fg);
  background: var(--accent);
}

@media (min-width: 1024px) {
  .tab-row { padding: 0; margin-top: 14px; }
}

/* ============================================================
   ALERT BAR (sugerencias / avisos)
   ============================================================ */

.alert-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-icon {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
}

.alert-text { flex: 1; min-width: 0; }

.alert-text p {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-text span {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 300;
}

.alert-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-ghost {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 5px 10px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover { background: var(--surface-2); }

.btn-solid {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 5px 10px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
  transition: all 0.15s;
}

@media (min-width: 1024px) {
  .alert-bar {
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 0 0 16px;
  }
}

/* ============================================================
   FILTER STRIP
   ============================================================ */

.filter-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.filter-strip::-webkit-scrollbar { display: none; }

.fchip {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 16px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
  background: transparent;
  border-top: none;
  border-bottom: none;
  border-left: none;
}

.fchip:hover { color: var(--text-2); background: var(--surface-2); }
.fchip.active { color: var(--text); background: var(--surface-2); }

@media (min-width: 1024px) {
  .filter-strip {
    background: transparent;
    margin-bottom: 0;
  }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section-count {
  font-family: 'Epilogue', sans-serif;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 300;
}

@media (min-width: 1024px) {
  .section-header { padding: 22px 0 10px; }
}

/* ============================================================
   SECTION DIVIDER
   ============================================================ */

.section-divider {
  height: 8px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .section-divider { background: transparent; height: 24px; border: none; }
}

/* ============================================================
   PRODUCT ROW (componente principal de lista)
   ============================================================ */

.product-row {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}

.product-row:last-child { border-bottom: 1px solid var(--border); }
.product-row:hover { background: var(--surface-2); }
.product-row:active { background: var(--surface-3); }
.product-row.checked { opacity: 0.5; }

.row-check {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--border-2);
  transition: color 0.2s;
}

.row-check.checked { color: var(--green); }

.row-body {
  flex: 1;
  padding: 13px 0;
  min-width: 0;
}

.row-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s;
}

.product-row.checked .row-name {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.row-store {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 300;
}

.row-warn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--warn);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.row-right {
  padding: 13px 20px 13px 12px;
  text-align: right;
  flex-shrink: 0;
}

.row-price {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.row-unit {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 300;
}

@media (min-width: 1024px) {
  .row-check { width: 56px; height: 56px; }
  .row-body { padding: 15px 0; }
  .row-name { font-size: 15px; }
  .row-right { padding-right: 0; }
}

/* ============================================================
   STORE BLOCK (lista agrupada por tienda)
   ============================================================ */

.store-block { background: var(--surface); }

.store-header-row {
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-name-label {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.store-items-count {
  font-family: 'Epilogue', sans-serif;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 300;
}

@media (min-width: 1024px) {
  .store-header-row { padding: 20px 0 10px; }
}

/* ============================================================
   APPLY BAR (flotante al marcar productos)
   ============================================================ */

.apply-bar {
  position: fixed;
  bottom: 86px;
  left: 16px;
  right: 16px;
  max-width: 400px;
  margin: 0 auto;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 150;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.apply-bar p {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.95;
}

.apply-bar span {
  font-size: 11px;
  opacity: 0.65;
}

.apply-btn {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-fg);
  color: var(--accent);
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .apply-bar {
    bottom: 32px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 560px;
    width: calc(100% - 48px);
  }
}

/* ============================================================
   FAB (botón flotante + en móvil)
   ============================================================ */

.fab {
  position: fixed;
  bottom: 92px;
  right: 16px;
  width: 46px; height: 46px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  box-shadow: var(--shadow-lg);
  transition: all 0.15s;
}

.fab:active { transform: scale(0.91); }

@media (min-width: 1024px) {
  .fab { display: none; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  padding: 60px 32px;
  text-align: center;
  color: var(--text-3);
}

.empty-state-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border: 1.5px solid var(--border-2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.empty-state p {
  font-size: 13px;
  font-weight: 300;
  max-width: 280px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* ============================================================
   CARDS (genéricas)
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.card-value {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.card-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  font-weight: 300;
}
