/* Mobile Styles */

@media (min-width: 769px) {
  .dexler-mobile-header,
  .dexler-mobile-menu,
  .dexler-mobile-menu-wrapper {
    display: none !important;
  }
}

#dexler-menu-toggle {
  display: none;
}

body.menu-open {
  overflow: hidden;
  height: 100vh;
}

.dexler-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  position: relative;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #eee;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

#dexler-menu-toggle:checked + .dexler-mobile-header {
  transform: translateY(-100%);
  opacity: 0;
}

.dexler-logo img {
  height: 36px;
  width: auto;
}

.dexler-mobile-open {
  font-weight: 700;
  color: #014f9e;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 2px solid #014f9e;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-family: "area-variable", sans-serif;
  font-variation-settings: "wght" 800;
}

.dexler-mobile-menu-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#dexler-menu-toggle:checked + .dexler-mobile-header + .dexler-mobile-menu-wrapper {
  opacity: 1;
  pointer-events: auto;
}

.dexler-mobile-menu {
  background: #fff;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  padding: 1.5rem 1.5rem 3.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
  overflow-y: auto;
  border-radius: 0 0 0 0;
  opacity: 0;
  transform: translateY(10vh);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#dexler-menu-toggle:checked + .dexler-mobile-header + .dexler-mobile-menu-wrapper .dexler-mobile-menu {
  opacity: 1;
  transform: translateY(0);
}

.dexler-mobile-logo {
  margin-bottom: 1rem;
  text-align: left;
}

.dexler-mobile-logo img {
  width: 120px;
  height: auto;
  display: block;
}

.dexler-mobile-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #000;
  font-weight: bold;
}

.dexler-menu-mobile {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dexler-menu-mobile li {
  position: relative;
  list-style: none;
  margin-bottom: 1rem;
}

.dexler-menu-mobile li a {
  font-family: "area-variable", sans-serif;
  font-variation-settings: "INKT" 0, "slnt" 0, "wdth" 100, "wght" 700;
  font-size: 1.15rem;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  display: block;
  padding: 0.75rem 0;
  transition: color 0.2s ease;
  border-bottom: 1px solid #eee;
}

.dexler-menu-mobile li a:hover {
  color: #014f9e;
}

.dexler-menu-mobile li.menu-item-has-children > a::after {
  content: '\25BC';
  float: right;
  font-size: 0.7rem;
  color: #014f9e;
  margin-left: 0.5rem;
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}

.dexler-menu-mobile li.menu-item-has-children.open > a::after {
  transform: rotate(180deg);
}

.dexler-menu-mobile li ul.sub-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.4s ease;
  display: none;
  flex-direction: column;
  padding-left: 0;
  margin-top: 0;
  border-left: none;
}

.dexler-menu-mobile li.open > ul.sub-menu {
  display: flex;
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
}

.dexler-menu-mobile li ul.sub-menu li a {
  font-size: 1rem;
  color: #444;
  font-weight: 700;
  padding: 0.5rem 0;
  border-bottom: none;
}

.dexler-mobile-cta {
  margin-top: 2rem;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(to right, #014f9e, #1664d1);
  color: #fff;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  align-self: center;
  font-family: "area-variable", sans-serif;
  font-variation-settings: "wght" 800;
}

.dexler-menu-mobile li.open > ul.sub-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem 1.5rem;
  padding: 1rem 0 1rem 0;
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease;
}

/* Gemeinsames Icon-Layout */
.dexler-menu-mobile li[class^="icon-"] > a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Fenster */
.dexler-menu-mobile li.icon-fenster > a::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('/wp-content/themes/dexler-divi-child/menu-icons/fenster.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Türen */
.dexler-menu-mobile li.icon-tueren > a::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('/wp-content/themes/dexler-divi-child/menu-icons/tueren.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Sonnenschutz */
.dexler-menu-mobile li.icon-sonnenschutz > a::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('/wp-content/themes/dexler-divi-child/menu-icons/sonnenschutz.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Rolladen */
.dexler-menu-mobile li.icon-rollladen > a::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('/wp-content/themes/dexler-divi-child/menu-icons/rollladen.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Garagentore */
.dexler-menu-mobile li.icon-garagentore > a::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('/wp-content/themes/dexler-divi-child/menu-icons/garagentore.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}