:root {
  --navy: #17233B;
  --blue: #2C4A70;
  --red: #A62B2B;
  --white: #FFFFFF;
  --blue-light: #EDF2F8;
  --blue-soft: #F4F7FA;
  --warm: #F8F7F5;
  --red-light: #F8EEEE;
  --line: #E2E7ED;
  --silver: #C5CED9;
  --silver-light: #EEF2F6;
  --silver-dark: #8796A9;

  --blue-metal: linear-gradient(135deg, #203653 0%, #496789 32%, #2C4A70 58%, #1B304B 100%);
  --blue-metal-hover: linear-gradient(135deg, #496789 0%, #365879 48%, #203653 100%);
  --red-metal: linear-gradient(135deg, #7F202B 0%, #B85B62 48%, #8D2632 100%);
  --shadow: 0 8px 25px rgba(23,35,59,.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--navy);
  background: var(--white);
  font-family: Inter, system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s;
}

.site-header.scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  width: min(1440px, calc(100% - 56px));
  min-height: 88px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  transition: min-height .2s;
}

.site-header.scrolled .header-inner {
  min-height: 72px;
}

/* LOGOTIPO */

.brand {
  flex: 0 0 190px;
  display: flex;
  align-items: center;
}

.site-logo {
  display: block;
  width: 178px;
  height: 54px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* MENÚ PRINCIPAL */

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, .65vw, 10px);
  flex: 1;
  white-space: nowrap;
}

.main-nav a {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid rgba(197,206,217,.65);
  border-radius: 7px;
  color: var(--white);
  background: var(--blue-metal);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.24),
    0 3px 8px rgba(23,35,59,.14);
  font-size: 12px;
  font-weight: 650;
  transition: .25s;
}

.main-nav a:hover {
  color: var(--white);
  background: var(--blue-metal-hover);
  border-color: var(--silver);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    0 5px 12px rgba(23,35,59,.19);
  transform: translateY(-1px);
}

/* REFLEJO METÁLICO DEL MENÚ */

.main-nav a::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  pointer-events: none;
}

.main-nav a:hover::after {
  left: 150%;
}

/* DIRECTORIO: MISMO ESTILO POR AHORA */

.main-nav .directory-link {
  color: var(--white);
  background: var(--blue-metal);
  border-color: rgba(197,206,217,.65);
}

.main-nav .directory-link:hover {
  color: var(--white);
  background: var(--blue-metal-hover);
}

/* ACCIONES DEL HEADER */

.header-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.search-toggle,
.account-link,
.join-button,
.menu-toggle {
  border: 0;
  cursor: pointer;
}

.search-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: transparent;
}

.search-toggle svg {
  width: 19px;
  height: 19px;
}

.account-link {
  font-size: 13px;
  font-weight: 600;
  background: transparent;
}

/* BOTÓN ÚNETE AHORA */

.join-button {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid rgba(197,206,217,.65);
  color: var(--white);
  background: var(--red-metal);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.24),
    0 3px 8px rgba(23,35,59,.14);
  font-size: 13px;
  font-weight: 700;
  transition: .25s;
}

.join-button:hover {
  background: var(--red-metal);
  border-color: var(--silver);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    0 5px 12px rgba(23,35,59,.19);
  transform: translateY(-1px);
}

.join-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  pointer-events: none;
}

.join-button:hover::after {
  left: 150%;
}

/* BUSCADOR */

.search-panel {
  display: none;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: var(--blue-soft);
}

.search-panel.open {
  display: block;
}

.search-form {
  width: min(760px, 100%);
  margin: auto;
  display: flex;
  gap: 10px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.search-form input:focus {
  border-color: var(--blue);
}

.search-form button {
  position: relative;
  overflow: hidden;
  padding: 0 20px;
  border: 1px solid rgba(197,206,217,.65);
  border-radius: 7px;
  color: white;
  background: var(--blue-metal);
  cursor: pointer;
}

.search-form button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  pointer-events: none;
}

.search-form button:hover::after {
  left: 150%;
}

/* ACCESIBILIDAD */

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--silver-dark);
  outline-offset: 3px;
}

/* MENÚ MÓVIL */

