:root {
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #40916c;
  --accent: #f4a261;
  --danger: #e76f51;
  --warning: #e9c46a;
  --success: #2a9d8f;
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6c757d;
  --border: #e9ecef;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 2px;
}

.btn-icon {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-icon:hover, .btn-icon:active {
  background: rgba(255,255,255,0.35);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 16px 8px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card.urgent .stat-number {
  color: var(--danger);
}

.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Product List */
.product-list {
  padding: 8px 16px 100px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  border-left: 5px solid var(--success);
  transition: transform 0.15s;
}

.product-card:active {
  transform: scale(0.98);
}

.product-card.urgent {
  border-left-color: var(--danger);
}

.product-card.warning {
  border-left-color: var(--warning);
}

.product-card.expired {
  border-left-color: #999;
  opacity: 0.7;
}

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

.product-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 4px;
  word-break: break-word;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-ok { background: #d8f3dc; color: #1b4332; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-urgent { background: #fee2e2; color: #991b1b; }
.badge-expired { background: #e5e7eb; color: #4b5563; }

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-action {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
}

.btn-action:hover { opacity: 1; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  line-height: 1;
}

.empty-state h2 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 2rem;
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.4);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

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

.fab:hover {
  background: var(--primary-dark);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.25rem;
}

.btn-close {
  background: var(--bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Form */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--bg);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.date-input-group {
  display: flex;
  gap: 10px;
}

.date-input-group input {
  flex: 1;
}

.help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.photo-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.photo-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.ocr-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 8px 12px;
  font-size: 0.85rem;
  text-align: center;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary, .btn-secondary {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}

/* Invite Modal */
.invite-modal {
  padding-bottom: 32px;
}

.invite-text {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.invite-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}

.invite-card:hover {
  border-color: var(--primary);
  background: #f0f7f4;
}

.invite-card.affiliate {
  cursor: default;
  flex-direction: column;
}

.invite-card.affiliate:hover {
  background: var(--bg);
  border-color: var(--border);
}

.invite-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.invite-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

.invite-card small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.affiliate-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.btn-affiliate {
  display: block;
  background: #ff9900;
  color: #111;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: background 0.2s;
}

.btn-affiliate:hover {
  background: #e68a00;
}

.invite-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: center;
  line-height: 1.4;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

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

/* Responsive */
@media (min-width: 600px) {
  .modal {
    align-items: center;
    padding: 20px;
  }
  .modal-content {
    border-radius: var(--radius);
    max-height: 85vh;
  }
  .header {
    border-radius: 0 0 20px 20px;
  }
}

/* Header actions */
.header-actions {
  display: flex;
  gap: 8px;
}

/* Form row (quantity + unit) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Footer */
.footer {
  padding: 24px 16px 100px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.disclaimer-short {
  margin-bottom: 12px;
  line-height: 1.4;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-btn.inline {
  display: inline;
  font-size: inherit;
}

.company {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Exit modal */
.exit-modal .exit-body {
  text-align: center;
}

.exit-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.exit-affiliate {
  margin: 16px 0;
}

.exit-affiliate .small {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
  text-decoration: underline;
}

/* Legal modals */
.legal-modal {
  max-height: 85vh;
}

.legal-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.legal-body p {
  margin-bottom: 12px;
}

.legal-body ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-body li {
  margin-bottom: 8px;
}

.legal-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 20px;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 72px;
  left: 10px;
  right: 10px;
  background: var(--primary-dark);
  color: white;
  z-index: 998;
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cookie-content {
  max-width: 600px;
  margin: 0 auto;
}

.cookie-content p {
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.cookie-content .link-btn {
  color: #a7f3d0;
}

.cookie-actions {
  display: flex;
  gap: 10px;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.cookie-actions .btn-primary,
.cookie-actions .btn-primary.btn-sm,
#btn-accept-cookies {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--primary-dark) !important;
  box-shadow: none !important;
  border: none !important;
}
.cookie-actions .btn-primary:hover,
#btn-accept-cookies:hover {
  background: #f0f7f4 !important;
  background-image: none !important;
}

.cookie-actions .btn-secondary {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: white;
}

/* Quantity badge on product card */
.qty-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Amazon disclosure */
.amazon-disclosure {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: 12px;
}

.footer-amazon {
  margin: 8px auto 12px;
  max-width: 420px;
}

/* App links (food waste apps) */
.btn-app {
  display: block;
  background: #1b4332;
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: background 0.2s;
}

.btn-app:hover {
  background: #2d6a4f;
}

.apps-waste .affiliate-links {
  margin-top: 10px;
}

/* SEO content section */
.seo-content {
  padding: 32px 16px 24px;
  max-width: 720px;
  margin: 0 auto;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: #f1f5f3;
}

.seo-content article {
  margin-bottom: 28px;
}

.seo-content h2 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
  line-height: 1.35;
}

.seo-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 10px;
}

.seo-content ul {
  padding-left: 1.2rem;
  margin: 10px 0 12px;
}

.seo-content li {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 8px;
  color: #333;
}

.seo-content strong {
  color: var(--primary-dark);
}

/* FAQ dentro de SEO */
.faq-item {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

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

.faq-item h3 {
  font-size: 0.98rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
  line-height: 1.35;
}

.faq-item p {
  margin-bottom: 0;
}

/* ========== Views & Bottom Nav ========== */
.app-view {
  display: none;
  animation: fadeView 0.25s ease;
}

.app-view.active {
  display: block;
}

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

body {
  padding-bottom: 88px;
}

.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  min-height: 64px !important;
  height: 64px !important;
  background: #ffffff !important;
  border-top: 1px solid #d1d5db !important;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  z-index: 999 !important;
  padding: 0 4px !important;
  padding-bottom: 0 !important;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.2s;
  border-radius: 12px;
  max-width: 90px;
}

.nav-item .nav-icon {
  font-size: 1.25rem;
  line-height: 1.2;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item:active {
  background: rgba(45, 106, 79, 0.08);
}

.nav-share .nav-icon {
  background: var(--primary);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 2px;
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.35);
}

.nav-share {
  color: var(--primary);
  font-weight: 600;
}

/* FAB above bottom nav */
.fab {
  bottom: 80px;
}

/* Home footer note */
.home-footer-note {
  text-align: center;
  padding: 16px 24px 100px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Guide view */
.guide-hero {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.guide-title {
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.guide-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.seo-content {
  padding-bottom: 100px;
}

.guide-footer {
  padding-bottom: 40px;
}

/* ========== Share modal ========== */
.share-modal, .more-modal {
  border-radius: 24px 24px 0 0;
  padding-top: 12px;
}

.share-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 12px;
}

.share-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.share-btn:hover, .share-btn:active {
  border-color: var(--primary);
  background: #f0f7f4;
  transform: translateY(-2px);
}

.share-btn-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.share-install-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* More modal */
.more-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.more-item:hover {
  border-color: var(--primary);
  background: #f0f7f4;
}

.more-item span:first-child {
  font-size: 1.4rem;
}

.more-item strong {
  display: block;
  font-size: 0.95rem;
}

.more-item small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.more-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: center;
  line-height: 1.4;
}

/* Product list padding for nav */
.product-list {
  padding-bottom: 24px;
}

/* Toast above nav */
.toast {
  bottom: 90px;
}

/* Search & tools */
.search-bar {
  padding: 0 16px 8px;
}
.search-bar input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--card);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}
.quick-tools {
  display: flex;
  gap: 8px;
  padding: 0 16px 8px;
}
.tool-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}
.tool-btn:active {
  background: #e8f5e9;
  color: var(--primary);
}
.product-actions {
  flex-wrap: wrap;
  max-width: 72px;
}

/* Modal sections & chips */
.modal-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.modal-section-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}
.link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}
.chip-app { background: #1b4332; }
.chip-amz { background: #ff9900; color: #111; }
.tiny { font-size: 0.72rem; margin-top: 8px; line-height: 1.4; color: var(--text-muted); }

/* Exit modal improved */
.exit-modal {
  position: relative;
  padding-top: 12px;
  max-height: 92vh;
  overflow-y: auto;
}
.exit-hero {
  text-align: center;
  margin-bottom: 16px;
}
.exit-emoji { font-size: 2.5rem; margin-bottom: 8px; }
.exit-hero h2 {
  font-size: 1.35rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.exit-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}
.exit-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.exit-actions .btn-primary,
.exit-actions .btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
}
.btn-b2b {
  border-color: var(--primary) !important;
  color: var(--primary-dark) !important;
}
.exit-close-abs {
  position: absolute;
  top: 12px;
  right: 12px;
}
.exit-modal .btn-text {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  margin-bottom: 8px;
}

/* B2B modal */
.b2b-modal { /* height controlled in #modal-b2b .b2b-modal */ }
.b2b-lead { margin-bottom: 14px; font-size: 0.95rem; line-height: 1.5; }
.b2b-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.b2b-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--primary-dark); }
.b2b-card ul { padding-left: 1.1rem; margin: 0; }
.b2b-card li { font-size: 0.9rem; margin-bottom: 6px; line-height: 1.45; }
.b2b-card code {
  background: #e8f5e9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.b2b-preview {
  margin: 14px 0;
  padding: 14px;
  border: 1.5px dashed var(--primary-light);
  border-radius: 12px;
}
.b2b-preview label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.b2b-preview input {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 10px;
}
.b2b-url-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.b2b-url-preview strong { color: var(--primary-dark); word-break: break-all; }
.b2b-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
}

