/* ============================================
   HEADER TIPO CAMPOSOL - ESTILOS ORIGINALES
   ============================================ */

/* Variables de colores corporativos */
:root {
  --pa-verde: #a9c253;
  --pa-azul: #3c6980;
}

/* HEADER PRINCIPAL - Fondo azul oscuro */
.site-header {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
}

/* Topbar blanco con elementos decorativos */
.topbar {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

/* Contenedor interno centrado */
.header-inner {
  max-width: 1250px;
  margin: 0 auto;
  padding: 5px 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* Logo grande a la izquierda */
.container-left {
  display: flex;
  align-items: center;
  margin-left: -59px;
}

.logo-link {
  display: inline-block;
}

.logo {
  height: 98px;
  width: auto;
  display: block;
}

/* Elementos a la derecha */
.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Enlaces superiores */
.top-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-links a {
  color: #333333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.top-links a:hover {
  color: #3c6980;
}

/* Iconos sociales */
.social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-icons .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: #333333;
  border: 1px solid rgba(0, 0, 0, 0.15);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.social-icons .icon:hover {
  background: #3c6980;
  border-color: #3c6980;
  color: #ffffff;
  transform: scale(1.1);
}

.social-icons .icon svg {
  width: 22px;
  height: 22px;
}

/* Selector de idioma - Banderas en fila al centro */
.language-flags {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.flag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.flag-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.flag-btn.active {
  opacity: 1;
  border-color: #a9c353;
  box-shadow: 0 2px 8px rgba(169, 195, 83, 0.3);
}

.flag-btn img {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Botón de menú hamburguesa (3 rayitas) */
.menu-dots {
  background: none;
  border: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.menu-dots span {
  display: block;
  width: 29px;
  height: 4px;
  background: #aac353;
  border-radius: 2px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.menu-dots:hover {
  transform: scale(1.05);
}

.menu-dots:hover span {
  background: #8fa042;
}

/* Forma decorativa - deshabilitada */
.header-decoration-right {
  display: none;
}

/* Contenedor de ramas decorativas del header */
.header-leaves {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Rama izquierda */
.header-leaf-1 {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 120px;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80' fill='none'%3E%3Cpath d='M0 40 Q30 35 50 45 T90 40 T120 35' stroke='%23a9c353' stroke-width='2' fill='none' opacity='0.15'/%3E%3Cpath d='M50 45 Q55 30 65 25' stroke='%23a9c353' stroke-width='1.5' fill='none' opacity='0.12'/%3E%3Cpath d='M70 42 Q75 55 85 58' stroke='%23a9c353' stroke-width='1.5' fill='none' opacity='0.12'/%3E%3Cellipse cx='65' cy='25' rx='8' ry='5' fill='%23a9c353' opacity='0.1' transform='rotate(-20 65 25)'/%3E%3Cellipse cx='85' cy='58' rx='7' ry='4' fill='%23a9c353' opacity='0.1' transform='rotate(15 85 58)'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Hoja centro-izquierda */
.header-leaf-2 {
  position: absolute;
  left: 30%;
  top: 20%;
  width: 30px;
  height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a9c353'%3E%3Cpath d='M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.08;
  transform: rotate(-25deg);
}

/* Hoja centro */
.header-leaf-3 {
  position: absolute;
  left: 50%;
  bottom: 15%;
  transform: translateX(-50%) rotate(15deg);
  width: 25px;
  height: 25px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a9c353'%3E%3Cpath d='M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.06;
}

/* Hoja centro-derecha */
.header-leaf-4 {
  position: absolute;
  right: 32%;
  top: 30%;
  width: 22px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a9c353'%3E%3Cpath d='M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.07;
  transform: rotate(40deg);
}

/* Oculta */
.header-leaf-6 {
  display: none;
}

/* Rama derecha */
.header-leaf-5 {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%) scaleX(-1);
  width: 120px;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80' fill='none'%3E%3Cpath d='M0 40 Q30 35 50 45 T90 40 T120 35' stroke='%23a9c353' stroke-width='2' fill='none' opacity='0.15'/%3E%3Cpath d='M50 45 Q55 30 65 25' stroke='%23a9c353' stroke-width='1.5' fill='none' opacity='0.12'/%3E%3Cpath d='M70 42 Q75 55 85 58' stroke='%23a9c353' stroke-width='1.5' fill='none' opacity='0.12'/%3E%3Cellipse cx='65' cy='25' rx='8' ry='5' fill='%23a9c353' opacity='0.1' transform='rotate(-20 65 25)'/%3E%3Cellipse cx='85' cy='58' rx='7' ry='4' fill='%23a9c353' opacity='0.1' transform='rotate(15 85 58)'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Línea verde separadora tipo Camposol */
.green-line {
  height: 6px;
  background: #a9c353;
  width: 100%;
}

/* MEGA MENÚ FULLSCREEN DESDE ARRIBA */
.mega-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1003;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(10px);
  color: #fff;
  overflow: auto;
}

.mega-inner {
  max-width: 1100px;
  margin: 40px auto;
  padding: 40px;
  position: relative;
}

.close-mega {
  position: absolute;
  right: 20px;
  top: 20px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}

.close-mega:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #a9c453;
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-top: 60px;
}

.mega-grid h3 {
  margin-top: 0;
  color: #a9c453;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(169, 196, 83, 0.3);
}

.mega-grid ul {
  list-style: none;
  padding: 0;
}

.mega-grid li {
  margin-bottom: 12px;
}

.mega-grid a {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  display: block;
  padding: 8px 0;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mega-grid a:hover {
  color: #a9c453;
  padding-left: 12px;
}

/* RESPONSIVE */

/* Tablet Landscape */
@media (max-width: 1024px) {
  .header-inner {
    padding: 10px 20px;
  }

  .container-left {
    margin-left: -30px;
  }

  .logo {
    height: 75px;
  }

  .top-links a {
    font-size: 13px;
  }

  .social-icons .icon {
    width: 32px;
    height: 32px;
  }

  .social-icons .icon svg {
    width: 18px;
    height: 18px;
  }
}

/* Tablet Portrait */
@media (max-width: 768px) {
  .header-inner {
    padding: 8px 15px;
  }

  .container-left {
    margin-left: 0;
  }

  .logo {
    height: 86px;
  }

  .top-links {
    display: none;
  }

  .social-icons {
    display: none;
  }

  /* Selector de idioma en tablet - más a la derecha */
  .language-flags {
    left: auto;
    right: 80px;
    transform: none;
    gap: 6px;
  }

  .flag-btn img {
    width: 24px;
    height: 17px;
  }

  .menu-dots {
    padding: 10px;
  }

  .menu-dots span {
    width: 26px;
    height: 3px;
  }

  .green-line {
    height: 4px;
  }

  /* Mega menú adaptado para tablet */
  .mega-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .mega-inner {
    padding: 25px 20px;
    margin: 20px auto;
  }

  .mega-grid h3 {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .mega-grid a {
    font-size: 15px;
    padding: 6px 0;
  }

  /* Ocultar decoraciones en tablet/móvil */
  .topbar::before,
  .topbar::after,
  .header-decoration-right,
  .header-leaves {
    display: none;
  }
}

/* Móvil */
@media (max-width: 576px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .topbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .header-inner {
    padding: 8px 12px;
    min-height: 70px;
  }

  .logo {
    height: 71px;
  }

  .top-right {
    gap: 8px;
  }

  /* Selector de idioma en móvil - más a la derecha */
  .language-flags {
    left: auto;
    right: 60px;
    transform: none;
    gap: 5px;
  }

  .flag-btn {
    padding: 3px;
  }

  .flag-btn img {
    width: 22px;
    height: 16px;
  }

  .menu-dots {
    padding: 12px 8px;
    gap: 5px;
  }

  .menu-dots span {
    width: 24px;
    height: 3px;
    border-radius: 2px;
  }

  .green-line {
    height: 3px;
  }

  /* Mega menú full screen en móvil */
  .mega-overlay {
    padding-top: 60px;
  }

  .mega-inner {
    padding: 20px 15px;
    margin: 0;
  }

  .close-mega {
    right: 15px;
    top: 15px;
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .mega-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }

  .mega-grid h3 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .mega-grid li {
    margin-bottom: 8px;
  }

  .mega-grid a {
    font-size: 16px;
    padding: 10px 0;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mega-grid li:last-child a {
    border-bottom: none;
  }
}

/* Móvil pequeño */
@media (max-width: 400px) {
  .header-inner {
    padding: 6px 10px;
    min-height: 65px;
  }

  .logo {
    height: 62px;
  }

  .menu-dots span {
    width: 22px;
    height: 2.5px;
  }
}

/* Espaciado para contenido debajo del header - Eliminado porque header es relative */
