/* =========================================================
   VARIABLES BASE / ROOT
========================================================= */
:root {
  --brand: #1a3cff;
  --bg: #ffffff;
  --text: #0b1324;
  --muted: #5b667a;
  --card: #f6f8fb;
  --surface: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 24px rgba(16,24,40,.08);
  --scale: 1;
  --font: calc(18px * var(--scale));
  --maxw: 1200px;
}

html[data-theme="contrast"] {
  --bg: #fff;
  --text: #000;
  --card: #fff;
}

/* =========================================================
   RESET Y BASE
========================================================= */
* { box-sizing:border-box; }

body {
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  font-size: var(--font);
  line-height: 1.6;
}

a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px;
}

.sr-only {
  position:absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.mt-24 { margin-top:24px; }
.mt-32 { margin-top:32px; }
.mt-16 { margin-top:16px; }

.grid { display:grid; gap:16px; }
.grid--2 { grid-template-columns:1fr 1fr; }
.grid--3 { grid-template-columns:repeat(3,minmax(0,1fr)); }

@media (max-width:960px){ .grid--3{ grid-template-columns:1fr 1fr; } }
@media (max-width:640px){
  .grid--3{ grid-template-columns:1fr; }
  .grid--2{ grid-template-columns:1fr; }
}

/* =========================================================
   TARJETAS Y ELEMENTOS
========================================================= */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.tap {
  min-height:44px;
  min-width:44px;
  padding:12px 16px;
  border-radius:12px;
}

/* =========================================================
   HEADER
========================================================= */
.header {
  position:sticky;
  top:0;
  z-index:50;
  background:var(--surface);
  border-bottom:1px solid rgba(0,0,0,.06);
}

.header__bar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Marca */
.brand {
  position:relative; display:flex; align-items:center; gap:10px;
}

.brand__logo {
  width:36px; height:36px;
  border-radius:10px;
  background:var(--brand); color:#fff;
  display:grid; place-items:center;
  font-weight:800;
  box-shadow:0 6px 18px rgba(26,60,255,.35);
}

.brand__name { font-weight:800; letter-spacing:.2px; position:relative; z-index:1; }
.brand__word { position:relative; z-index:2; }

.brand__glass {
  position:absolute;
  left:-12px; top:-20px;
  width:96px; height:96px;
  opacity:.10;
  color:var(--brand);
  pointer-events:none;
}

/* Navegación */
.nav { display:flex; gap:8px; }
.nav__link { padding:10px 14px; border-radius:12px; }

/* Herramientas */
.tools {
  display:flex; gap:8px; align-items:center;
  flex-wrap:wrap; justify-content:flex-end;
}

.tools__btn, .tools__select {
  background:var(--card);
  border:1px solid transparent;
  border-radius:12px;
}

.tools__select { padding:10px 14px; }
.tools__btn-ico { display:none; }

@media (max-width:520px){
  .tools__btn-label{ display:none; }
  .tools__btn-ico{ display:inline; }
}

/* Drawer móvil */
.header__menu { display:none; }
.drawer { display:none; }

@media (max-width:840px){
  .nav{ display:none; }
  .header__menu{ display:inline-flex; }

  .drawer{
    position:fixed; inset:0 0 0 35%;
    background:var(--surface);
    transform:translateX(100%);
    transition:.25s ease;
    box-shadow:-20px 0 40px rgba(0,0,0,.25);
  }

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

  .drawer__nav{
    display:grid; gap:8px; padding:20px;
  }
}

/* =========================================================
   HERO
========================================================= */
.hero { padding:28px 0 16px; }
.hero--center .hero__title, .hero--center .hero__subtitle {
  text-align:center;
}

/* =========================================================
   BÚSQUEDA
========================================================= */

.search{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  background:var(--surface);
  border-radius:16px;
  padding:8px;
  box-shadow:var(--shadow);
}

.search__input{
  border:0; background:transparent; color:inherit; padding:14px;
}

.search__btn{
  background:var(--brand);
  color:#fff; border-radius:12px;
  font-weight:700;
}

/* Chips */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.chip{
  background:var(--card);
  border-radius:999px;
  padding:10px 14px;
}

/* =========================================================
   FOOTER
========================================================= */
.footer{
  border-top:1px solid rgba(0,0,0,.06);
  margin-top:40px;
  padding:32px 0 56px;
  background:var(--surface);
}

.footer__grid{
  display:grid;
  gap:24px;
  grid-template-columns:2fr 1fr 1fr;
}

.footer__title{ font-weight:800; }
@media (max-width:840px){ .footer__grid{ grid-template-columns:1fr; } }

.social{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; line-height:0; }
.social__link{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:999px;
  background:var(--card);
  box-shadow:var(--shadow);
}

.btn{
  display:inline-block;
  padding:12px 16px;
  border-radius:12px;
  font-weight:700;
}

.btn--donate{
  background:var(--brand);
  color:#fff;
  box-shadow:var(--shadow);
}

.btn--login{
  background:var(--card);
  color:var(--brand);
  border:1.5px solid var(--brand);
  box-shadow:var(--shadow);
}

/* =========================================================
   HISTORIAL (nuevo)
========================================================= */

.history__layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

@media (max-width:900px){
  .history__layout { grid-template-columns:1fr; }
}

.history__sidebar {
  background: var(--surface);
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.history__search input {
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.12);
}

.history__list {
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.history-item {
  background:var(--card);
  border-radius:12px;
  border:1px solid rgba(0,0,0,.06);
  padding:12px;
  text-align:left;
}

.history-item__meta {
  font-size:0.85rem;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
}

.history__detail {
  background: var(--surface);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* =========================================================
   ZONA PRIVADA / MI CUENTA (nuevo)
========================================================= */
.card--summary {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  padding: 20px 20px 24px;
}

.card--summary h2 { margin-top:0; margin-bottom:4px; }
.card--summary p { margin:4px 0; }

.summary__actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}

.btn--ghost {
  background:transparent;
  border:1px solid rgba(15,23,42,0.15);
  color:var(--text);
}

body[data-page="privado"] .hero--center .hero__title {
  font-size:1.6rem;
}

body[data-page="privado"] .hero--center .hero__subtitle {
  max-width:640px;
  margin:0 auto;
  color:var(--muted);
  font-size:0.95rem;
}
