/* ============================================================
   Vallas Publicitarias Geniales - Modular CSS
   Mobile-first, high-performance, semantic, W3C-friendly
   ============================================================ */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #e11d48;
  --accent-hover: #be123c;
  --secondary: #0ea5e9;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #059669;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1200px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }

/* ========== HEADER ========== */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-top {
  background: var(--primary-light);
  font-size: .85rem;
  padding: .4rem 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.header-top a { color: #94a3b8; }
.header-top a:hover { color: #fff; }

.ticker {
  overflow: hidden;
  white-space: nowrap;
  max-width: 60%;
}
.ticker-inner {
  display: inline-block;
  animation: ticker 28s linear infinite;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0;
  gap: 1rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: #cbd5e1;
  padding: .45rem .85rem;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: .25rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  overflow: hidden;
}
.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  padding: .5rem .75rem;
  width: 160px;
  font-size: .9rem;
}
.search-box input::placeholder { color: #94a3b8; }
.search-box button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: .5rem .85rem;
  cursor: pointer;
}

/* ========== LAYOUT ========== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { flex: 1; }

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(225,29,72,.15), transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 780px; }
.hero-badge {
  display: inline-block;
  background: rgba(225,29,72,.2);
  color: #fda4af;
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: .03em;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}
.hero p {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 1.75rem;
  max-width: 560px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: .75rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background .2s, transform .15s;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,.3);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* ========== SECTIONS ========== */
.section { padding: 3.5rem 0; }
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: .5rem;
  letter-spacing: -.02em;
}
.section-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Category Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.cat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #fff;
}
.cat-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.cat-card p { color: var(--text-muted); font-size: .95rem; }

/* Calculator Widget */
.calc-widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  margin-top: 2.5rem;
}
.calc-widget h2 { font-size: 1.4rem; margin-bottom: .35rem; }
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.calc-result {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}
.calc-result .score {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fda4af;
}
.calc-result .label { font-size: .9rem; color: #94a3b8; margin-top: .25rem; }

/* Articles / Cards */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.article-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .2s;
}
.article-card:hover { transform: translateY(-3px); }
.article-card .thumb {
  height: 160px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  font-size: 2.5rem;
}
.article-card .body { padding: 1.35rem; }
.article-card .meta {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.article-card h3 { font-size: 1.1rem; margin-bottom: .5rem; line-height: 1.35; }
.article-card p { font-size: .92rem; color: var(--text-muted); }

/* Content pages */
.page-header {
  background: var(--primary);
  color: #fff;
  padding: 2.5rem 0;
}
.page-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.page-header p { color: #94a3b8; margin-top: .5rem; }

.content-block {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.content-block h2 {
  font-size: 1.35rem;
  margin: 1.75rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--border);
}
.content-block h2:first-child { margin-top: 0; }
.content-block h3 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.content-block p, .content-block li { margin-bottom: .85rem; color: #334155; }
.content-block ul, .content-block ol { padding-left: 1.35rem; margin-bottom: 1rem; }
.content-block ul { list-style: disc; }
.content-block ol { list-style: decimal; }
.content-block a { font-weight: 500; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.contact-info-item .icon {
  width: 44px; height: 44px;
  background: #f1f5f9;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  height: 320px;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 1rem 0;
  font-size: .9rem;
}
.checkbox-group input { margin-top: .25rem; width: auto; }
.form-msg {
  padding: .85rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
}
.form-msg.success { background: #d1fae5; color: #065f46; display: block; }
.form-msg.error { background: #fee2e2; color: #991b1b; display: block; }

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
}
.newsletter h2 { margin-bottom: .5rem; }
.newsletter p { color: #94a3b8; margin-bottom: 1.5rem; }
.newsletter-form {
  display: flex;
  gap: .75rem;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: .75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  font-size: .9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .logo { margin-bottom: .75rem; }
.footer-brand p { line-height: 1.6; }
.footer-col h4 {
  color: #fff;
  font-size: .95rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.footer-col ul li { margin-bottom: .45rem; }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: #fff; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.footer-legal strong { color: #e2e8f0; }
.footer-links { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; }
.footer-links a { font-size: .85rem; }

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  z-index: 9999;
  box-shadow: 0 -4px 24px rgba(0,0,0,.3);
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.cookie-inner p { flex: 1; min-width: 260px; font-size: .92rem; line-height: 1.5; }
.cookie-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.cookie-btns button {
  padding: .55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: none;
}
.btn-accept { background: var(--accent); color: #fff; }
.btn-reject { background: transparent; border: 1px solid #64748b; color: #cbd5e1; }
.btn-settings { background: #334155; color: #fff; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--primary);
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
  }
  .nav-toggle { display: block; }
  .main-nav { position: relative; }
  .search-box { display: none; }
  .contact-grid, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .ticker { max-width: 100%; }
}

@media (max-width: 600px) {
  .hero { padding: 2.5rem 0; }
  .section { padding: 2.5rem 0; }
  .calc-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
}