/* ─── HEADER — Swiss Austral (Bootstrap-compatible) ──────────── */
.sa-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--sa-white, #fff);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  height: var(--sa-header-height, 72px);
}

.sa-header.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.sa-header__inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo */
.sa-header__logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.sa-header__logo img { height: 40px; width: auto; object-fit: contain; }
.sa-header__logo-text { font-size: 20px; font-weight: 700; color: var(--sa-dark, #1A1A1A); }

/* Nav — centrado */
.sa-header__nav { flex: 1; display: flex; justify-content: center; }
.sa-nav__list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.sa-nav__list li a {
  display: block; padding: 8px 16px; font-size: 15px; font-weight: 500;
  color: var(--sa-dark, #1A1A1A); border-radius: 999px;
  transition: all 0.2s; text-decoration: none; white-space: nowrap;
}
.sa-nav__list li a:hover,
.sa-nav__list li.current-menu-item > a { color: var(--sa-red, #C1121F); }
.sa-nav__list li.current-menu-item > a {
  position: relative;
}
.sa-nav__list li.current-menu-item > a::after {
  content: ''; position: absolute; bottom: 2px; left: 16px; right: 16px;
  height: 2px; background: var(--sa-red, #C1121F); border-radius: 1px;
}

/* Actions — derecha */
.sa-header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Lang switcher */
.sa-lang-switcher { position: relative; }
.sa-lang-switcher__btn {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--sa-dark, #1A1A1A);
  padding: 6px 10px; border-radius: 999px; transition: background 0.2s;
}
.sa-lang-switcher__btn:hover { background: #F5F5F5; }
.sa-lang-switcher__dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; background: #fff;
  border: 1px solid #E8E8E8; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 80px; overflow: hidden; opacity: 0; visibility: hidden;
  transform: translateY(-4px); transition: all 0.2s;
}
.sa-lang-switcher__btn[aria-expanded="true"] + .sa-lang-switcher__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.sa-lang-switcher__dropdown li a { display: block; padding: 8px 16px; font-size: 14px; color: #1A1A1A; }
.sa-lang-switcher__dropdown li a:hover, .sa-lang-switcher__dropdown li a.active { background: #F5F5F5; color: #C1121F; }

/* Login */
.sa-header__login { padding: 8px 20px; font-size: 14px; }

/* Cart */
.sa-header__cart {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; color: #1A1A1A;
  transition: background 0.2s; text-decoration: none;
}
.sa-header__cart:hover { background: #F5F5F5; color: #C1121F; }
.sa-header__cart-count {
  position: absolute; top: 4px; right: 4px; background: #C1121F; color: #fff;
  font-size: 10px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.sa-header__cart-count:empty { display: none; }

/* Mobile toggle */
.sa-header__toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 8px; width: 40px; height: 40px;
  justify-content: center; align-items: center; border-radius: 8px;
}
.sa-header__toggle span { display: block; width: 22px; height: 2px; background: #1A1A1A; border-radius: 2px; transition: all 0.3s ease; }
.sa-header__toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.sa-header__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.sa-header__toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── RESPONSIVE HEADER ──────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sa-header__toggle { display: flex; }
  .sa-header__login { display: none; }

  .sa-header__inner {
    justify-content: space-between;
  }

  /* Logo a la izquierda, actions (lang + cart + toggle) a la derecha */
  .sa-header__actions {
    margin-left: auto;
    gap: 8px;
  }

  .sa-header__nav {
    position: fixed; top: var(--sa-header-height, 72px); left: 0; right: 0; bottom: 0;
    background: #fff; z-index: 700; flex-direction: column; justify-content: flex-start;
    padding: 24px; overflow-y: auto; transform: translateX(-100%); transition: transform 0.3s ease;
  }
  .sa-header__nav.open { transform: translateX(0); }

  .sa-nav__list { flex-direction: column; align-items: flex-start; width: 100%; gap: 4px; }
  .sa-nav__list li { width: 100%; }
  .sa-nav__list li a { width: 100%; font-size: 18px; padding: 12px 16px; }
}

@media (max-width: 575.98px) {
  .sa-header__inner { padding: 0 16px; }
  .sa-header__logo img { height: 32px; }
}

/* ─── COOKIE BANNER ──────────────────────────────────────────── */
.sa-cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid #E8E8E8; box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 9999; padding: 24px 0; transform: translateY(100%); transition: transform 0.4s ease;
}
.sa-cookie-banner.visible { transform: translateY(0); }
.sa-cookie-banner.hidden { display: none; }
.sa-cookie-banner__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.sa-cookie-banner__content h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.sa-cookie-banner__content p { font-size: 13px; color: #6B6B6B; margin: 0; max-width: 600px; }
.sa-cookie-banner__content p a { color: #C1121F; text-decoration: underline; }
.sa-cookie-banner__actions { display: flex; gap: 12px; flex-shrink: 0; }

@media (max-width: 640px) {
  .sa-cookie-banner__inner { flex-direction: column; }
  .sa-cookie-banner__actions { width: 100%; justify-content: flex-end; }
}

/* ── DROPDOWN MENU (sub-menu) ─────────────────────────── */
.sa-nav__list .menu-item-has-children {
  position: relative;
}
.sa-nav__list .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sa-nav__list .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2718%27 height=%2718%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%231A1A1A%27 stroke-width=%272%27%3E%3Cpath d=%27M6 9l6 6 6-6%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}
.sa-nav__list .menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* Dropdown panel */
.sa-nav__list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 1000;
}
.sa-nav__list .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown items */
.sa-nav__list .sub-menu li a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border-bottom: none;
}
.sa-nav__list .sub-menu li a:hover,
.sa-nav__list .sub-menu li.current-menu-item > a {
  background: var(--sa-red, #C1121F);
  color: #fff;
}
.sa-nav__list .sub-menu li:first-child a { border-radius: 8px 8px 0 0; }
.sa-nav__list .sub-menu li:last-child a { border-radius: 0 0 8px 8px; }

/* Mobile dropdown */
@media (max-width: 991px) {
  .sa-nav__list .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: #f9f9f9;
    border-radius: 0;
    padding-left: 16px;
    margin-top: 4px;
  }
  .sa-nav__list .sub-menu li a {
    padding: 10px 16px;
    font-size: 16px;
  }
}