/* Partner banner */
.partner-banner {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 120;
}
.partner-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
}
.partner-banner .btn-sm {
  background: #fff;
  color: var(--primary-dark);
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Invite cards clickable */
button.invite-card {
  cursor: pointer;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
button.invite-card:active {
  transform: scale(0.98);
  background: #e8f5e9;
}
#modal-share.show {
  display: flex !important;
  z-index: 600 !important;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: #2d6a4f;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.b2b-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 14px 0 12px;
  cursor: pointer;
}
.b2b-consent input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.b2b-cta-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* B2B modal full scroll (mobile-safe) */
#modal-b2b {
  align-items: flex-end;
  z-index: 2000;
  padding-bottom: 0;
}
#modal-b2b .b2b-modal {
  width: 100%;
  max-width: 500px;
  max-height: 92dvh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 20px 0;
  border-radius: 20px 20px 0 0;
  -webkit-overflow-scrolling: touch;
}
#modal-b2b .share-handle {
  flex-shrink: 0;
}
#modal-b2b .modal-header {
  position: relative;
  flex-shrink: 0;
  background: var(--card);
  z-index: 2;
  padding-bottom: 8px;
  margin-bottom: 0;
}
#modal-b2b .b2b-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  min-height: 0;
}
.b2b-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 400px) {
  .b2b-product-grid { grid-template-columns: 1fr; }
}
.b2b-prod {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.b2b-prod input {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
}
.b2b-prod input:focus {
  outline: none;
  border-color: var(--primary);
}

#modal-add {
  z-index: 2000;
  align-items: flex-end;
}
#modal-add .modal-add-content {
  width: 100%;
  max-width: 500px;
  max-height: min(92dvh, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 16px 0;
  -webkit-overflow-scrolling: touch;
}
#modal-add .modal-header {
  flex-shrink: 0;
  background: var(--card);
  z-index: 2;
  padding-bottom: 8px;
}
#modal-add .form-product {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#modal-add .modal-add-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 12px;
}
#modal-add .form-actions {
  flex-shrink: 0;
  position: relative;
  display: flex;
  gap: 10px;
  background: var(--card);
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  margin: 0;
  z-index: 3;
}
#modal-add .form-actions .btn-secondary,
#modal-add .form-actions .btn-primary {
  flex: 1;
  min-height: 48px;
}
.btn-install-block {
  display: block !important;
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  font-weight: 700;
}
.notif-consent-block {
  background: #f0f7f4;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #c8ddd0;
}

