/*
Theme Name: ComparaVE
Theme URI: https://comparave.com
Author: ComparaVE
Author URI: https://comparave.com
Description: Tema oficial de ComparaVE — directorio público e independiente para comparar seguros, bancos y servicios en Venezuela. Incluye CPTs (producto, empresa, reseña), taxonomías, plantillas para hub de categorías, comparador, blog y donaciones. 100% gratis, sin publicidad.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: comparave
Tags: directory, comparison, reviews, custom-post-types, responsive, accessibility-ready
*/

/* =================================================================
   COMPARAVE — DESIGN TOKENS (espejo del prototipo React)
   ================================================================= */
:root {
  /* Brand */
  --green: #1FA85A;
  --green-dark: #0F6B3A;
  --green-light: #5DD18F;
  --yellow: #FFC837;
  --ink: #0B1F14;
  --coral: #FF5A5F;
  --blue: #2B4BFF;
  --cream: #FFF6E3;

  /* UI */
  --bg: #FFFFFF;
  --surface: #F7F7F4;
  --text: #0B1F14;
  --text-muted: #6B7570;
  --border: #E5E7E2;

  /* Type */
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --container: 1240px;
  --container-narrow: 860px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  --bg: #0B1F14;
  --surface: #14271C;
  --text: #F7F7F4;
  --text-muted: #9AA59E;
  --border: #1F3528;
}

/* =================================================================
   RESET
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.04em; }
h2 { font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -0.03em; }
h3 { font-size: 22px; }
p  { margin: 0 0 1em; line-height: 1.6; }

/* =================================================================
   LAYOUT HELPERS
   ================================================================= */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: var(--container-narrow); }
.section { padding: 64px 0; }
.section--surface { background: var(--surface); }
.section--ink { background: var(--ink); color: #fff; }
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--green); }

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px;
  font-size: 15px; font-weight: 600;
  border: none; border-radius: 999px;
  cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.12); text-decoration: none; }
.btn--primary { background: var(--ink); color: var(--yellow); }
.btn--green   { background: var(--green); color: #fff; }
.btn--yellow  { background: var(--yellow); color: var(--ink); }
.btn--outline { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn--ghost   { background: transparent; color: var(--text); }
.btn--lg { padding: 16px 28px; font-size: 17px; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--full { width: 100%; }

/* =================================================================
   BADGES
   ================================================================= */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge--green  { background: rgba(31,168,90,.13);  color: var(--green); }
.badge--yellow { background: rgba(255,200,55,.2);  color: var(--ink); }
.badge--coral  { background: rgba(255,90,95,.13);  color: var(--coral); }
.badge--blue   { background: rgba(43,75,255,.13);  color: var(--blue); }
.badge--ink    { background: var(--ink);           color: var(--yellow); }

/* =================================================================
   HEADER
   ================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; gap: 16px;
}
.site-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px;
  letter-spacing: -0.04em; color: var(--ink);
  text-decoration: none;
}
.site-logo img {
  height: 32px;
  width: auto;
}
.site-logo .logo-ve { color: var(--green); }

.main-nav { display: flex; gap: 4px; align-items: center; flex: 1; margin-left: 24px; }
.main-nav a {
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
}
.main-nav a:hover { background: var(--surface); text-decoration: none; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  align-items: center; justify-content: center;
}

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 56px 0 28px;
  margin-top: 64px;
}
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: var(--yellow); text-decoration: none; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 14px; }
.site-footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13px;
  opacity: .6;
  flex-wrap: wrap; gap: 10px;
}
.social {
  display: flex; gap: 10px; margin-top: 18px;
}
.social a {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: #fff;
}

/* =================================================================
   HERO
   ================================================================= */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 { margin: 20px auto 24px; max-width: 880px; }
.hero p  { font-size: 20px; color: var(--text-muted); max-width: 640px; margin: 0 auto 36px; }
.hero-meta { display: flex; justify-content: center; gap: 24px; margin-top: 32px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }

/* =================================================================
   SEARCH BOX
   ================================================================= */
.search-box {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
}
.search-box input {
  flex: 1;
  border: none; outline: none;
  padding: 12px 20px;
  font-size: 16px; background: transparent;
  color: var(--text);
}

/* =================================================================
   CARDS
   ================================================================= */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.08); }

.cat-card { display: block; padding: 24px; border-radius: var(--radius-lg); color: #fff; text-decoration: none; }
.cat-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.12); }
.cat-card__icon { font-size: 36px; margin-bottom: 12px; }
.cat-card__title { font-size: 18px; font-weight: 600; line-height: 1.2; margin: 0 0 4px; }
.cat-card__count { font-size: 13px; opacity: .8; }

