/* ======================================
   STICKY HEADER BASE
====================================== */
body {
  padding-top: 80px; /* justera efter headerhöjd */
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.header-logo img {
  height: 40px;
}

/* ======================================
   MAIN NAVIGATION (DESKTOP)
====================================== */
.main-nav .menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav .menu li {
  position: relative;
}
.main-nav .menu li a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}
/* Hover underline animation */
.main-nav .menu li a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #0077b6;
  transition: width 0.3s ease;
}
.main-nav .menu li a:hover::after {
  width: 100%;
}
.main-nav .menu li a:hover {
  color: #0077b6;
}

/* ======================================
   DROPDOWN MENU (DESKTOP)
====================================== */
.menu .sub-menu {
  display: none;
  position: absolute;
  background: #fff;
  padding: 1rem;
  list-style: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
}
.menu li:hover > .sub-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.menu-item-has-children .sub-menu {
  display: none;
}
.menu-item-has-children.open .sub-menu {
  display: block;
}

/* ======================================
   HEADER ICONS (SEARCH, HAMBURGER)
====================================== */
.header-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ======================================
   MOBILE MENU TOGGLE BUTTON
====================================== */
.mobile-menu-button {
  background: none;
  border: none;
  font-size: 1.8rem;
  display: none;
  cursor: pointer;
}
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-button {
    display: block;
  }
}

/* ======================================
   MOBILE OVERLAY MENU
====================================== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("/wp-content/uploads/2025/08/Strand-med-kokospalmer-i-Koh-Tao-Thailand.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  flex-direction: column;
  padding: 4rem 2rem 2rem;
  z-index: 10100;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}
.mobile-overlay.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}
.mobile-overlay-inner {
  width: 100%;
}

/* Close button inside overlay */
.mobile-menu-close {
  background: none;
  border: none;
  font-size: 2rem;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  cursor: pointer;
  z-index: 10001;
}

/* Overlay heading */
.mobile-menu-heading {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: white;
  text-align: center;
}

/* ======================================
   MOBILE MENU ITEMS
====================================== */
.mobile-menu,
.mobile-menu ul,
.mobile-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-menu li {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}
.mobile-menu li a {
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
  color: white;
  text-decoration: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.mobile-menu li ul li a {
  font-size: 1.05rem;
  color: white;
}
/* Nested mobile submenus */
.mobile-menu li ul {
  margin-top: 0.5rem;
  margin-left: 1rem;
}
.mobile-menu li ul li {
  margin-bottom: 1rem;
}

/* Custom rotating arrow */
.mobile-menu .menu-item-has-children > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-menu .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  margin-left: 8px;
  transition: transform 0.3s ease;
}
.mobile-menu .menu-item-has-children.open > a::after {
  transform: rotate(-135deg);
}

/* ======================================
   ACTIVE MENU ITEM
====================================== */
.main-nav .menu .current-menu-item > a {
  color: #0077b6;
}
.main-nav .menu .current-menu-item > a::after {
  width: 100%;
}

/* ======================================
   FILTER BUTTON VISIBILITY WHEN MENU IS OPEN
====================================== */
body.menu-open .filter-toggle {
  display: none !important;
}

/* ======================================
   HEADER BLUR EFFECT (DESKTOP ONLY)
====================================== */
body:not(.menu-open):not(.search-open) .site-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.menu-open .site-header,
body.search-open .site-header {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Modern search icon styling */
.search-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

.search-toggle:hover {
  background: #f5f5f5;
  transform: scale(1.05);
}

.icon-search {
  width: 20px;
  height: 20px;
  stroke: #333;
}

/* När overlayen är öppen – ändra ikonfärg */
body.search-open .search-toggle {
  background: #333;
}
body.search-open .icon-search {
  stroke: #fff;
}