/* Guide TOC */
.guide-toc {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.guide-toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.guide-toc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 480px) {
  .guide-toc-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.guide-toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.guide-toc-item:active,
.guide-toc-item:hover {
  border-color: var(--primary);
  background: #e8f5e9;
  color: var(--primary-dark);
}
.guide-toc-item span {
  font-size: 1.1rem;
  line-height: 1;
}
.seo-content {
  scroll-behavior: smooth;
}
.seo-content article {
  scroll-margin-top: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.seo-content article:last-of-type {
  border-bottom: none;
}
.seo-content h2 {
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--primary-dark);
}

.b2b-minimo {
  background: #e8f5e9 !important;
  border-color: #2d6a4f !important;
}
.b2b-minimo h3 { color: #1b4332; }
.b2b-minimo p { font-size: 0.92rem; margin-bottom: 8px; color: var(--text); }

.notif-install-tip {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e7;
  border: 1px solid #f0d78c;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #5c4a1a;
}
.notif-install-tip strong { color: #3d3212; }

.daily-reminder-tip {
  margin-top: 12px;
  padding: 12px 12px 10px;
  background: #eef6ff;
  border: 1px solid #b6d4f0;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e3a5f;
}
.daily-reminder-tip strong { color: #0f2744; }
.daily-reminder-tip em { font-style: italic; }
.daily-reminder-steps {
  margin: 0 0 10px 1.1em;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}
.daily-reminder-steps li { margin-bottom: 4px; }
.stale-open-banner {
  background: #e0f2fe;
  border-bottom: 2px solid #38bdf8;
  color: #0c4a6e;
  z-index: 240;
  position: sticky;
  top: 0;
}
.stale-open-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  max-width: 560px;
  margin: 0 auto;
}
.stale-open-text { flex: 1; font-size: 0.88rem; line-height: 1.35; }
.stale-open-btn {
  flex-shrink: 0;
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
[data-theme="dark"] .daily-reminder-tip {
  background: #1a2a3a;
  border-color: #2a4a6a;
  color: #c8dff0;
}
[data-theme="dark"] .daily-reminder-tip strong { color: #e8f4ff; }
[data-theme="dark"] .stale-open-banner {
  background: #0c4a6e;
  border-bottom-color: #38bdf8;
  color: #e0f2fe;
}


.b2b-q select, .b2b-q input[type="text"] {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  width: 100%;
  background: #fff;
  margin-top: 4px;
}
.b2b-q { margin-bottom: 12px; }
.b2b-extra-fields { margin-top: 8px; }

.expiry-alert-banner {
  background: #fff3cd;
  border-bottom: 2px solid #f0ad4e;
  color: #5c4a00;
  z-index: 250;
  position: sticky;
  top: 0;
}
.expiry-alert-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  max-width: 560px;
  margin: 0 auto;
}
.expiry-alert-ico { font-size: 1.2rem; flex-shrink: 0; }
.expiry-alert-text { flex: 1; font-size: 0.9rem; line-height: 1.35; }
.expiry-alert-btn {
  flex-shrink: 0;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Lista de la compra */
#view-lista {
  padding-bottom: 24px;
}
.lista-header-block {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.lista-title {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.lista-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.lista-search {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 10px;
}
.lista-actions {
  display: flex;
  gap: 8px;
}
.lista-actions .btn-primary,
.lista-actions .btn-secondary {
  flex: 1;
  min-height: 44px;
  font-size: 0.9rem;
}
.lista-compra-root {
  padding-bottom: 16px;
}
.lista-cat {
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.lista-cat-title {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lista-cat-title::-webkit-details-marker { display: none; }
.lista-items {
  padding: 0 8px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}
@media (max-width: 380px) {
  .lista-items { grid-template-columns: 1fr; }
}
.lista-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 6px;
  font-size: 0.88rem;
  border-radius: 8px;
  cursor: pointer;
}
.lista-item input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.lista-item.is-checked {
  background: #e8f5e9;
  font-weight: 600;
  color: var(--primary-dark);
}
.lista-footer-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 8px 80px;
}
/* 5 nav items */
.bottom-nav {
  justify-content: space-around;
}
.bottom-nav .nav-item {
  flex: 1;
  min-width: 0;
  padding: 6px 2px;
}
.bottom-nav .nav-label {
  font-size: 0.65rem;
}

/* Donar comida */
.donar-hero h2 { color: var(--primary-dark); margin-bottom: 8px; }
.donar-hero p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 8px; }
.donar-filters {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  margin: 14px 0;
}
.donar-filters h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin: 12px 0 10px;
}
.donar-filters h3:first-child { margin-top: 0; }
.donar-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 400px) {
  .donar-types { grid-template-columns: 1fr; }
}
.donar-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.donar-check:has(input:checked) {
  border-color: var(--primary);
  background: #e8f5e9;
  font-weight: 600;
}
.donar-check input { width: 18px; height: 18px; }
.donar-loc-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.donar-loc-row input {
  flex: 1 1 180px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
}
.donar-loc-row .btn-primary {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 18px;
}
.donar-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 8px 0 12px;
}
.donar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.donar-card h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.donar-loc, .donar-addr {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.donar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.donar-tag {
  font-size: 0.72rem;
  background: #eef2f0;
  color: #445;
  padding: 4px 8px;
  border-radius: 999px;
}
.donar-tag.on {
  background: #c8e6c9;
  color: var(--primary-dark);
  font-weight: 600;
}
.donar-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.donar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.donar-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
}

.donar-google-block {
  margin: 16px 0;
}
.donar-google-block h3,
.donar-local-block h3,
.donar-ahorro h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.donar-google-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.donar-google-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.donar-google-btn.is-maps {
  border-color: #2d6a4f;
  background: #e8f5e9;
}
.donar-google-btn:active {
  transform: scale(0.99);
}
.donar-g-ico { font-size: 1.2rem; }
.donar-g-go {
  margin-left: auto;
  color: var(--primary);
  font-size: 0.85rem;
}
.donar-ahorro {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  margin: 20px 0 12px;
}
.donar-tips {
  padding-left: 1.2rem;
  margin: 8px 0 0;
}
.donar-tips li {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.donar-tips strong { color: var(--text); }
button.chip {
  font: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #f5f7f6;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.lista-add-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.lista-add-row input {
  flex: 1;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
}
.lista-add-row .btn-secondary {
  flex-shrink: 0;
  min-height: 44px;
  white-space: nowrap;
}
.lista-cat-custom {
  border-color: #2d6a4f;
  background: #f3faf6;
}
.lista-custom-empty {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px;
}
.lista-item {
  position: relative;
  padding-right: 28px;
}
.lista-custom-del {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #c0392b;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.lista-custom-del:active {
  background: #fdecea;
}

.lista-amazon-block {
  margin-top: 12px;
  padding: 12px;
  background: #fff8f0;
  border: 1px solid #f0d9b5;
  border-radius: 12px;
}
.lista-amazon-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #5c3d0a;
  margin-bottom: 4px;
}
.lista-amazon-note {
  margin-bottom: 10px !important;
}
.lista-amazon-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lista-amz-btn {
  display: block;
  text-align: center;
  padding: 12px 14px;
  background: #232f3e;
  color: #fff !important;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
}
.lista-amz-btn:nth-child(2) { background: #1a7a3a; }
.lista-amz-btn:nth-child(3) { background: #37475a; }
.lista-amz-disc {
  margin-top: 10px;
  text-align: left;
  color: #6b5a3e;
}

/* Comprar view */
.comprar-hero h2 { color: var(--primary-dark); margin-bottom: 6px; }
.comprar-hero p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 12px; }
.comprar-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.comprar-section h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.comprar-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.comprar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.comprar-chip {
  display: inline-block;
  padding: 10px 12px;
  background: #e8f5e9;
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #c8e6c9;
}
.comprar-chip-app {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0d47a1;
}
.comprar-disc {
  padding: 8px 4px 90px;
  text-align: left;
}
.bottom-nav .nav-label {
  font-size: 0.6rem;
}
.bottom-nav .nav-icon {
  font-size: 1.15rem;
}

.more-temas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.more-tema {
  display: block;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.more-tema:active {
  background: #e8f5e9;
  border-color: var(--primary);
}
.chip-amz {
  background: #ff9900 !important;
  color: #111 !important;
  border-color: #e47911 !important;
  font-weight: 700;
}
.btn-affiliate {
  background: #ff9900 !important;
  color: #111 !important;
  border: none;
  font-weight: 700;
}

/* Exit modal: móvil hoja inferior + escritorio centrado */
#modal-exit {
  z-index: 2100;
  align-items: flex-end;
  padding: 0;
}
#modal-exit .exit-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(90dvh, 90vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  border-radius: 20px 20px 0 0;
}
@media (min-width: 768px) {
  #modal-exit {
    align-items: center;
    padding: 24px;
  }
  #modal-exit .exit-modal {
    border-radius: 20px;
    max-height: min(85vh, 640px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  }
  #modal-exit .share-handle { display: none; }
}
#modal-exit .exit-actions .btn-primary,
#modal-exit .exit-actions .btn-secondary {
  min-height: 48px;
}
#modal-exit .btn-text {
  min-height: 44px;
}