/* =================================================================
   PRODUCT CARD
   ================================================================= */
.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.product-card__head { display: flex; gap: 12px; align-items: center; }
.product-card__logo {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: var(--ink);
}
.product-card__title { font-size: 17px; font-weight: 600; margin: 0; }
.product-card__provider { font-size: 13px; color: var(--text-muted); }
.product-card__price { font-size: 22px; font-weight: 700; }
.product-card__meta { display: flex; gap: 12px; font-size: 13px; color: var(--text-muted); }
.product-card__cta { display: flex; gap: 8px; }

/* =================================================================
   STARS
   ================================================================= */
.stars { display: inline-flex; gap: 1px; align-items: center; }
.star { color: var(--yellow); font-size: 14px; }
.star--empty { color: var(--border); }

/* =================================================================
   ARCHIVE / FILTERS
   ================================================================= */
.archive-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 32px 0 80px; }
.filters { position: sticky; top: 90px; align-self: start; }
.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.filter-group select,
.filter-group input[type="text"] {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 14px;
}

/* =================================================================
   COMPARADOR
   ================================================================= */
.compare-table {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  text-align: left;
}
.compare-table th { background: var(--surface); font-weight: 700; }

/* =================================================================
   FORMS
   ================================================================= */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-field label { font-size: 14px; font-weight: 600; }
