/* =================================================================
   ThePriceMonkey — Account pages (alertas, listas, top-ventas, etc.)
   Patrones compartidos: hero centrado, secciones, tabla de precios,
   filas de producto, botones de acción.
   ================================================================= */

/* ---------- 1. HERO CENTRADO CON FILETES ------------------ */
.acc-hero {
  background: var(--tpm-bg);
  border-bottom: 1px solid var(--tpm-border);
  padding: 56px 24px 48px;
}
.acc-hero__inner {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}
.acc-hero__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 0;
  font-family: 'Source Serif 4', 'Roboto', serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--tpm-text);
}
.acc-hero__title::before,
.acc-hero__title::after {
  content: '';
  flex: 1;
  max-width: 110px;
  height: 1px;
  background: var(--tpm-border-strong);
}
.acc-hero__sub {
  margin: 18px auto 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--tpm-text-muted);
  max-width: 640px;
  text-wrap: pretty;
}

/* ---------- 2. CONTENEDOR PRINCIPAL ----------------------- */
.acc-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* Botón crear (acción principal) */
.acc-create-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tpm-blue);
  color: #fff;
  border: 0;
  height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 28px;
  transition: background 0.12s ease;
}
.acc-create-btn:hover { background: var(--tpm-blue-dark); }
.acc-create-btn svg { width: 14px; height: 14px; }

/* ---------- 3. SECCIÓN: label en mayúscula + filete -------- */
.acc-section {
  margin-top: 8px;
}
.acc-section + .acc-section { margin-top: 44px; }
.acc-section__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tpm-border);
  margin-bottom: 4px;
}
.acc-section__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tpm-text-muted);
  margin: 0;
}
.acc-section__rule {
  flex: 1;
  height: 1px;
  background: transparent;
}
.acc-section__actions {
  display: flex;
  gap: 18px;
  margin-left: auto;
}
.acc-section__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tpm-blue-dark);
  text-decoration: none;
  transition: color 0.12s ease;
}
.acc-section__action:hover { color: var(--tpm-blue); }
.acc-section__action svg { width: 12px; height: 12px; }
.acc-section__action--danger { color: var(--tpm-discount); }
.acc-section__action--danger:hover { color: #8a1a13; }
body.dark-mode .acc-section__action,
.dark-mode .acc-section__action { color: var(--tpm-blue); }

/* ---------- 4. FILA DE PRODUCTO (alertas / listas) -------- */
.acc-row {
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--tpm-border);
}
.acc-row:last-child { border-bottom: 0; }

.acc-row__img {
  width: 88px; height: 88px;
  background: var(--tpm-surface-alt);
  border: 1px solid var(--tpm-border);
  border-radius: var(--tpm-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.acc-row__img img,
.acc-row__img svg.placeholder {
  width: 80%; height: 80%;
  object-fit: contain;
}

.acc-row__info { min-width: 0; }
.acc-row__title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--tpm-blue-dark);
  margin: 0 0 6px;
  text-decoration: none;
  display: block;
}
.acc-row__title:hover { text-decoration: underline; text-underline-offset: 2px; }
body.dark-mode .acc-row__title,
.dark-mode .acc-row__title { color: var(--tpm-blue); }
.acc-row__meta {
  display: flex; align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--tpm-text-muted);
}
.acc-row__prime {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px;
  color: var(--tpm-prime);
  line-height: 1;
}
.acc-row__prime svg { width: 9px; height: 9px; }
.acc-row__prime-text { font-style: italic; font-weight: 700; }