/* Coste oculto / energía (secundario) */
.energia-sec {
  margin: 28px 0 40px;
  padding: 20px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  scroll-margin-top: 12px;
}
.energia-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b5a3e;
  background: #fff8e7;
  border: 1px solid #f0d9b5;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.energia-title {
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.energia-lead, .energia-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.energia-chain {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.energia-chain li {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}
.energia-calc {
  background: #e8f5e9;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.energia-calc-title {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.energia-calc ul {
  padding-left: 1.2rem;
  margin-bottom: 8px;
}
.energia-calc li {
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.energia-box {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  margin-top: 8px;
}
.energia-box-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 6px;
}
.energia-box h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
}
.energia-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  min-height: 44px;
  padding: 12px 16px;
  text-decoration: none;
}
.energia-strip h3 {
  font-size: 1rem;
  margin: 4px 0 8px;
}

.energia-form {
  margin-top: 8px;
  text-align: left;
}
.energia-form .fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.energia-form .fld input {
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
}
.energia-consent {
  margin: 12px 0;
  font-size: 0.82rem;
  text-align: left;
}
.energia-cta-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
.energia-form .btn-primary {
  display: flex;
  width: 100%;
  text-align: center;
  justify-content: center;
  text-decoration: none;
}

/* ========== Design refresh 2026 ========== */
:root {
  --primary: #1f7a54;
  --primary-dark: #0f3d2e;
  --primary-light: #2d9b6c;
  --accent: #f4a261;
  --bg: #f0f4f2;
  --card: #ffffff;
  --text: #14221c;
  --text-muted: #5a6b63;
  --border: #d8e5de;
  --shadow: 0 8px 24px rgba(15, 61, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 61, 46, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background:
    radial-gradient(1200px 400px at 10% -10%, #d8f3e4 0%, transparent 55%),
    radial-gradient(900px 360px at 100% 0%, #e7f0ff 0%, transparent 50%),
    var(--bg);
  letter-spacing: 0.01em;
}

.header {
  background: linear-gradient(145deg, #1f7a54 0%, #0f3d2e 55%, #0a2e22 100%);
  padding: 18px 16px 20px;
  border-radius: 0 0 22px 22px;
  box-shadow: var(--shadow-lg);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem !important;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-logo {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.subtitle {
  opacity: 0.92;
  font-weight: 500;
  font-size: 0.82rem !important;
  margin-top: 4px !important;
}

.btn-icon {
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.18) !important;
  border: 1px solid rgba(255,255,255,0.25);
  width: 44px !important;
  height: 44px !important;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 16px !important;
  padding: 16px 10px !important;
  box-shadow: var(--shadow) !important;
  transition: transform 0.15s ease;
}

.stat-card:active { transform: scale(0.98); }

.stat-number {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
}

.stat-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.68rem !important;
  letter-spacing: 0.04em;
}

.search-bar input,
.lista-search,
#search-input {
  border-radius: 14px !important;
  border: 1.5px solid var(--border) !important;
  box-shadow: 0 2px 8px rgba(15,61,46,0.04);
  padding: 13px 16px !important;
  font-size: 1rem !important;
}

.filter-btn {
  border-radius: 999px !important;
  font-weight: 600 !important;
  border: 1.5px solid var(--border) !important;
  background: #fff !important;
  padding: 8px 14px !important;
}

.filter-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(31,122,84,0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)) !important;
  border: none !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 16px rgba(31,122,84,0.28);
  letter-spacing: 0.01em;
}

.btn-secondary {
  border-radius: 14px !important;
  font-weight: 600 !important;
  border-width: 1.5px !important;
}

.empty-state {
  text-align: center;
  padding: 48px 24px !important;
}

.empty-state h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 300px;
  margin: 0 auto 20px;
  line-height: 1.55;
}

