/* === Desktopmeny === */
.custom-nav,
.custom-nav-undershop {
  width: 100%;
}
@media (min-width: 1000px) {
.wp-container-core-group-is-layout-23441af8 {width: 800px;}
}
.custom-menu {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.custom-menu li { position: relative; }
.custom-menu > li { margin: 0; }
.custom-menu > li > a {
  display: block;
  padding: 1em 1.5em;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.custom-menu > li:hover > a { background-color: #f0f0f0; }

/* === Dropdown === */
.custom-menu li ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  list-style: none;
  margin: 0; padding: 0;
  border: 1px solid #ddd;
  min-width: 180px;
  z-index: 9999;
}
.custom-menu li:hover > ul.sub-menu { display: block; }
.custom-menu li ul.sub-menu li a {
  padding: 0.8em 1.2em;
  display: block;
  text-decoration: none;
  color: #333;
  white-space: nowrap;
}
.custom-menu li ul.sub-menu li a:hover { background-color: #f0f0f0; }

@media (max-width: 768px) {
  .custom-menu > li > a { padding: 0.5em !important; }
  .custom-menu li ul.sub-menu { min-width: 50px !important; }
  .custom-menu li ul.sub-menu li a { padding: 0.5em !important; }
}

/* === Undermeny för webbshop === */
.custom-nav-undershop {
  position: relative;
  margin-top: 0;
  border-top: 1px solid #000000;
  background-color: transparent;
}
.custom-menu-undershop {
  list-style: none;
  display: flex;
  margin: 0; padding: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.custom-menu-undershop li { position: relative; }
.custom-menu-undershop > li { margin: 0; }
.custom-menu-undershop > li > a {
  display: block;
  padding: 1em 1.5em;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.custom-menu-undershop > li:hover > a { background-color: #f0f0f0; }

/* === Dropdown i undermeny === */
.custom-menu-undershop li ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  list-style: none;
  margin: 0; padding: 0;
  border: 1px solid #ddd;
  min-width: 180px;
  z-index: 9999;
}
.custom-menu-undershop li:hover > ul.sub-menu { display: block; }
.custom-menu-undershop li ul.sub-menu li a {
  padding: 0.8em 1.2em;
  display: block;
  text-decoration: none;
  color: #333;
  white-space: nowrap;
}
.custom-menu-undershop li ul.sub-menu li a:hover { background-color: #f0f0f0; }

/* === Mobilmeny för undermeny === */
.menu-toggle-undershop {
  display: none;
  background-color: #333;
  color: white;
  padding: 1em;
  border: none;
  font-size: 1.2em;
  width: 50%;
  text-align: center;
  margin: 0 auto;
}

/* Dölj pilen på desktop */
.submenu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0 0.5em;
  font-size: 1em;
  cursor: pointer;
}

@media (max-width: 768px) {
  .custom-menu-undershop {
    margin-top: 15px;
    flex-direction: column;
    display: none;
  }
  .custom-menu-undershop.active { display: flex; }
  .custom-menu-undershop > li > a {
    padding: 1em;
    border-top: 1px solid #eee;
  }
  .custom-menu-undershop li ul.sub-menu {
    position: static;
    border: none;
  }
  .custom-menu-undershop li:hover > ul.sub-menu { display: none; }
  .custom-menu-undershop li.open > ul.sub-menu { display: block; }
  .menu-toggle-undershop { display: block; }
  .custom-nav-undershop { border-top: 0; }

  .custom-menu-undershop li a,
  .custom-menu-undershop li ul.sub-menu li a {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    display: block !important;
  }

  /* Föräldraposter i undermenyn */
  .custom-menu-undershop > li.menu-item-has-children {
    display: flex;
    flex-direction: column;
    width: 50%;
    position: relative;
    border-bottom: 0;
  }

  /* Huvudlänken + pil i rad */
  .custom-menu-undershop > li.menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
  }

  .submenu-toggle {
    display: inline-block;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1em;
    cursor: pointer;
    vertical-align: top;
    float: right;
    margin-right: -20px;
  }

  /* Undermenyn placeras till höger (på mobil gör vi den bara synlig under) */
  .custom-menu-undershop li ul.sub-menu {
    position: absolute;
    left: 100%;
    top: 0;
    width: 100%;
    max-width: 100vw;
    display: none;
    background: #fff;
    border-left: 1px solid #eee;
    padding: 0;
    z-index: 10;
  }
  .custom-menu-undershop li.open > ul.sub-menu { display: block; }

  /* Undermeny-styling */
  .custom-menu-undershop li ul.sub-menu li {
    padding: 1em;
    border-bottom: 1px solid #eee;
  }
  .custom-menu-undershop li ul.sub-menu li a {
    display: block;
    text-decoration: none;
    color: #333;
  }
}
