/* ═══════════════════════════════════════════════════════════════
   CUSTOMER EXPERIENCE — components.css
   Header · Nav · Footer · Hero · Bloques
═══════════════════════════════════════════════════════════════ */

/* ─── HEADER / NAV ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 2rem;
}

.nav__logo {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-decoration: none;
}

.nav__logo-main {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.nav__logo-sub {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--text-primary);
  background: var(--gray-soft);
}

.nav__link.active {
  color: var(--green-primary);
  background: var(--green-light);
}

.nav__cta {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--bg-white);
  background: var(--green-primary);
  padding: 0.5625rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  text-decoration: none;
}

.nav__cta:hover {
  background: var(--green-hover);
  color: #fff;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--gray-border);
}

.nav__mobile.open { display: flex; }

.nav__mobile a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.nav__mobile a:hover { background: var(--gray-soft); color: var(--text-primary); }

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  background: var(--bg-white);
  padding-block: var(--space-3xl);
  border-bottom: 1px solid var(--gray-border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(29,158,117,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  max-width: 780px;
}

.hero__label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-primary);
  background: var(--green-light);
  border: 1px solid var(--green-border);
  padding: 0.375rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.75rem;
}

.hero__title {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero__title em {
  font-style: normal;
  color: var(--green-primary);
}

.hero__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 620px;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero__footnote {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.6;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-border);
  max-width: 560px;
}

/* ─── BLOQUE PROBLEMA ────────────────────────────────────────── */
.problemas {
  background: var(--bg-site);
}

.problemas__header {
  max-width: 700px;
  margin-bottom: var(--space-xl);
}

.problema-card {
  background: var(--bg-white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.problema-card:hover {
  border-color: var(--green-border);
  box-shadow: var(--shadow-sm);
}

.problema-card__icon {
  width: 36px;
  height: 36px;
  background: var(--green-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.problema-card__icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--green-primary);
  stroke-width: 2;
  fill: none;
}

.problema-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.problema-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── BLOQUE DIFERENCIAL ─────────────────────────────────────── */
.diferencial {
  background: var(--bg-white);
}

.diferencial__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.diferencial__list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 1.75rem;
  margin-bottom: 2rem;
}

.diferencial__item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.diferencial__dot {
  width: 8px;
  height: 8px;
  background: var(--green-primary);
  border-radius: 50%;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.diferencial__item-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

.diferencial__quote {
  background: var(--bg-site);
  border-left: 3px solid var(--green-primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  margin-top: 1rem;
}

.diferencial__visual {
  background: var(--bg-site);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.diferencial__stat {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--gray-border);
}

.diferencial__stat-num {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--green-primary);
  line-height: 1;
}

.diferencial__stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ─── METODOLOGÍA ────────────────────────────────────────────── */
.metodologia {
  background: var(--bg-site);
}

.metodologia__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.metodologia-step {
  background: var(--bg-white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  position: relative;
  transition: box-shadow var(--transition);
}

.metodologia-step:hover {
  box-shadow: var(--shadow-md);
}

.metodologia-step__num {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green-primary);
  background: var(--green-light);
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.metodologia-step__title {
  font-size: var(--text-lg);
  margin-bottom: 0.75rem;
}

.metodologia-step__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── SERVICIOS ──────────────────────────────────────────────── */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.servicio-card {
  background: var(--bg-white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  display: block;
}

.servicio-card:hover {
  border-color: var(--green-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.servicio-card__icon {
  width: 44px;
  height: 44px;
  background: var(--green-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.servicio-card__icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--green-primary);
  stroke-width: 1.75;
  fill: none;
}

.servicio-card__title {
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: 0.625rem;
}

.servicio-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── AUTORIDAD ──────────────────────────────────────────────── */
.autoridad {
  background: var(--bg-site);
  border-top: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
}

.autoridad__inner {
  max-width: 760px;
}

/* ─── INSIGHT QUOTE ──────────────────────────────────────────── */
.insight-quote {
  background: var(--bg-dark);
  padding-block: var(--space-2xl);
}

.insight-quote__text {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--text-on-dark);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  max-width: 820px;
}

.insight-quote__text span {
  color: var(--green-primary);
}

.insight-quote__sub {
  color: var(--text-on-dark-2);
  font-size: var(--text-base);
  line-height: 1.7;
  max-width: 640px;
}

/* ─── BLOG / POSTS ───────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card__img {
  height: 200px;
  background: var(--gray-soft);
  overflow: hidden;
}

.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card__img img {
  transform: scale(1.03);
}

.post-card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card__cat {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-primary);
  margin-bottom: 0.625rem;
}

.post-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-border);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ─── CTA FINAL ──────────────────────────────────────────────── */
.cta-final {
  background: var(--bg-white);
  border-top: 1px solid var(--gray-border);
}

.cta-final__inner {
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
}

.cta-final__title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  color: var(--text-on-dark);
  margin-bottom: 1.25rem;
  max-width: 640px;
  margin-inline: auto;
}

.cta-final__desc {
  color: var(--text-on-dark-2);
  font-size: var(--text-lg);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.cta-final__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.cta-final__footnote {
  font-size: var(--text-sm);
  color: rgba(249,250,251,0.5);
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-2);
  padding-top: var(--space-2xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer__brand-name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: 0.25rem;
}

.footer__brand-sub {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-primary);
  margin-bottom: 1rem;
}

.footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--text-on-dark-2);
  line-height: 1.7;
  max-width: 300px;
}

.footer__col-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-on-dark);
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--text-on-dark-2);
  transition: color var(--transition);
}