.empty-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.08));
}

.product-card,
.lista-cat,
.comprar-section,
.donar-card,
.b2b-card,
.guide-toc {
  border-radius: 16px !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--border) !important;
}

.bottom-nav {
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(216,229,222,0.9) !important;
  box-shadow: 0 -8px 30px rgba(15,61,46,0.08);
  padding-bottom: env(safe-area-inset-bottom, 6px);
}

.nav-item.active {
  color: var(--primary-dark) !important;
}

.nav-item.active .nav-icon {
  transform: scale(1.08);
}

.guide-hero {
  background: linear-gradient(145deg, #1f7a54, #0f3d2e);
  color: #fff;
  border-radius: 20px;
  padding: 24px 20px !important;
  margin-bottom: 18px;
  box-shadow: var(--shadow-lg);
}

.guide-hero .guide-title,
.guide-hero h1 {
  color: #fff !important;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.4rem !important;
}

.guide-hero .guide-lead,
.guide-hero p {
  color: rgba(255,255,255,0.9) !important;
}

.guide-toc {
  background: #fff !important;
}

.guide-toc-item {
  border-radius: 14px !important;
  font-weight: 600 !important;
}

.seo-content article {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px !important;
  border-bottom: none !important;
}

.seo-content h2 {
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

.modal-content {
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.5);
}

.chip, .comprar-chip, .lista-amz-btn {
  border-radius: 12px !important;
  font-weight: 700 !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.chip:active, .comprar-chip:active, .lista-amz-btn:active {
  transform: scale(0.98);
}

.chip-amz, .btn-affiliate {
  background: linear-gradient(135deg, #ffb84d, #ff9900) !important;
  color: #1a1a1a !important;
  box-shadow: 0 4px 12px rgba(255,153,0,0.25);
}

.comprar-hero h2,
.donar-hero h2,
.lista-title {
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: var(--primary-dark) !important;
}

.home-footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 20px 16px 100px;
}

.fab-add, #fab-add {
  box-shadow: 0 10px 28px rgba(31,122,84,0.4) !important;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)) !important;
}

