/* ============================================================ */
/* ===== RESET Y BASE ===== */
/* ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
}

/* ============================================================ */
/* ===== HEADER - ANCHO COMPLETO ===== */
/* ============================================================ */

header {
  z-index: 1000;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
  width: auto;
  margin: 14px 16px 25px 16px;
  border-radius: 24px;
  overflow: visible;
  transition: box-shadow 0.3s ease;
}

.header-container {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}

/* ===== LOGO - Izquierda con fondo #005198 ===== */
.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: linear-gradient(135deg, #0b3d78 0%, #005198 45%, #1f6fb8 100%);
  flex-shrink: 0;
  min-width: 160px;
  border-radius: 24px 0 0 24px;
  position: relative;
  overflow: hidden;
}

.logo-wrapper::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -35%;
  width: 55%;
  height: 220%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(22deg);
  pointer-events: none;
  transition: left 0.6s ease;
}

.logo-wrapper:hover::before {
  left: 130%;
}

.logo {
  display: block;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.logo img {
  height: 95px;
  width: auto;
  display: block;
}

/* ===== MENÚS - Derecha (ocupa el resto del ancho) ===== */
.menus-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  overflow: visible;
}

/* ===== FILA 1 - Fondo #26314d ===== */
.header-top {
  background-color: #26314d;
  padding: 8px 25px;
  flex: 1;
  width: 100%;
  border-radius: 0 24px 0 0;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

/* ===== REDES SOCIALES ===== */
.social-icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: 50%;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: #ffffff;
  color: #26314d;
  transform: translateY(-2px);
}

/* ===== MENÚ SUPERIOR ===== */
.nav-top ul {
  display: flex;
  list-style: none;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-top ul li a {
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s;
  white-space: nowrap;
}

.nav-top ul li a:hover {
  color: #B8CDDE;
}

.nav-top ul li a.btn-login {
  background: #3ddc84;
  color: #ffffff !important;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.3s;
}

.nav-top ul li a.btn-login:hover {
  background: #2ecc71;
  color: #ffffff !important;
}

/* ============================================================ */
/* ===== MENÚ PRINCIPAL (MENU2) ===== */
/* ============================================================ */

.header-bottom {
  background-color: #ffffff;
  padding: 10px 25px;
  border-bottom: 3px solid #005198;
  flex: 1;
  width: 100%;
  overflow: visible;
  border-radius: 0 0 24px 0;
}

.header-bottom-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  overflow: visible;
}

.nav-main {
  width: 100%;
  overflow: visible;
}