.footer__links a:hover { color: var(--green-primary); }

.footer__bottom {
  padding-block: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__copy {
  font-size: var(--text-sm);
  color: rgba(249,250,251,0.4);
}

.footer__legal {
  display: flex;
  gap: 1.5rem;
}

.footer__legal a {
  font-size: var(--text-sm);
  color: rgba(249,250,251,0.4);
  transition: color var(--transition);
}

.footer__legal a:hover { color: var(--text-on-dark-2); }

/* ─── RESPONSIVE COMPONENTS ──────────────────────────────────── */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .metodologia__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .diferencial__grid {
    grid-template-columns: 1fr;
  }

  .diferencial__visual { display: none; }
}

@media (max-width: 768px) {
  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav__hamburger { display: flex; }

  .servicios-grid,
  .blog-grid,
  .metodologia__grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-final__inner {
    padding: 2.5rem 1.5rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─── SUBMENÚ NAV ────────────────────────────────────────────── */
.nav__dropdown {
  position: relative;
}

.nav__link--dropdown {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.nav__submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: var(--bg-white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  transition-delay: 0s;
  z-index: 200;
}

/* Delay para que no desaparezca inmediatamente al salir */
.nav__dropdown:not(:hover) .nav__submenu:not(.open) {
  transition-delay: 0.15s;
}

.nav__dropdown:hover .nav__submenu,
.nav__submenu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* Área invisible que cubre el gap entre botón y submenú */
.nav__dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 16px;
  background: transparent;
  display: none;
}
.nav__dropdown:hover::after {
  display: block;
}

.nav__submenu-item {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav__submenu-item:hover {
  background: var(--bg-site);
  color: var(--green-primary);
}

.nav__submenu-item--all {
  font-weight: 600;
  color: var(--green-primary);
}

.nav__submenu-divider {
  height: 1px;
  background: var(--gray-border);
  margin: 0.375rem 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE
═══════════════════════════════════════════════════════════════ */

html {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  :root {
    --container-pad: 1rem;
  }

  .servicios-grid,
  .blog-grid,
  .metodologia__grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__actions,
  .cta-final__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn,
  .cta-final__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  [style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }
}