/* ---------- 5. TABLA DE PRECIOS MINI ---------------------- */
.acc-price {
  border: 1px solid var(--tpm-blue);
  border-radius: var(--tpm-radius);
  overflow: hidden;
  min-width: 220px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.acc-price__head {
  background: var(--tpm-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 8px;
}
.acc-price__cols {
  display: grid;
}
.acc-price--3 .acc-price__cols { grid-template-columns: 1fr 1fr 1fr; }
.acc-price--2 .acc-price__cols { grid-template-columns: 1fr 1fr; }
.acc-price__col {
  text-align: center;
  padding: 8px 12px 10px;
  background: var(--tpm-surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acc-price__col + .acc-price__col {
  border-left: 1px solid var(--tpm-blue);
}
.acc-price__col-head {
  background: var(--tpm-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 4px 6px;
  margin: -8px -12px 6px;
  text-align: center;
}
.acc-price__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--tpm-text);
  letter-spacing: -0.01em;
}
.acc-price__col--max .acc-price__value { color: var(--tpm-stat-max); }
.acc-price__col--max { background: var(--tpm-stat-max-bg); }
.acc-price__col--min .acc-price__value { color: var(--tpm-stat-min); }
.acc-price__col--min { background: var(--tpm-stat-min-bg); }
.acc-price__col--warn { background: #fff8e6; }
.acc-price__col--warn .acc-price__value { color: var(--tpm-fresh); }
body.dark-mode .acc-price__col--warn,
.dark-mode .acc-price__col--warn { background: #2a230f; }

/* ---------- 6. ACCIONES (botones a la derecha) ------------ */
.acc-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}
.acc-actions__row {
  display: flex;
  gap: 6px;
}
.acc-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.acc-btn svg { width: 11px; height: 11px; }
.acc-btn--cta {
  background: var(--tpm-cta);
  color: var(--tpm-cta-text);
  flex: 1;
}
.acc-btn--cta:hover { background: var(--tpm-cta-hover); }
.acc-btn--amazon {
  background: var(--tpm-surface);
  border-color: var(--tpm-cta);
  color: var(--tpm-cta-text);
  flex: 1;
}
.acc-btn--amazon:hover { background: #fff5e3; }
body.dark-mode .acc-btn--amazon,
.dark-mode .acc-btn--amazon { background: transparent; color: var(--tpm-cta); }
.acc-btn--neutral {
  background: var(--tpm-surface-alt);
  border-color: var(--tpm-border);
  color: var(--tpm-text-muted);
}
.acc-btn--neutral:hover {
  border-color: var(--tpm-border-strong);
  color: var(--tpm-text);
}
.acc-btn--brand {
  background: var(--tpm-blue);
  color: #fff;
}
.acc-btn--brand:hover { background: var(--tpm-blue-dark); }

.acc-actions__date {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--tpm-text-faint);
  text-align: right;
  line-height: 1.4;
}
.acc-actions__date strong { color: var(--tpm-text-muted); font-weight: 500; }

/* ---------- 7. CATEGORÍAS COMPACT INDEX (top-ventas) ----- */
.acc-catindex {
  background: var(--tpm-surface);
  border: 1px solid var(--tpm-border);
  border-radius: var(--tpm-radius);
  padding: 22px 26px;
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: start;
}
.acc-catindex__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tpm-text-muted);
  margin: 0;
  padding-top: 2px;
}
.acc-catindex__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 24px;
}
.acc-catindex__list a {
  font-size: 13px;
  color: var(--tpm-blue-dark);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.acc-catindex__list a:hover {
  color: var(--tpm-blue);
  border-bottom-color: var(--tpm-blue-soft-br);
}
body.dark-mode .acc-catindex__list a,
.dark-mode .acc-catindex__list a { color: var(--tpm-blue); }

/* ---------- 8. SECCIÓN POR CATEGORÍA (top-ventas) -------- */
.acc-catblock {
  margin-top: 56px;
}
.acc-catblock:first-of-type { margin-top: 0; }
.acc-catblock__head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tpm-border);
}
.acc-catblock__title {
  font-family: 'Source Serif 4', 'Roboto', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tpm-text);
  margin: 0;
}
.acc-catblock__title em {
  font-style: normal;
  color: var(--tpm-blue-dark);
}
body.dark-mode .acc-catblock__title em,
.dark-mode .acc-catblock__title em { color: var(--tpm-blue); }
.acc-catblock__more {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tpm-blue-dark);
  text-decoration: none;
  white-space: nowrap;
}
.acc-catblock__more:hover { color: var(--tpm-blue); text-decoration: underline; text-underline-offset: 2px; }
.acc-catblock__more svg { width: 10px; height: 10px; }
body.dark-mode .acc-catblock__more,
.dark-mode .acc-catblock__more { color: var(--tpm-blue); }
.acc-catblock__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

/* ---------- 9. EMPTY STATES & EXTRAS --------------------- */
.acc-empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--tpm-surface);
  border: 1px dashed var(--tpm-border-strong);
  border-radius: var(--tpm-radius);
  color: var(--tpm-text-muted);
  font-size: 14px;
}
.acc-empty strong { color: var(--tpm-text); }

/* ---------- 10. RESPONSIVE ------------------------------- */
@media (max-width: 980px) {
  .acc-catblock__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 880px) {
  .acc-hero { padding: 40px 20px 32px; }
  .acc-hero__title { font-size: 26px; gap: 14px; }
  .acc-hero__title::before, .acc-hero__title::after { max-width: 40px; }
  .acc-hero__sub { font-size: 14.5px; }
  .acc-page { padding: 32px 20px 48px; }
  .acc-row {
    grid-template-columns: 64px 1fr;
    gap: 14px 16px;
    padding: 18px 0;
  }
  .acc-row__img { width: 64px; height: 64px; }
  .acc-price { grid-column: 1 / -1; min-width: 0; }
  .acc-actions { grid-column: 1 / -1; min-width: 0; }
  .acc-actions__date { text-align: left; }
  .acc-catindex { grid-template-columns: 1fr; gap: 12px; padding: 18px 20px; }
  .acc-catindex__list { grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
  .acc-catblock__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .acc-catblock__head { flex-wrap: wrap; }
  .acc-section__head { flex-wrap: wrap; }
  .acc-section__actions { width: 100%; margin-left: 0; }
}