.lista-item.is-checked {
  background: linear-gradient(90deg, #e8f5e9, #f3faf6) !important;
  border-radius: 10px;
}

.expiry-alert-banner {
  background: linear-gradient(90deg, #fff3cd, #ffe8a3) !important;
  border-bottom: 2px solid #f0ad4e !important;
}

.more-item, .invite-card {
  border-radius: 14px !important;
  transition: background 0.15s ease;
}

.more-item:active, .invite-card:active {
  background: #e8f5e9 !important;
}


/* ========== Modo oscuro ========== */
[data-theme="dark"] {
  --primary: #3d9b6c;
  --primary-dark: #a8e6c5;
  --primary-light: #2d9b6c;
  --bg: #0d1612;
  --card: #16241d;
  --text: #e8f2ec;
  --text-muted: #9bb0a5;
  --border: #2a3f35;
  --shadow: 0 8px 28px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.45);
  color-scheme: dark;
}

[data-theme="dark"] body {
  background:
    radial-gradient(1000px 380px at 0% 0%, #1a3328 0%, transparent 50%),
    radial-gradient(800px 300px at 100% 0%, #15202b 0%, transparent 45%),
    var(--bg);
  color: var(--text);
}

[data-theme="dark"] .header {
  background: linear-gradient(145deg, #1a4d38 0%, #0a1f16 100%);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .lista-cat,
[data-theme="dark"] .comprar-section,
[data-theme="dark"] .seo-content article,
[data-theme="dark"] .guide-toc,
[data-theme="dark"] .donar-card,
[data-theme="dark"] .b2b-card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .more-tema,
[data-theme="dark"] .filter-btn {
  background: var(--card) !important;
  color: var(--text);
  border-color: var(--border) !important;
}

[data-theme="dark"] .filter-btn.active {
  background: var(--primary) !important;
  color: #0d1612 !important;
}

[data-theme="dark"] .bottom-nav {
  background: rgba(13, 22, 18, 0.92) !important;
  border-top-color: var(--border) !important;
}

[data-theme="dark"] .search-bar input,
[data-theme="dark"] .lista-search,
[data-theme="dark"] #search-input,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #0f1c16 !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .guide-hero {
  background: linear-gradient(145deg, #1a4d38, #0a1f16);
}

[data-theme="dark"] .btn-secondary {
  background: #1a2e24 !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .chip {
  background: #1a2e24;
  color: var(--text);
}

[data-theme="dark"] .comprar-chip {
  background: #1a3328 !important;
  color: #c8f0d8 !important;
  border-color: #2a4a3a !important;
}

[data-theme="dark"] .expiry-alert-banner {
  background: linear-gradient(90deg, #3d3210, #4a3a12) !important;
  color: #ffe9a8 !important;
  border-bottom-color: #c9a227 !important;
}

[data-theme="dark"] .cookie-banner {
  background: #16241d !important;
  color: var(--text);
}

[data-theme="dark"] .more-item small,
[data-theme="dark"] .help-text,
[data-theme="dark"] .tiny {
  color: var(--text-muted) !important;
}

/* ========== Animaciones de modales ========== */
.modal {
  transition: opacity 0.28s ease;
}

.modal.show {
  animation: modalFadeIn 0.28s ease;
}

.modal-content {
  animation: modalSheetIn 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSheetIn {
  from {
    opacity: 0.6;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 768px) {
  .modal-content {
    animation-name: modalCenterIn;
  }
  @keyframes modalCenterIn {
    from {
      opacity: 0;
      transform: translateY(12px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

.btn-primary, .btn-secondary, .nav-item, .filter-btn, .chip, .comprar-chip {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.app-view {
  animation: viewIn 0.25s ease;
}

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


/* Recordatorio diario en inicio */
.daily-reminder-home {
  margin: 12px 14px 4px;
}
.daily-reminder-home-inner {
  background: #eef6ff;
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 14px;
  color: #1e3a5f;
}
.daily-reminder-home-text strong {
  display: block;
  font-size: 0.95rem;
  color: #0f2744;
  margin-bottom: 4px;
}
.daily-reminder-home-text p {
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0 0 10px;
}
.daily-ics-home-btn {
  width: 100%;
  margin-bottom: 8px;
}
.daily-reminder-details {
  font-size: 0.8rem;
  color: #1e3a5f;
}
.daily-reminder-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}
.daily-reminder-details .daily-reminder-steps {
  margin-top: 6px;
}
.app-version {
  font-size: 0.72rem;
  opacity: 0.65;
  margin-top: 4px !important;
}
[data-theme="dark"] .daily-reminder-home-inner {
  background: #1a2a3a;
  border-color: #2a4a6a;
  color: #c8dff0;
}
[data-theme="dark"] .daily-reminder-home-text strong {
  color: #e8f4ff;
}
[data-theme="dark"] .daily-reminder-details {
  color: #c8dff0;
}

.daily-reminder-home,
.daily-reminder-home-inner,
.daily-ics-home-btn,
#btn-daily-ics-home,
#btn-daily-gcal-home,
#btn-daily-ics,
#btn-daily-gcal {
  pointer-events: auto !important;
  position: relative;
  z-index: 5;
  cursor: pointer;
}
.daily-ics-home-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
}

.daily-why {
  margin: 6px 0 8px !important;
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  padding: 8px 10px;
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  border-left: 3px solid #0284c7;
}
[data-theme="dark"] .daily-why {
  background: rgba(0,0,0,0.25);
  border-left-color: #38bdf8;
}
.daily-reminder-ol {
  list-style: decimal;
  margin-left: 1.2em;
  margin-bottom: 8px;
}
.daily-reminder-ol li {
  margin-bottom: 6px;
}
.daily-manual-hint {
  font-size: 0.78rem;
  margin: 4px 0 0;
  opacity: 0.9;
}
.daily-reminder-home-inner {
  border-width: 2px !important;
}
