.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 110px;
  z-index: 10;
  background: var(--white);
  color: var(--black);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: var(--border-light);
}

.header-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo {
  height: 96px;
  max-height: 100px;
  width: auto;
}

.header-nav {
  display: flex;
  justify-content: center;
  gap: 36px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-link {
  position: relative;
  padding: 6px 0;
  font-size: 15px;
  color: var(--black);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--black);
  transition: width 0.25s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(13, 13, 13, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn img {
  width: 18px;
  height: 18px;
  filter: none;
}

.profile-wrapper {
  position: relative;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.profile-wrapper.is-open .profile-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-link,
.profile-logout {
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  font-size: 14px;
  border: none;
  text-align: left;
  cursor: pointer;
}

.profile-link:hover,
.profile-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.theme-icon {
  font-size: 16px;
  color: var(--white);
}

body.theme-light .site-header {
  background: rgba(247, 246, 238, 0.95);
  color: #141414;
}

body.theme-light .icon-btn {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .icon-btn img,
body.theme-light .theme-icon {
  filter: none;
  color: #141414;
}

/* Hamburger Button */
.hamburger-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(13, 13, 13, 0.05);
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.hamburger-line {
  width: 100%;
  height: 2.5px;
  background: var(--black);
  border-radius: 999px;
  transition: all 0.3s ease;
  transform-origin: center;
}

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

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

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

/* Mobile Menu - Off-canvas Drawer */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 35%;
  min-width: 280px;
  max-width: 35vw;
  height: 100vh;
  background: var(--white);
  color: var(--black);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 25;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  overflow-y: auto;
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--black);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-close:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.mobile-nav-link {
  padding: 14px 20px;
  color: var(--black);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease;
  text-decoration: none;
  display: block;
}

.mobile-nav-link:last-of-type {
  border-bottom: none;
}

.mobile-nav-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Tema claro para mobile menu */
body.theme-light .mobile-menu {
  background: #f7f4ee;
}

body.theme-light .mobile-nav-link {
  color: #141414;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .mobile-nav-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body.theme-light .hamburger-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(13, 13, 13, 0.05);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.theme-light .hamburger-line {
  background: #141414;
}

/* Responsive Design */
@media (max-width: 860px) {
  .site-header {
    height: auto;
    padding: 12px 0 16px;
  }

  .site-header::after {
    left: 16px;
    right: 16px;
  }

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 16px 0 calc(16px + env(safe-area-inset-left));
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
  }

  .header-nav {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .header-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    padding-right: env(safe-area-inset-right);
    flex-shrink: 0;
  }

  .icon-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
  }

  .mobile-menu {
    position: fixed;
    top: 110px;
    right: 0;
    width: 24%;
    min-width: 160px;
    max-width: 250px;
    border-radius: 0;
    height: calc(100vh - 110px);
    border-left: 1px solid var(--border-light);
    border-bottom: none;
  }
}

@media (max-width: 520px) {
  .header-nav {
    gap: 14px;
  }

  .mobile-menu {
    width: 100%;
    min-width: unset;
    max-width: unset;
    top: 80px;
    height: calc(100vh - 80px);
  }

  .site-header {
    height: 80px;
  }

  .mobile-nav-link {
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* iPhone y pantallas pequeñas < 430px */
@media (max-width: 430px) {
  .header-inner {
    gap: 12px;
  }

  .header-left {
    gap: 0;
  }

  .header-right {
    gap: 10px;
  }

  .icon-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
  }

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

  .hamburger-btn {
    width: 38px;
    height: 38px;
    gap: 3px;
  }

  .hamburger-line {
    height: 2px;
  }

  .logo {
    height: 60px;
    max-height: 70px;
    width: auto;
  }

  .site-header {
    padding: 10px 0 14px;
  }

  .site-header::after {
    left: 12px;
    right: 12px;
  }
}