/* =========================
   RESET BASICO
========================= */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =========================
   TOPBAR
========================= */
.topbar {
  background: #5fa0c8;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* IZQ | CENTRO | DER */
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}
.topbar__center {
  text-align: center;
  justify-self: center;
}

.topbar__message {
  font-weight: 500;
  letter-spacing: 0.2px;
}

.topbar__right {
  justify-self: end;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}


.topbar__right a:hover { opacity: 1; }

.topbar__account {
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
}

/* Iconos redes (SVG inline) */
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.social:hover svg {
  transform: scale(1.08);
}

/* =========================
   NAV / MEGA MENU
========================= */
.nav {
  background: #f7f0ea; /* crema */
  border-bottom: 1px solid #eee;
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.nav__brand {
  text-decoration: none;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
}

.nav__link {
  color: #111;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__link--btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.nav__caret { opacity: 0.7; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav__icon {
  text-decoration: none;
  color: #111;
  font-size: 1.05rem;
  position: relative;
}

.nav__badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #111;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Mega */
.nav__item--mega { position: relative; }

.mega {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 14px);
  width: min(1200px, calc(100vw - 2rem));
  background: #f7f0ea;
  border: 1px solid #eadfd6;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  display: none;
  z-index: 999;
}

.mega.is-open { display: block; }

.mega__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 2fr;
  gap: 2rem;
  align-items: start;
}

.mega__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
}

.mega__a {
  display: block;
  text-decoration: none;
  color: #111;
  opacity: 0.9;
  padding: 0.25rem 0;
  font-size: 0.92rem;
}

.mega__a:hover { opacity: 1; text-decoration: underline; }

/* Promo cards */
.mega__promo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.mega__promoCard {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.mega__promoImg {
  max-width: 220px;
  height: auto;
}

.mega__promoTitle {
  font-weight: 800;
  letter-spacing: 0.5px;
}

.mega__btn {
  display: inline-block;
  text-decoration: none;
  background: #5fa0c8;
  color: #fff;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1000px) {
  .mega__grid {
    grid-template-columns: 1fr 1fr;
  }
  .mega__promo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .nav__inner {
    grid-template-columns: 1fr auto;
  }
  .nav__menu {
    display: none; /* después hacemos menú móvil si quieres */
  }
}


/* =========================
   MOBILE
========================= */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
}

@media (max-width: 900px) {
  .header-main {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .header-main__actions { justify-content: center; }

  .menu {
    display: none;
    flex-direction: column;
  }

  .menu.is-open { display: flex; }

  .nav-toggle { display: block; }
}

@media (max-width: 768px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    text-align: center;
  }

  .topbar__right {
    justify-self: center;
    justify-content: center;
  }
}
