/* ===== Mi Compra Pro – Estilos completos ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1a1a2e;
  background: #f4f5f9;
  line-height: 1.6;
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 640px; }

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #e4e7ef;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
}
.logo-mark {
  background: #b08a28;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.logo-text span { color: #b08a28; }

.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  transition: all .15s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: #182235; background: #eef0f6; }
.nav-link.btn-nav {
  background: #b08a28;
  color: #fff !important;
  margin-left: 4px;
}
.nav-link.btn-nav:hover { background: #967420; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #182235;
}

/* Hero */
.hero {
  background: linear-gradient(145deg, #182235 0%, #2a3c58 100%);
  color: #fff;
  padding: 60px 0 70px;
}
.hero-content { max-width: 620px; }
.badge {
  display: inline-block;
  background: rgba(176,138,40,.25);
  color: #e8c96a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 14px;
}
.hero-text {
  font-size: 16px;
  color: #b0bac8;
  margin-bottom: 26px;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn-primary { background: #b08a28; color: #fff; }
.btn-primary:hover { background: #967420; }
.btn-secondary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.btn-secondary:hover { background: rgba(255,255,255,.2); }
.btn-outline {
  background: transparent;
  border: 1.5px solid #d0d5e0;
  color: #182235;
}
.btn-outline:hover { border-color: #b08a28; color: #b08a28; }
.btn-danger:hover { border-color: #c0392b; color: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; }

/* Sections */
.section { padding: 50px 0; }
.section-alt { background: #fff; }
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #182235;
  text-align: center;
  margin-bottom: 28px;
}
.page-header { text-align: center; margin-bottom: 28px; }
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #182235;
  margin: 8px 0 8px;
}
.page-header p { color: #666; max-width: 520px; margin: 0 auto; font-size: 15px; }

/* Stats */
.stats-section { padding: 30px 0; margin-top: -36px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
.stat-value { font-size: 22px; font-weight: 700; color: #182235; }
.stat-label { font-size: 12px; color: #777; margin-top: 3px; }

/* Grid cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  padding: 22px 18px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.card-icon { font-size: 24px; margin-bottom: 10px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: #182235; }
.card p { font-size: 13px; color: #666; line-height: 1.5; }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step { text-align: center; }
.step-num {
  display: inline-flex;
  width: 40px;
  height: 40px;
  background: #b08a28;
  color: #fff;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}
.step h3 { font-size: 15px; margin-bottom: 5px; color: #182235; }
.step p { font-size: 13px; color: #666; }

/* CTA */
.cta {
  background: #182235;
  color: #fff;
  text-align: center;
  padding: 50px 0;
}
.cta h2 { font-size: 24px; margin-bottom: 8px; }
.cta p { color: #9aa8bc; margin-bottom: 22px; font-size: 15px; }

/* Forms */
.form-card {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 3px 14px rgba(0,0,0,.04);
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d3d7e2;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  background: #fff;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #b08a28;
  box-shadow: 0 0 0 3px rgba(176,138,40,.12);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #b08a28;
}

.success-message {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 14px;
  padding: 40px 28px;
  text-align: center;
}
.success-icon {
  width: 56px;
  height: 56px;
  background: #e6f7ed;
  color: #1a9a4a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 16px;
}
.success-message h2 { font-size: 19px; color: #182235; margin-bottom: 6px; }
.success-message p { color: #666; font-size: 14px; }

/* Lista */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-input {
  flex: 1;
  min-width: 180px;
  padding: 9px 12px;
  border: 1.5px solid #d3d7e2;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
}
.filter-select {
  padding: 9px 12px;
  border: 1.5px solid #d3d7e2;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

.lista-compras { display: flex; flex-direction: column; gap: 12px; }
.compra-card {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  padding: 16px 18px;
  transition: box-shadow .15s;
}
.compra-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.compra-card.importante { border-left: 4px solid #b08a28; }
.compra-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.compra-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #182235;
  margin-bottom: 3px;
}
.compra-meta {
  font-size: 12px;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  align-items: center;
}
.tag-cat {
  background: #eef0f6;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  color: #555;
}
.compra-ticket { font-size: 12px; color: #555; margin-top: 5px; }
.compra-importe {
  font-size: 16px;
  font-weight: 700;
  color: #182235;
  white-space: nowrap;
}
.compra-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.garantia-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  margin-top: 6px;
}
.garantia-badge.activa { background: #e6f7ed; color: #1a7a3a; }
.garantia-badge.proxima { background: #fff4e0; color: #b36b00; }
.garantia-badge.caducada { background: #fdecea; color: #c0392b; }

/* Empty */
.empty-state {
  text-align: center;
  padding: 44px 18px;
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 14px;
}
.empty-icon { font-size: 38px; margin-bottom: 12px; }
.empty-state h3 { font-size: 17px; color: #182235; margin-bottom: 6px; }
.empty-state p { color: #666; margin-bottom: 18px; font-size: 14px; }

/* Profiles */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.profile-card {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  padding: 18px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 8px;
}
.avatar {
  width: 40px;
  height: 40px;
  background: #b08a28;
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.profile-header h3 { font-size: 15px; font-weight: 600; color: #182235; }
.profile-url { font-size: 12px; color: #b08a28; }
.profile-desc { font-size: 13px; color: #555; margin-bottom: 3px; }

.actions-bar { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
}
.modal h2 { font-size: 18px; margin-bottom: 14px; color: #182235; padding-right: 28px; }
.detalle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.detalle-grid strong { display: block; font-size: 11px; color: #888; margin-bottom: 2px; }
.detalle-notas { font-size: 13px; color: #555; margin-bottom: 14px; }
.share-box label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}
.share-box textarea {
  width: 100%;
  padding: 10px;
  border: 1.5px solid #d3d7e2;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  margin-bottom: 10px;
  resize: vertical;
}

/* Alerts */
.alert {
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-warn {
  background: #fff8e6;
  border: 1px solid #f0d78c;
  color: #7a5a00;
}

/* Stats page */
.cat-bars { margin-top: 20px; }
.cat-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.cat-bar-label { width: 110px; flex-shrink: 0; color: #555; }
.cat-bar-track {
  flex: 1;
  height: 10px;
  background: #eef0f6;
  border-radius: 5px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  background: #b08a28;
  border-radius: 5px;
}
.cat-bar-value { width: 80px; text-align: right; font-weight: 600; color: #182235; }

/* Deseos / Presupuestos cards */
.item-card {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.item-card h3 { font-size: 15px; font-weight: 600; color: #182235; margin-bottom: 3px; }
.item-meta { font-size: 12px; color: #777; }
.item-precio { font-size: 15px; font-weight: 700; color: #182235; white-space: nowrap; }

/* Backup box */
.backup-box {
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  padding: 20px;
  margin-top: 28px;
}
.backup-box h3 { font-size: 15px; margin-bottom: 8px; color: #182235; }
.backup-box p { font-size: 13px; color: #666; margin-bottom: 14px; }

/* Footer */
.footer {
  background: #111827;
  color: #9ca3af;
  padding: 24px 0;
  font-size: 12px;
  margin-top: 30px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.footer strong { color: #fff; display: block; margin-bottom: 2px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a:hover { color: #fff; }
.footer-copy { color: #6b7280; font-size: 11px; }

/* Responsive */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
  .profiles-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}
@media (max-width: 700px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e4e7ef;
    padding: 10px;
    gap: 2px;
  }
  .menu-toggle { display: block; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 0 50px; }
  .hero h1 { font-size: 22px; }
  .section { padding: 36px 0; }
  .form-card { padding: 20px; }
  .compra-main { flex-direction: column; }
  .nav-link { font-size: 14px; padding: 8px 12px; }
}

/* Cookie banner */
#cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #182235;
  color: #e5e7eb;
  padding: 16px 20px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.25);
  font-size: 13px;
  line-height: 1.5;
}
#cookieBanner .cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
#cookieBanner .cookie-text {
  flex: 1;
  min-width: 240px;
  margin: 0;
}
#cookieBanner .cookie-text a {
  color: #e8c96a;
  font-weight: 600;
  text-decoration: underline;
}
#cookieBanner .cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
#cookieBanner .btn-outline {
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
#cookieBanner .btn-outline:hover {
  border-color: #e8c96a;
  color: #e8c96a;
}
@media (max-width: 600px) {
  #cookieBanner .cookie-inner { flex-direction: column; align-items: stretch; }
  #cookieBanner .cookie-actions { width: 100%; }
  #cookieBanner .cookie-actions .btn { flex: 1; }
}
