/* =============================================================================
   TMZ - cabecera (header)
   Sustituye a la cabecera del tema Avada. Marcado: <header class="tmz-header">
   Escritorio: barra de contacto + logo / menu / idiomas.
   Movil (<= 1200px): logo / idiomas / boton hamburguesa con panel desplegable.
   ========================================================================== */

.tmz-header {
  --tmz-red: #e00;
  --tmz-ink: #1d1d1d;
  --tmz-line: #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 9990;
  background: #fff;
  color: var(--tmz-ink);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  border-bottom: 1px solid var(--tmz-line);
  transition: box-shadow .2s ease;
}

.tmz-header.is-scrolled {
  box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}

.tmz-header *,
.tmz-header *::before,
.tmz-header *::after {
  box-sizing: border-box;
}

.tmz-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tmz-header li {
  margin: 0;
  padding: 0;
}

.tmz-header a {
  color: inherit;
  text-decoration: none;
}

.tmz-header img {
  display: block;
  max-width: 100%;
  height: auto;
}

.tmz-wrap {
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.tmz-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* enlace "saltar al contenido" (visible solo con foco de teclado) */
.tmz-skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 12px 18px;
  background: var(--tmz-red);
  color: #fff !important;
  font-weight: 700;
  border-radius: 0 0 6px 6px;
}

.tmz-skip:focus {
  top: 0;
}

/* ---- barra superior de contacto ------------------------------------------ */
.tmz-topbar {
  background: #262626;
  color: #e6e6e6;
  font-size: 13px;
}

.tmz-topbar .tmz-wrap {
  justify-content: flex-end;
  gap: 8px 28px;
  min-height: 36px;
}

.tmz-topbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  transition: color .15s ease;
}

.tmz-topbar a:hover,
.tmz-topbar a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--tmz-red);
  text-underline-offset: 4px;
}

.tmz-topbar i {
  color: var(--tmz-red);
  font-size: 12px;
}

/* ---- barra principal ------------------------------------------------------ */
.tmz-mainbar .tmz-wrap {
  min-height: 84px;
  gap: 24px;
}

.tmz-logo {
  flex: 0 0 auto;
  line-height: 0;
}

.tmz-logo img {
  width: 128px;
}

.tmz-nav {
  flex: 1 1 auto;
}

.tmz-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.tmz-menu > li {
  position: relative;
}

.tmz-menu > li > a,
.tmz-menu > li > .tmz-sub-toggle {
  white-space: nowrap;
}

.tmz-has-sub {
  display: flex;
  align-items: center;
}

.tmz-menu > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.tmz-menu > li > a:hover,
.tmz-menu > li > a:focus-visible,
.tmz-menu > li.is-current > a,
.tmz-menu > li > a[aria-current="page"] {
  color: var(--tmz-red);
  border-bottom-color: var(--tmz-red);
}

/* boton de submenu: flecha */
.tmz-sub-toggle {
  position: relative;
  width: 28px;
  height: 48px;
  margin: 0 0 0 -10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tmz-sub-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -6px 0 0 -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.tmz-sub-toggle[aria-expanded="true"]::before {
  margin-top: -2px;
  transform: rotate(-135deg);
}

.tmz-has-sub:hover > .tmz-sub-toggle,
.tmz-has-sub.is-current > .tmz-sub-toggle {
  color: var(--tmz-red);
}

/* submenu (escritorio) */
.tmz-submenu {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 5;
  min-width: 340px;
  padding: 8px 0;
  background: #fff;
  border-top: 3px solid var(--tmz-red);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}

.tmz-has-sub:hover > .tmz-submenu,
.tmz-has-sub:focus-within > .tmz-submenu,
.tmz-has-sub.is-open > .tmz-submenu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.tmz-submenu a {
  display: block;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}

.tmz-submenu a:hover,
.tmz-submenu a:focus-visible,
.tmz-submenu a[aria-current="page"] {
  background: #f6f6f6;
  color: var(--tmz-red);
}

/* contacto dentro del panel movil: oculto en escritorio */
.tmz-menu__contact {
  display: none;
}

/* idiomas */
.tmz-lang {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.tmz-lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 2px solid var(--tmz-line);
  border-radius: 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  transition: border-color .15s ease, color .15s ease;
}

.tmz-lang a:hover,
.tmz-lang a:focus-visible {
  border-color: var(--tmz-red);
  color: var(--tmz-red);
}

/* hamburguesa */
.tmz-burger {
  display: none;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tmz-ink);
  cursor: pointer;
}

.tmz-burger span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

.tmz-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.tmz-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.tmz-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* foco visible */
.tmz-header a:focus-visible,
.tmz-header button:focus-visible {
  outline: 3px solid var(--tmz-red);
  outline-offset: 2px;
}

/* ---- tablet / movil --------------------------------------------------------- */
@media (max-width: 1200px) {
  .tmz-topbar {
    display: none;
  }

  .tmz-wrap {
    padding: 0 16px;
  }

  .tmz-mainbar .tmz-wrap {
    min-height: 72px;
    gap: 12px;
    justify-content: space-between;
  }

  .tmz-logo img {
    width: 112px;
  }

  .tmz-lang {
    margin-left: auto;
  }

  .tmz-burger {
    display: block;
  }

  /* panel desplegable */
  .tmz-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid var(--tmz-line);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .16);
  }

  .is-js .tmz-nav {
    display: none;
  }

  .is-js .tmz-nav.is-open {
    display: block;
  }

  .tmz-menu {
    display: block;
    padding: 8px 16px 16px;
  }

  .tmz-menu > li {
    border-bottom: 1px solid var(--tmz-line);
  }

  .tmz-menu > li > a {
    display: flex;
    min-height: 52px;
    padding: 12px 4px;
    font-size: 14px;
    border-bottom: 0;
  }

  .tmz-has-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .tmz-has-sub > a {
    flex: 1 1 0;
  }

  .tmz-sub-toggle {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    margin: 0;
  }

  .tmz-submenu {
    position: static;
    flex: 1 0 100%;
    min-width: 0;
    padding: 0 0 10px 12px;
    border-top: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .is-js .tmz-submenu {
    display: none;
  }

  .is-js .tmz-has-sub.is-open > .tmz-submenu {
    display: block;
  }

  /* el hover/focus no despliega en movil: solo el boton */
  .tmz-has-sub:hover > .tmz-submenu,
  .tmz-has-sub:focus-within > .tmz-submenu {
    transform: none;
  }

  .tmz-submenu a {
    padding: 13px 8px;
    font-size: 14px;
  }

  .tmz-menu__contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding: 12px 4px 0;
    border-bottom: 0 !important;
  }

  .tmz-menu > li.tmz-menu__contact > a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .tmz-menu__contact i {
    width: 20px;
    color: var(--tmz-red);
    text-align: center;
  }
}

@media (min-width: 1201px) and (max-width: 1340px) {
  .tmz-menu > li > a {
    padding: 8px 10px;
    letter-spacing: .02em;
  }
}

@media (max-width: 380px) {
  .tmz-lang a {
    min-width: 40px;
    padding: 0 6px;
  }

  .tmz-logo img {
    width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tmz-header,
  .tmz-header * {
    transition: none !important;
  }
}

/* anclas (#maquinas, #main): que la cabecera fija no tape el destino */
html {
  scroll-padding-top: 130px;
}

@media (max-width: 1200px) {
  html {
    scroll-padding-top: 88px;
  }
}
