/* PuntoFrugal — Header Styles v1.7 */

:root {
  --pf-orange:       #F5A623;
  --pf-orange-hover: #E09410;
  --pf-orange-light: #FEF3DC;
  --pf-navy:         #1A2444;
  --pf-text:         #111827;
  --pf-muted:        #6B7280;
  --pf-border:       #E5E7EB;
}

/* ── WP wrapper overrides ───────────────────────────────────── */
.wp-block-template-part:has(.pf-header),
.wp-block-shortcode:has(.pf-header) {
  display: contents;
}

/* ── Header wrapper ─────────────────────────────────────── */
.pf-header {
  background: var(--pf-navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 1px 12px rgba(0,0,0,.18);
}

.pf-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* ── Logo ──────────────────────────────────────────────────── */
.pf-logo-link { text-decoration: none; flex-shrink: 0; }
.pf-logo {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1;
}
.pf-logo-accent { color: var(--pf-orange); }

/* ── Desktop nav ──────────────────────────────────────────── */
.pf-nav { flex: 1; }
.pf-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.pf-nav-list > li {
  align-self: center;
}
.pf-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
}
.pf-nav-link:hover,
.pf-has-mega.pf-mega-open > .pf-nav-link {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.pf-nav-chevron { width: 15px; height: 15px; transition: transform .2s; flex-shrink: 0; }
.pf-has-mega.pf-mega-open .pf-nav-chevron { transform: rotate(180deg); }

.pf-nav-trigger { position: relative; }
.pf-has-mega.pf-mega-open > .pf-nav-trigger::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  background: var(--pf-orange);
  border-radius: 2px;
}

/* ── CTA button ───────────────────────────────────────────── */
.pf-header-cta {
  flex-shrink: 0;
  background: var(--pf-orange);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(245,166,35,.35);
}
.pf-header-cta:hover {
  background: var(--pf-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245,166,35,.45);
}

/* ── Mega panel — base ────────────────────────────────────── */
.pf-nav-item {
  position: relative;
  list-style: none;
}

.pf-mega-panel {
  display: none !important;
  position: absolute !important;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,.06),
    0 16px 48px -4px rgba(0,0,0,.14),
    0 0 0 1px rgba(0,0,0,.04);
  padding: 8px;
  min-width: 260px;
  z-index: 200;
}

.pf-mega-panel::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
  border-left: 1px solid rgba(0,0,0,.06);
}

@keyframes pfPanelIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.pf-has-mega.pf-mega-open .pf-mega-panel {
  display: block !important;
  animation: pfPanelIn .18s ease forwards;
}

/* ── Categorías panel (flat list) ─────────────────────────── */
.pf-mega-categorias {
  min-width: 290px;
}

/* ── Calculadoras panel (multi-column) ────────────────────── */
.pf-mega-herramientas {
  min-width: 740px;
  left: auto !important;
  right: -20px;
  transform: none !important;
  padding: 4px 4px 8px;
}

.pf-mega-herramientas::before {
  left: auto;
  right: 52px;
  transform: rotate(45deg);
}

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

.pf-has-mega.pf-mega-open .pf-mega-herramientas {
  animation: pfPanelInCalc .18s ease forwards;
}

/* ── Mega columns grid ────────────────────────────────────── */
.pf-mega-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0 4px;
  padding: 8px 4px 4px;
}

.pf-mega-col {
  min-width: 0;
  padding: 4px 6px 8px;
}

.pf-mega-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 8px;
  color: var(--pf-navy);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-decoration: none;
  border-bottom: 2px solid var(--pf-border);
  margin-bottom: 6px;
  transition: color .15s;
  white-space: nowrap;
}

.pf-mega-col-header:hover { color: var(--pf-orange); }

.pf-mega-col-icon {
  flex-shrink: 0;
  color: var(--pf-navy);
  opacity: .75;
}
.pf-mega-col-icon svg { width: 13px; height: 13px; stroke-width: 2.2; }
.pf-mega-col-header:hover .pf-mega-col-icon { opacity: 1; }

.pf-mega-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pf-mega-col-item {
  display: block;
  padding: 6px 6px;
  color: var(--pf-text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none !important;
  border-radius: 6px;
  transition: background .12s, color .12s;
  line-height: 1.35;
}

a.pf-mega-col-item:hover {
  background: var(--pf-orange-light);
  color: var(--pf-navy);
}

.pf-mega-col-soon {
  color: var(--pf-muted);
  cursor: default;
  font-size: 12.5px;
}

.pf-soon-tag {
  display: inline-block;
  background: #F3F4F6;
  color: #9CA3AF;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 3px;
}

/* ── Flat mega items (Categorías) ──────────────────────────── */
.pf-mega-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--pf-text);
  font-size: 14px;
  font-weight: 500;
  transition: background .12s, color .12s;
  line-height: 1.3;
}
.pf-mega-item:hover {
  background: var(--pf-orange-light);
  color: var(--pf-navy);
}
.pf-mega-icon {
  width: 36px;
  height: 36px;
  background: #F3F4F6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--pf-navy);
  transition: background .12s;
}
.pf-mega-item:hover .pf-mega-icon { background: rgba(245,166,35,.2); }
.pf-mega-icon svg { width: 18px; height: 18px; stroke-width: 1.75; }
.pf-mega-label { flex: 1; }
.pf-mega-chevron { width: 14px; height: 14px; color: var(--pf-muted); flex-shrink: 0; }