.form-field .hint { font-size: 12px; color: var(--text-muted); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="password"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 15px;
  outline: none;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus { border-color: var(--green); }
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

/* =================================================================
   PANA TIP CALLOUT (verde, no amarillo)
   ================================================================= */
.pana-tip {
  padding: 14px 16px;
  background: rgba(31,168,90,.12);
  border: 1px solid rgba(31,168,90,.35);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.pana-tip strong { color: var(--green-dark); }

/* =================================================================
   DONACIONES
   ================================================================= */

/* --- Hero --- */
.donate-hero {
  background: var(--green);
  color: #fff;
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.donate-hero__glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,200,55,.07) 0%, transparent 60%);
  pointer-events: none;
}
.donate-hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
}
.donate-hero h1 { color: #fff; margin-top: 18px; margin-bottom: 18px; }
.donate-hero h1 span { color: var(--yellow); }
.donate-hero__lead { font-size: 17px; opacity: .90; line-height: 1.6; max-width: 540px; margin-bottom: 14px; }
.donate-hero__sub  { font-size: 14px; opacity: .72; line-height: 1.65; max-width: 520px; margin: 0; }
.donate-hero__mascot img { width: 100%; max-width: 280px; margin: 0 auto; }

/* --- Cuánto aportar --- */
.donate-amounts { background: var(--yellow); padding: 40px 0; }
.donate-amounts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.donate-amount-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
}
.donate-amount-card__price {
  font-size: 36px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.donate-amount-card__label {
  font-size: 13px; font-weight: 700;
  color: var(--green); margin-bottom: 10px;
}
.donate-amount-card__desc {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.5; margin: 0;
}

/* --- Wallet rows --- */
.don-list { display: grid; gap: 12px; }
.don-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: center;
}
.don-row__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  flex-shrink: 0;
}
.don-row__info { min-width: 0; }
.don-row__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.don-row__label { font-size: 14px; font-weight: 700; color: var(--text); }
.don-row__tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.don-row__addr {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- CTA final --- */
.donate-cta-final {
  background: var(--green);
  color: #fff;
  padding: 56px 0;
}
.donate-cta-final__inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.donate-cta-final__emoji { font-size: 40px; margin-bottom: 14px; }
.donate-cta-final h2 { color: #fff; margin-bottom: 12px; font-size: clamp(22px, 3vw, 30px); }
.donate-cta-final p  { font-size: 16px; opacity: .90; line-height: 1.6; margin: 0; }

/* --- Responsive donate --- */
@media (max-width: 760px) {
  .donate-hero__grid   { grid-template-columns: 1fr; }
  .donate-amounts__grid { grid-template-columns: 1fr; }
  .don-row { grid-template-columns: 48px 1fr; }
  .don-row .btn { grid-column: 1 / -1; }
}

/* =================================================================
   BLOG
   ================================================================= */
.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.blog-card__hero { width: 100%; height: 200px; background: var(--green); }
.blog-card__body { padding: 20px; }
.blog-card__title { font-size: 18px; margin: 8px 0 6px; }
.blog-card__excerpt { font-size: 14px; color: var(--text-muted); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 960px) {
  .main-nav, .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }
  .archive-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .grid--4 { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  .form-card { padding: 20px; }
}

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 49; overflow-y: auto;
  padding: 20px;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer a {
  display: block;
  padding: 14px 16px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

/* =================================================================
   WORDPRESS CORE
   ================================================================= */
.alignleft  { float: left;  margin: 0 20px 20px 0; }
.alignright { float: right; margin: 0 0 20px 20px; }
.aligncenter { display: block; margin: 0 auto 20px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--text-muted); text-align: center; padding: 6px 0; }
.screen-reader-text {
  position: absolute !important;
  clip: rect(1px,1px,1px,1px);
  width: 1px; height: 1px;
  overflow: hidden;
}
.sticky, .gallery-caption, .bypostauthor { /* required by WP */ }

.pagination {
  display: flex; gap: 8px; justify-content: center;
  padding: 40px 0;
}
.pagination a, .pagination span {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.pagination .current {
  background: var(--ink); color: var(--yellow); border-color: var(--ink);
}

/* =================================================================
   NUEVOS AJUSTES (FILTROS, COMPARADOR Y LOGIN)
   ================================================================= */

/* Selector de estrellas interactivo en reseñas */
.cve-star-rating-select {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  font-size: 32px;
  line-height: 1;
  gap: 4px;
}
.cve-star-rating-select input[type="radio"] {
  display: none;
}
.cve-star-rating-select label {
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s ease-in-out;
}
.cve-star-rating-select label:hover,
.cve-star-rating-select label:hover ~ label,
.cve-star-rating-select input[type="radio"]:checked ~ label {
  color: var(--yellow) !important;
}

/* Tabs para login y registro */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 16px;
}
.auth-tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  transition: all 0.2s ease-in-out;
}
.auth-tab-btn.active, .auth-tab-btn:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* Tabla comparadora responsiva */
@media (max-width: 768px) {
  .compare-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ========================================================
   FAVORITOS & ESTRELLAS (Agregados para reparar rotos)
   ======================================================== */

/* Favoritos Button */
.cve-fav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cve-fav-btn:hover {
  background: var(--surface);
}
.cve-fav-btn--active {
  background: rgba(255, 90, 95, 0.1);
  border-color: rgba(255, 90, 95, 0.2);
  color: var(--coral);
}
.cve-fav-btn--active svg {
  fill: var(--coral);
  stroke: var(--coral);
}

/* Star Rating Input (Comments) */
.star-rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}
.star-rating-input input {
  display: none;
}
.star-rating-input label {
  cursor: pointer;
  color: var(--border);
  font-size: 24px;
  transition: color 0.2s;
}
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
  color: var(--yellow);
}