.mobile-actions,
.mobile-nav,
.mobile-search {
  display: none;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  padding: 8px;
  color: var(--navy);
  background: transparent;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* ESTRUCTURA GENERAL */

main {
  min-height: 500px;
}

/* HERO */

.hero-placeholder {
  min-height: 430px;
  width: 100%;
  margin-bottom: 45px;
  background: linear-gradient(120deg, #EAF0F7 0%, #F3F5F8 55%, #F8F5F4 100%);
  border-bottom: 1px solid #E7EBF0;
  position: relative;
}

.hero-placeholder::before {
  content: "ESPACIO RESERVADO PARA EL HERO";
  position: absolute;
  top: 22px;
  left: max(28px, calc((100% - 1320px) / 2));
  color: #71819A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

/* ACCESOS RÁPIDOS */

.quick-access-placeholder {
  width: min(1320px, calc(100% - 56px));
  min-height: 210px;
  margin: 0 auto 45px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(145deg, #F7F9FC 0%, #EDF2F8 55%, #F5F7FA 100%);
  border: 1px solid #D5DEE8;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 5px 16px rgba(23,35,59,.035);
  position: relative;
}

.quick-access-placeholder::before {
  content: "ESPACIO RESERVADO PARA ACCESOS RÁPIDOS";
  position: absolute;
  top: 18px;
  left: 20px;
  color: #71819A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

/* CONTENIDO CENTRAL */

.content-placeholder {
  width: min(1320px, calc(100% - 56px));
  min-height: 420px;
  margin: 0 auto 45px;
  padding: 20px;
  border: 1px solid #D8E0E9;
  border-radius: 14px;
  background: linear-gradient(145deg, #FFFFFF 0%, #FCFDFE 72%, #F7F9FB 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 5px 18px rgba(23,35,59,.045);
  position: relative;
}

.content-placeholder::before {
  content: "ÁREA CENTRAL DE CONTENIDO";
  position: absolute;
  top: 18px;
  left: 20px;
  color: #8490A1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

/* COMUNIDAD */

.community-placeholder {
  width: 100%;
  min-height: 190px;
  background: linear-gradient(110deg, #E7EDF5 0%, #F3F5F8 52%, #F7F1F1 100%);
  border-top: 1px solid #D5DEE8;
  border-bottom: 1px solid #E2E7ED;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  position: relative;
}

.community-placeholder::before {
  content: "ESPACIO RESERVADO PARA LA COMUNIDAD";
  position: absolute;
  top: 22px;
  left: max(28px, calc((100% - 1320px) / 2));
  color: #71819A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.community-placeholder::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: var(--red-metal);
  opacity: .9;
  box-shadow: 1px 0 5px rgba(122,32,43,.16);
}

/* FOOTER */

.site-footer {
  padding: 58px 0 26px;
  color: var(--white);
  background: linear-gradient(135deg, #17233B 0%, #203653 52%, #17233B 100%);
  border-top: 1px solid rgba(197,206,217,.3);
}

.footer-inner {
  width: min(1320px, calc(100% - 56px));
  margin: auto;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 36px;
  min-height: 150px;
}

.footer-site-logo {
  display: block;
  width: 180px;
  height: 58px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.footer-column {
  min-height: 100px;
  border-top: 1px solid rgba(197,206,217,.38);
  padding-top: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.footer-description {
  max-width: 270px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  line-height: 1.8;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: linear-gradient(145deg, #385A82, #263F60);
  border: 1px solid rgba(197,206,217,.55);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  transition: .25s ease;
}

.footer-social a:hover {
  background: linear-gradient(145deg, #496D96, #304D70);
  border-color: #D7DFE8;
  transform: translateY(-2px);
}

.footer-social svg {
  width: 19px;
  height: 19px;
  display: block;
}

.footer-heading {
  margin: 0 0 17px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  width: fit-content;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s ease;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  line-height: 1.7;
}

.footer-credit strong {
  color: #FFFFFF;
  font-weight: 600;
}

.footer-bottom {
  width: min(1320px, calc(100% - 56px));
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.65);
  font-size: 12px;
}

/* TABLET */

@media (max-width: 1180px) {
  .header-inner {
    width: calc(100% - 36px);
    gap: 12px;
  }

  .brand {
    flex-basis: 145px;
  }

  .site-logo {
    width: 140px;
  }

  .main-nav {
    gap: 5px;
  }

  .main-nav a {
    min-height: 36px;
    padding: 0 8px;
    font-size: 11px;
  }

  .header-actions {
    gap: 9px;
  }

  .join-button {
    padding: 0 13px;
  }
}

/* MÓVIL */

@media (max-width: 980px) {
  .header-inner {
    justify-content: space-between;
  }

  .brand {
    flex: 1;
  }

  .main-nav,
  .desktop-actions {
    display: none;
  }

  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-nav {
    display: none;
    padding: 12px 22px 22px;
    border-top: 1px solid var(--line);
    background: var(--blue-soft);
  }

  .mobile-nav.open {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .mobile-nav a {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 43px;
    padding: 0 14px;
    border: 1px solid rgba(197,206,217,.65);
    border-radius: 7px;
    color: var(--white);
    background: var(--blue-metal);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.24),
      0 3px 8px rgba(23,35,59,.14);
    font-size: 14px;
    font-weight: 650;
    transition: .2s;
  }

  .mobile-nav a:hover {
    background: var(--blue-metal-hover);
    border-color: var(--silver);
  }

  .mobile-nav a.directory-link {
    margin: 0;
    padding: 0 14px;
    color: var(--white);
    background: var(--blue-metal);
    border-color: rgba(197,206,217,.65);
  }

  .mobile-nav .join-button {
    width: 100%;
    margin-top: 5px;
    justify-content: center;
    color: white;
    background: var(--red-metal);
    border-color: rgba(197,206,217,.65);
  }

  .mobile-search {
    display: none;
    padding: 0 22px 18px;
    background: var(--blue-soft);
  }

  .mobile-search.open {
    display: block;
  }

  .hero-placeholder {
    min-height: 350px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* TELÉFONOS */

@media (max-width: 600px) {
  .header-inner {
    width: calc(100% - 32px);
    min-height: 74px;
  }

  .site-logo {
    width: 150px;
  }

  .quick-access-placeholder,
  .content-placeholder {
    width: calc(100% - 32px);
    margin-bottom: 30px;
  }

  .quick-access-placeholder {
    min-height: 180px;
  }

  .content-placeholder {
    min-height: 340px;
  }

  .hero-placeholder {
    min-height: 300px;
    margin-bottom: 30px;
  }

  .community-placeholder {
    min-height: 160px;
  }

  .footer-inner,
  .footer-bottom {
    width: calc(100% - 32px);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    min-height: 44px;
  }
}