/* ── Hamburger ──────────────────────────────────────────────── */
.pf-hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background .15s;
  line-height: 0;
}
.pf-hamburger:hover { background: rgba(255,255,255,.1); }
.pf-hamburger svg { width: 24px; height: 24px; }

/* ── Mobile drawer ────────────────────────────────────────── */
.pf-mobile-nav {
  display: none;
  background: var(--pf-navy);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 8px 0 24px;
}
.pf-mobile-nav.pf-mobile-open { display: block; }
.pf-mobile-nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.pf-mobile-link {
  display: block;
  color: rgba(255,255,255,.85);
  padding: 13px 0;
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.pf-mobile-link:hover { color: var(--pf-orange); }
.pf-mobile-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  padding: 13px 0;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-family: inherit;
}
.pf-mobile-toggle svg { width: 18px; height: 18px; transition: transform .2s; }
.pf-mobile-section-open > .pf-mobile-toggle svg { transform: rotate(180deg); }
.pf-mobile-submenu { display: none; padding: 6px 0; }
.pf-mobile-section-open > .pf-mobile-submenu { display: block; }

/* Mobile flat items (Categorías) */
.pf-mobile-submenu .pf-mega-item { color: rgba(255,255,255,.75); padding: 9px 8px; }
.pf-mobile-submenu .pf-mega-icon { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); }
.pf-mobile-submenu .pf-mega-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.pf-mobile-submenu .pf-mega-chevron { color: rgba(255,255,255,.3); }

/* Mobile column items (Calculadoras) */
.pf-mobile-submenu-calc .pf-mega-columns {
  display: block;
  padding: 4px 0 0;
}
.pf-mobile-submenu-calc .pf-mega-col {
  padding: 0 0 12px;
}
.pf-mobile-submenu-calc .pf-mega-col-header {
  color: rgba(255,255,255,.5);
  font-size: 10px;
  border-bottom-color: rgba(255,255,255,.12);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.pf-mobile-submenu-calc .pf-mega-col-header:hover { color: var(--pf-orange); }
.pf-mobile-submenu-calc .pf-mega-col-icon { color: rgba(255,255,255,.5); }
.pf-mobile-submenu-calc .pf-mega-col-list { padding: 0 0 0 4px; }
.pf-mobile-submenu-calc a.pf-mega-col-item {
  color: rgba(255,255,255,.8);
  font-size: 14px;
  padding: 8px 8px;
}
.pf-mobile-submenu-calc a.pf-mega-col-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.pf-mobile-submenu-calc .pf-mega-col-soon { color: rgba(255,255,255,.3); }
.pf-mobile-submenu-calc .pf-soon-tag { background: rgba(255,255,255,.1); color: rgba(255,255,255,.4); }

.pf-mobile-cta { margin-top: 18px; width: 100%; text-align: center; justify-content: center; }

/* ── Newsletter modal ─────────────────────────────────────── */
.pf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.pf-modal-overlay[hidden] { display: none; }
.pf-modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 38px 32px 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  animation: pfModalIn .22s ease;
}
@keyframes pfModalIn {
  from { transform: translateY(10px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.pf-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none;
  color: var(--pf-muted); cursor: pointer;
  padding: 6px; border-radius: 6px;
  line-height: 0;
  transition: background .15s, color .15s;
}
.pf-modal-close:hover { background: #F3F4F6; color: var(--pf-text); }
.pf-modal-close svg { width: 20px; height: 20px; }
.pf-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px; font-weight: 700;
  color: var(--pf-navy); margin: 0 0 8px;
  line-height: 1.3;
}
.pf-nl-desc { color: var(--pf-muted); font-size: 15px; margin: 0; line-height: 1.5; }
.pf-modal-form { margin-top: 16px; }
.pf-nl-input {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--pf-border);
  border-radius: 10px;
  font-size: 15px; font-family: inherit;
  outline: none; box-sizing: border-box;
  transition: border-color .15s;
  color: var(--pf-text);
}
.pf-nl-input:focus { border-color: var(--pf-orange); box-shadow: 0 0 0 3px rgba(245,166,35,.12); }
.pf-nl-btn {
  width: 100%; margin-top: 10px; padding: 13px;
  background: var(--pf-orange); color: #fff;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(245,166,35,.35);
}
.pf-nl-btn:hover { background: var(--pf-orange-hover); transform: translateY(-1px); }
.pf-nl-privacy { color: var(--pf-muted); font-size: 13px; margin: 14px 0 0; line-height: 1.4; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .pf-mega-herramientas { min-width: 580px; right: -10px; }
  .pf-mega-columns { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .pf-nav,
  .pf-header-cta:not(.pf-mobile-cta) { display: none; }
  .pf-hamburger { display: flex; align-items: center; }
  .pf-header-inner { gap: 16px; }
}