/* Estilos base del menú - HORIZONTAL en desktop */
.nav-main ul.main-menu {
  display: flex !important;
  list-style: none;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.main-menu > li {
  position: relative;
  flex-shrink: 0;
}

.main-menu > li > a {
  color: #000000;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
  padding: 5px 8px;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  line-height: 1.2;
}

.main-menu > li > a:hover {
  color: #005198;
  border-bottom-color: #005198;
}

.main-menu > li > a .menu-arrow {
  font-size: 9px;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.main-menu > li:hover > a .menu-arrow {
  transform: rotate(180deg);
}

/* ===== ITEMS QUE VAN EN DOS LÍNEAS ===== */
.main-menu > li.menu-instalaciones > a {
  white-space: normal;
  flex-wrap: wrap;
  justify-content: center;
  width: 72px;
}

.main-menu > li.menu-acerca > a {
  white-space: normal;
  flex-wrap: wrap;
  justify-content: center;
  width: 72px;
}

.main-menu > li.menu-memoria > a {
  white-space: normal;
  flex-wrap: wrap;
  justify-content: center;
  width: 72px;
}

/* ===== BOTÓN SAM ===== */
.main-menu > li > a.btn-sam {
  background: #005198;
  color: #ffffff !important;
  padding: 6px 18px;
  border-radius: 25px;
  font-weight: 700;
  border-bottom: none !important;
  transition: all 0.3s;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
}

.main-menu > li > a.btn-sam:hover {
  background: #26314d;
  color: #ffffff !important;
  border-bottom: none !important;
}

/* ============================================================ */
/* ===== SUBMENÚ - CON IMÁGENES (VERTICAL) ===== */
/* ============================================================ */

.sub-menu {
  display: none !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: #ffffff !important;
  padding: 10px 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25) !important;
  list-style: none !important;
  z-index: 9999 !important;
  border-top: 3px solid #005198 !important;
  min-width: 260px !important;
  width: auto !important;
}

/* Mostrar submenú al hacer hover */
.main-menu > li:hover > .sub-menu {
  display: block !important;
}

/* ===== ITEMS DEL SUBMENÚ - CON IMAGEN Y TEXTO ===== */
.sub-menu li {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sub-menu li a {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
  color: #1a1a1a !important;
  padding: 8px 14px !important;
  transition: background 0.3s !important;
}

.sub-menu li a:hover {
  background: #f0f7ff !important;
}

/* ===== IMAGEN DEL SUBMENÚ ===== */
.sub-menu-img {
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.sub-menu-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* ===== TEXTO DEL SUBMENÚ ===== */
.sub-menu-info {
  flex: 1 !important;
  min-width: 0 !important;
}

.sub-menu-info h3 {
  color: #005198 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.sub-menu-info p {
  color: #555 !important;
  font-size: 11px !important;
  margin: 2px 0 0 0 !important;
  line-height: 1.3 !important;
  /* Sin -webkit-line-clamp para evitar errores */
}

/* ============================================================ */
/* ===== SUBMENÚS A LA DERECHA ===== */
/* ============================================================ */

/* Nuestras Instalaciones - a la derecha */
.main-menu > li.menu-instalaciones-derecha > .sub-menu {
  left: auto !important;
  right: 0 !important;
}

/* Secciones - a la derecha */
.main-menu > li.menu-secciones-derecha > .sub-menu {
  left: auto !important;
  right: 0 !important;
}

/* Comités, Memoria Técnica, Anuncios, SAM - a la derecha */
.main-menu > li:nth-last-child(-n + 4) > .sub-menu {
  left: auto !important;
  right: 0 !important;
}

/* ============================================================ */
/* ===== MENÚ HAMBURGUESA ===== */
/* ============================================================ */

.hamburger-menu {
  display: none;
  background: #005198;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.3s;
}

.hamburger-menu:hover {
  background: #26314d;
  color: #ffffff;
}

/* ============================================================ */
/* ===== PIE DE PÁGINA ===== */
/* ============================================================ */

.site-footer {
  background: #005198;
  color: #ffffff;
  padding: 25px 0 0 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 20px 20px;
  display: flex;
  gap: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
  flex: 0 0 22%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo img {
  max-width: 130px;
  height: auto;
  display: block;
}

.footer-links {
  flex: 1;
}

.footer-links h3,
.footer-contact h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
  position: relative;
}

.footer-links h3::after,
.footer-contact h3::after {
  content: "";
  display: block;
  width: 25px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  margin-top: 6px;
  border-radius: 2px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.footer-links ul li {
  margin-bottom: 6px;
}

.footer-links ul li a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s;
}

.footer-links ul li a:hover {
  color: #ffffff;
}

.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 3px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 50%;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-2px);
}

.footer-contact {
  flex: 1;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.footer-contact-item i {
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.footer-contact-item a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s;
}

.footer-contact-item a:hover {
  color: #ffffff;
}

/* ===== COLUMNA SAM ===== */
.footer-sam {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.footer-sam-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
  position: relative;
  font-family: inherit;
}

.footer-sam-toggle span {
  line-height: 1.2;
}

.footer-sam-toggle::after {
  content: "";
  display: block;
  width: 25px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  margin-top: 6px;
  border-radius: 2px;
}

.footer-sam-toggle i {
  font-size: 12px;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.footer-sam-content {
  display: none;
  flex-direction: column;
  align-items: center;
}

.footer-sam:hover .footer-sam-content,
.footer-sam.active .footer-sam-content {
  display: flex;
}

.footer-sam.active .footer-sam-toggle i {
  transform: rotate(180deg);
}

.footer-sam-img {
  max-width: 160px;
  margin: 0 0 12px 0;
}

.footer-sam-img img {
  width: 100%;
  height: auto;
  display: block;
}

.footer-sam-btn {
  display: inline-block;
  background: #3ddc84;
  color: #ffffff !important;
  padding: 8px 24px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.3s;
}

.footer-sam-btn:hover {
  background: #2ecc71;
}

.footer-bottom {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 20px;
  text-align: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  margin: 0;
}

/* ============================================================ */
/* ===== RESPONSIVE GLOBAL ===== */
/* ============================================================ */

/* Tablets */
@media (max-width: 992px) {
  .header-container {
    flex-direction: column;
  }

  .logo-wrapper {
    min-width: 100%;
    padding: 10px;
    width: 100%;
    border-radius: 20px 20px 0 0;
  }

  .menus-wrapper {
    border-radius: 0;
  }

  .header-top {
    border-radius: 0;
  }

  .header-bottom {
    border-radius: 0 0 20px 20px;
  }

  .logo {
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .header-top {
    padding: 8px 15px;
  }

  .header-bottom {
    padding: 8px 15px;
  }

  .header-top-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .social-icons {
    justify-content: center;
  }

  .nav-top ul {
    justify-content: center;
    gap: 15px;
  }

  .header-bottom-row {
    justify-content: center;
  }

  .nav-main ul.main-menu {
    justify-content: center;
    gap: 12px;
  }

  .footer-container {
    flex-wrap: wrap;
    gap: 25px;
  }

  .footer-logo {
    flex: 0 0 100%;
    justify-content: center;
    padding-bottom: 5px;
  }

  .footer-logo img {
    max-width: 90px;
  }

  .footer-links,
  .footer-contact,
  .footer-sam {
    flex: 1;
    min-width: 150px;
  }
}

/* Móviles */
@media (max-width: 768px) {
  header {
    margin: 8px 10px 18px 10px;
    border-radius: 16px;
  }

  .logo-wrapper {
    padding: 8px;
    border-radius: 16px 16px 0 0;
  }

  .logo img {
    height: 60px;
  }

  .header-top {
    border-radius: 0;
  }

  .header-bottom {
    border-radius: 0 0 16px 16px;
  }

  .logo img {
    height: 50px;
  }

  .header-top {
    padding: 8px 10px;
  }

  .header-bottom {
    padding: 8px 10px;
  }

  .nav-top ul li a {
    font-size: 12px;
  }

  .header-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-top {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-top::-webkit-scrollbar {
    display: none;
  }

  .nav-top ul {
    justify-content: flex-start;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 8px;
    padding-bottom: 4px;
    width: max-content;
  }

  .nav-top ul li {
    flex-shrink: 0;
  }

  .nav-top ul li a {
    font-size: 12px;
    padding: 4px 8px;
  }

  .header-bottom-row {
    justify-content: center;
  }

  .nav-main ul.main-menu {
    display: none !important;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 15px 0;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .nav-main ul.main-menu.active {
    display: flex !important;
  }

  .main-menu > li {
    width: 100%;
    text-align: center;
    flex-shrink: 1;
  }

  .main-menu > li > a {
    font-size: 14px;
    justify-content: center;
    border-bottom: none;
    padding: 8px 0;
    white-space: nowrap;
    flex-wrap: nowrap;
    width: auto;
  }

  .main-menu > li > a .menu-arrow {
    font-size: 12px;
    margin-left: 5px;
  }

  .main-menu > li.active > a .menu-arrow {
    transform: rotate(180deg);
  }

  .main-menu > li.menu-instalaciones > a,
  .main-menu > li.menu-acerca > a,
  .main-menu > li.menu-memoria > a {
    white-space: nowrap;
    flex-wrap: nowrap;
    width: auto;
  }

  /* Submenú en móvil - se vuelve vertical */
  .sub-menu {
    position: static !important;
    min-width: 100% !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: 3px solid #005198 !important;
    border-radius: 0 !important;
    padding: 5px 0 !important;
    margin-top: 5px !important;
    background: #f8f9fa !important;
    display: none !important;
  }

  .main-menu > li.active > .sub-menu {
    display: block !important;
  }

  .sub-menu li a {
    padding: 8px 14px !important;
  }

  .hamburger-menu {
    display: block;
    margin: 5px auto;
  }

  .btn-login,
  .btn-sam {
    padding: 5px 15px;
    font-size: 12px;
  }

  .site-footer {
    padding: 20px 0 0 0;
  }

  .footer-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px 20px 15px;
  }

  .footer-logo {
    flex: 1;
  }

  .footer-logo img {
    max-width: 90px;
  }

  .footer-links h3,
  .footer-contact h3,
  .footer-sam-toggle {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .footer-links ul li a,
  .footer-contact-item a {
    font-size: 12px;
  }

  .footer-links ul li {
    margin-bottom: 5px;
  }

  .footer-social {
    gap: 8px;
  }

  .footer-social a {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .footer-contact-item {
    gap: 8px;
    margin-bottom: 5px;
  }

  .footer-contact-item i {
    font-size: 13px;
    width: 16px;
  }

  .footer-bottom {
    padding: 8px 15px;
  }

  .footer-bottom p {
    font-size: 11px;
  }
}

@media (min-width: 769px) {
  .nav-main ul.main-menu {
    display: flex !important;
  }

  .main-menu > li:hover > .sub-menu {
    display: block !important;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .logo img {
    height: 48px;
  }

  .nav-top ul {
    gap: 8px;
  }

  .nav-top ul li a {
    font-size: 11px;
  }

  .social-icons a {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .btn-login,
  .btn-sam {
    padding: 4px 12px;
    font-size: 11px;
  }

  .main-menu > li > a {
    font-size: 13px;
  }

  .sub-menu li a {
    padding: 6px 12px !important;
    font-size: 13px !important;
  }

  .sub-menu-img {
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 30px !important;
  }

  .sub-menu-info h3 {
    font-size: 12px !important;
  }

  .sub-menu-info p {
    font-size: 10px !important;
  }

  .footer-container {
    gap: 15px;
    padding: 0 15px 15px 15px;
  }

  .footer-logo img {
    max-width: 80px;
  }

  .footer-links h3,
  .footer-contact h3,
  .footer-sam-toggle {
    font-size: 13px;
  }

  .footer-links ul li a,
  .footer-contact-item a {
    font-size: 11px;
  }

  .footer-social a {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .footer-contact-item i {
    font-size: 12px;
    width: 14px;
  }

  .footer-bottom p {
    font-size: 10px;
  }
}
