/* Header with 7 tabs (Inicio, Guía App, Turismo, Historia, Galería, Eventos, Privacidad).
   Loaded last so it wins over the older per-feature header tweaks. */

/* PC up to ~1320px: tighten tabs and show flags only in the language switch,
   so logo + language + ¿Sabías que? + 7 tabs stay on one row. */
@media (min-width: 769px) and (max-width: 1320px) {
  #main-header .nav-actions { gap: 10px; }
  #main-header .lang-btn { padding: 6px 8px; }
  #main-header .lang-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  #main-header .tabs-wrapper .tab-btn {
    padding: 6px 9px;
    gap: 6px;
    font-size: 12.5px;
  }
}

@media (min-width: 769px) and (max-width: 1120px) {
  #main-header .logo-text p { display: none; }
  #main-header .tabs-wrapper .tab-btn {
    padding: 6px 8px;
    gap: 5px;
    font-size: 12px;
  }
  #main-header .tabs-wrapper .tab-btn svg { width: 14px; height: 14px; }
}

@media (min-width: 769px) and (max-width: 960px) {
  #main-header .logo-text { display: none; }
  #main-header .tabs-wrapper .tab-btn svg { display: none; }
  #main-header .tabs-wrapper .tab-btn { padding: 6px 9px; }
}

/* Phone / small tablet: balanced 4 + 3 grid under the logo row. */
@media (max-width: 768px) {
  #main-header .tabs-wrapper {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border-radius: 16px;
  }

  #main-header .tabs-wrapper .tab-btn {
    grid-column: span 3;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    min-width: 0;
    gap: 4px;
    padding: 6px 2px;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0;
    border-radius: 12px;
    white-space: nowrap;
  }

  #main-header .tabs-wrapper .tab-btn:nth-child(n+5) {
    grid-column: span 4;
  }

  #main-header .tabs-wrapper .tab-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #main-header .tabs-wrapper .tab-btn svg {
    display: block;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
  }

  #main-header.scrolled .tabs-wrapper .tab-btn {
    padding: 4px 2px;
    font-size: 10.5px;
  }

  #main-header.scrolled .tabs-wrapper .tab-btn svg {
    display: none;
  }
}

@media (max-width: 374px) {
  #main-header .tabs-wrapper .tab-btn {
    font-size: 10.5px;
    gap: 3px;
  }
  #main-header .tabs-wrapper .tab-btn svg {
    width: 12px;
    height: 12px;
  }
}
