/* ============================================================
   Header & Footer (Layout) – token-basiert, gescopet
   ------------------------------------------------------------
   Nachbau von retourenmaster24.com:
   Servicezeile (dunkel) → Hauptheader (weiß) → Kategorienav.
   Footer dunkel (Markenverlauf) als roter Faden.
   Greift nur, wenn KEIN Elementor-Header/-Footer zugewiesen ist.
   ============================================================ */

/* ---------- Header-Gerüst ---------- */
.rm-header {
  position: sticky;
  top: 0;
  z-index: var(--rm-z-header);
  background: var(--rm-header-bg);
  box-shadow: var(--rm-shadow);
}

/* ---------- Servicezeile ---------- */
.rm-topbar {
  background: var(--rm-topbar-bg);
  color: var(--rm-topbar-ink);
  font-size: var(--rm-fs-300);
}

.rm-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rm-space-4);
  min-height: 30px;
  padding-block: var(--rm-space-1);
}

.rm-topbar ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rm-space-2) var(--rm-space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rm-topbar li {
  display: inline-flex;
  align-items: center;
  gap: var(--rm-space-2);
}

.rm-topbar__usps {
  gap: var(--rm-space-2) var(--rm-space-3);
}

.rm-topbar__usps li + li::before {
  content: "|";
  margin-right: var(--rm-space-3);
  opacity: .5;
}

.rm-topbar a {
  color: inherit;
  text-decoration: none;
}

.rm-topbar a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Hauptheader ---------- */
.rm-header__inner {
  display: flex;
  align-items: center;
  gap: var(--rm-space-5);
  min-height: var(--rm-header-h);
  padding-block: var(--rm-space-3);
}

.rm-header__brand {
  flex: 0 0 auto;
}

.rm-logo img,
.rm-header__brand img,
.rm-header__brand .custom-logo {
  display: block;
  width: auto;
  max-height: 72px;
}

.rm-logo--text {
  font-weight: var(--rm-weight-bold);
  font-size: var(--rm-fs-600);
  color: var(--rm-header-ink);
  text-decoration: none;
}

.rm-header__search {
  flex: 1 1 auto;
  max-width: 560px;
}

.rm-header__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--rm-space-5);
  margin-left: auto;
}

/* Konto / generische Aktion */
.rm-action {
  display: inline-flex;
  align-items: center;
  gap: var(--rm-space-2);
  color: var(--rm-header-ink);
  text-decoration: none;
  font-size: var(--rm-fs-400);
  font-weight: var(--rm-weight-bold);
  line-height: 1.2;
}

.rm-action:hover,
.rm-cart:hover {
  color: var(--rm-primary);
}

/* Warenkorb */
.rm-cart {
  display: inline-flex;
  align-items: center;
  gap: var(--rm-space-2);
  color: var(--rm-header-ink);
  text-decoration: none;
}

.rm-cart__icon {
  position: relative;
  display: inline-flex;
}

.rm-cart__count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-primary);
  color: #fff;
  font-size: 11px;
  font-weight: var(--rm-weight-bold);
  line-height: 18px;
  text-align: center;
}


/* Such-Formular – heller Beere-Pill, Input wächst, Beere-Icon-Button rechts */
.rm-search {
  display: flex;
  align-items: center;
  gap: var(--rm-space-2);
  width: 100%;
  padding: 5px 5px 5px 10px;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-primary-soft);
}

.rm-search__field {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: var(--rm-space-2) var(--rm-space-3);
  font: inherit;
  color: var(--rm-ink);
  background: transparent;
}

.rm-search__field::placeholder {
  color: var(--rm-muted);
}

.rm-search__field:focus {
  outline: none;
}

.rm-search__submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 42px;
  border: 0;
  border-radius: var(--rm-radius-lg);
  background: var(--rm-primary);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s;
}

.rm-search__submit:hover {
  background: var(--rm-primary-dark);
}

.rm-header__search .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Burger (mobil) ---------- */
.rm-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--rm-tap);
  height: var(--rm-tap);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rm-burger span {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--rm-header-ink);
  transition: transform .2s, opacity .2s;
}

/* ---------- Kategorienavigation + Mega-Menü ---------- */
.rm-nav {
  position: relative;             /* Bezug für das full-width Mega-Panel */
  background: var(--rm-nav-bg);
  border-top: 1px solid var(--rm-nav-border);
  border-bottom: 1px solid var(--rm-nav-border);
}

.rm-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* statisch, damit das Mega-Panel sich auf .rm-nav (volle Breite) bezieht */
.rm-nav__list > li {
  position: static;
}

.rm-nav__list > li > a {
  display: inline-block;
  padding: var(--rm-space-4);
  color: var(--rm-header-ink);
  font-size: var(--rm-fs-300);
  font-weight: var(--rm-weight-bold);
  text-decoration: none;
  letter-spacing: .01em;
  border-radius: 0;
  transition: background-color .15s, color .15s;
}

/* Caret bei Punkten mit Untermenü */
.rm-nav__list > li.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: .42em;
  height: .42em;
  margin-left: .45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

/* Hover/aktiv: Item komplett in Beere gefüllt (weißer Text) */
.rm-nav__list > li:hover > a,
.rm-nav__list > li:focus-within > a,
.rm-nav__list > li.current-menu-item > a {
  background: var(--rm-primary);
  color: #fff;
}

/* ---- Mega-Panel (Untermenü) ---- */
.rm-nav .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: var(--rm-z-header);
  margin: 0;
  list-style: none;
  background: var(--rm-mega-bg);
  box-shadow: var(--rm-shadow-lg);
  /* Inhalt auf Container-Breite zentrieren */
  padding: var(--rm-space-6) max(var(--rm-space-4), calc((100% - var(--rm-container)) / 2));
  /* Mehrspaltiges Raster */
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--rm-space-2) var(--rm-space-6);
}

.rm-nav__list > li:hover > .sub-menu,
.rm-nav__list > li:focus-within > .sub-menu,
.rm-nav__list > li.is-open > .sub-menu {
  display: grid;
}

.rm-nav .sub-menu a {
  display: inline-block;
  padding: var(--rm-space-2) 0;
  color: var(--rm-mega-ink);
  font-size: var(--rm-fs-400);
  font-weight: var(--rm-weight-medium);
  text-decoration: none;
}

.rm-nav .sub-menu a:hover {
  color: var(--rm-mega-hover);
  text-decoration: underline;
}

/* ---------- Footer (hell) ---------- */
.rm-footer {
  background: var(--rm-footer-bg);
  color: var(--rm-footer-ink);
}

.rm-footer__grid {
  display: grid;
  grid-template-columns: auto 1.4fr 1.6fr 1.2fr;
  align-items: start;
  gap: var(--rm-space-6);
  padding-block: var(--rm-space-6);
}

.rm-footer__brand {
  display: flex;
  align-items: center;
}

.rm-footer__logo {
  display: block;
  width: auto;
  max-height: 64px;
}

.rm-footer__logo-text {
  font-weight: var(--rm-weight-bold);
  font-size: var(--rm-fs-500);
  color: var(--rm-footer-ink);
}

.rm-footer__title {
  margin: 0 0 var(--rm-space-4);
  font-size: var(--rm-fs-400);
  font-weight: var(--rm-weight-bold);
  color: var(--rm-footer-ink);
}

.rm-footer__contact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rm-footer__contact li {
  margin-bottom: var(--rm-space-2);
  font-size: var(--rm-fs-300);
  color: var(--rm-footer-muted);
}

/* Rechtliches: zwei Spalten (spaltenweise gefüllt) */
.rm-footer__menu {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  justify-content: start;
  gap: var(--rm-space-2) var(--rm-space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rm-footer__menu li {
  font-size: var(--rm-fs-300);
}

.rm-footer a {
  color: var(--rm-footer-ink);
  text-decoration: none;
}

.rm-footer a:hover {
  text-decoration: underline;
}

.rm-social {
  display: inline-flex;
  align-items: center;
  gap: var(--rm-space-2);
  font-size: var(--rm-fs-300);
  font-weight: var(--rm-weight-medium);
}

/* ============================================================
   Off-Canvas-Warenkorb (Side-Cart)
   ============================================================ */
.rm-no-scroll {
  overflow: hidden;
}

.rm-sidecart {
  position: fixed;
  inset: 0;
  z-index: 1100;
  visibility: hidden;
}

.rm-sidecart.is-open {
  visibility: visible;
}

.rm-sidecart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .25s ease;
}

.rm-sidecart.is-open .rm-sidecart__backdrop {
  opacity: 1;
}

.rm-sidecart__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(400px, 92vw);
  height: 100%;
  background: var(--rm-bg);
  box-shadow: var(--rm-shadow-lg);
  transform: translateX(100%);
  transition: transform .3s ease;
}

.rm-sidecart.is-open .rm-sidecart__panel {
  transform: translateX(0);
}

.rm-sidecart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--rm-space-4) var(--rm-space-5);
  background: var(--rm-primary);
  color: #fff;
}

.rm-sidecart__title {
  font-size: var(--rm-fs-500);
  font-weight: var(--rm-weight-bold);
}

.rm-sidecart__close {
  display: inline-flex;
  padding: var(--rm-space-1);
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: var(--rm-radius);
}

.rm-sidecart__close:hover {
  background: rgba(255, 255, 255, .15);
}

.rm-sidecart__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--rm-space-5);
}

/* ---- WooCommerce-Mini-Cart im Panel ---- */
.rm-sidecart__body .woocommerce-mini-cart {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rm-sidecart__body .woocommerce-mini-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: var(--rm-space-3);
  padding: var(--rm-space-3) 0;
  border-bottom: 1px solid var(--rm-border);
}

.rm-sidecart__body .woocommerce-mini-cart-item img {
  grid-row: 1 / 3;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--rm-radius);
  border: 1px solid var(--rm-border);
}

.rm-sidecart__body .woocommerce-mini-cart-item a:not(.remove) {
  color: var(--rm-ink);
  font-weight: var(--rm-weight-medium);
  text-decoration: none;
}

.rm-sidecart__body .woocommerce-mini-cart-item a:not(.remove):hover {
  color: var(--rm-primary);
}

.rm-sidecart__body .woocommerce-mini-cart-item .quantity {
  font-size: var(--rm-fs-300);
  color: var(--rm-muted);
}

/* Entfernen-Button als kleines Kreuz oben rechts */
.rm-sidecart__body .woocommerce-mini-cart-item .remove,
.rm-sidecart__body a.remove {
  position: absolute;
  top: var(--rm-space-3);
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-primary-soft);
  color: var(--rm-primary) !important;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.rm-sidecart__body a.remove:hover {
  background: var(--rm-primary);
  color: #fff !important;
}

.rm-sidecart__body .woocommerce-mini-cart__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--rm-space-4) 0;
  padding-top: var(--rm-space-4);
  font-size: var(--rm-fs-500);
}

.rm-sidecart__body .woocommerce-mini-cart__total strong {
  font-weight: var(--rm-weight-bold);
}

.rm-sidecart__body .woocommerce-mini-cart__buttons {
  display: flex;
  flex-direction: column;
  gap: var(--rm-space-3);
  margin: 0;
}

.rm-sidecart__body .woocommerce-mini-cart__buttons .button {
  display: block;
  width: 100%;
  padding: var(--rm-space-2) var(--rm-space-4);
  border-radius: var(--rm-radius-pill);
  text-align: center;
  font-size: var(--rm-fs-300);
  font-weight: var(--rm-weight-bold);
  text-decoration: none;
}

/* „Warenkorb ansehen" = Outline, „Kasse" = gefüllte Beere */
.rm-sidecart__body .woocommerce-mini-cart__buttons .button {
  border: 2px solid var(--rm-primary);
  background: transparent;
  color: var(--rm-primary);
}

.rm-sidecart__body .woocommerce-mini-cart__buttons .button:hover {
  background: var(--rm-primary-soft);
}

.rm-sidecart__body .woocommerce-mini-cart__buttons .button.checkout {
  background: var(--rm-primary);
  border-color: var(--rm-primary);
  color: #fff;
}

.rm-sidecart__body .woocommerce-mini-cart__buttons .button.checkout:hover {
  background: var(--rm-primary-dark);
  border-color: var(--rm-primary-dark);
}

.rm-sidecart__body .woocommerce-mini-cart__empty-message {
  color: var(--rm-muted);
  text-align: center;
  padding: var(--rm-space-6) 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .rm-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 782px) {
  .rm-topbar__usps {
    display: none;
  }

  .rm-burger {
    display: flex;
    order: 3;
  }

  .rm-header__inner {
    flex-wrap: wrap;
  }

  .rm-header__brand {
    order: 1;
    margin-right: auto;
  }

  .rm-header__actions {
    order: 2;
    gap: var(--rm-space-4);
  }

  /* Such-Leiste in eigene Zeile unter Logo/Aktionen */
  .rm-header__search {
    order: 4;
    flex: 1 0 100%;
    max-width: none;
  }

  .rm-action__label {
    display: none;
  }

  /* Navigation als ausklappbares Panel */
  .rm-nav__list {
    display: none;
    flex-direction: column;
    gap: 0;
  }

  .rm-nav.is-open .rm-nav__list {
    display: flex;
  }

  .rm-nav__list > li > a {
    display: block;
    border-radius: 0;
    padding: var(--rm-space-3) 0;
    border-bottom: 1px solid var(--rm-nav-border);
  }

  /* kein „weißer Tab" mobil */
  .rm-nav__list > li:hover > a,
  .rm-nav__list > li:focus-within > a {
    background: transparent;
    color: var(--rm-header-ink);
  }

  /* Mega-Panel mobil: statische, eingerückte Liste (immer sichtbar im offenen Menü) */
  .rm-nav .sub-menu {
    position: static;
    display: block;
    padding: 0 0 var(--rm-space-2) var(--rm-space-4);
    background: transparent;
    box-shadow: none;
  }

  .rm-nav .sub-menu a {
    color: var(--rm-primary);
    font-size: var(--rm-fs-300);
  }

  /* Burger-Animation bei offenem Menü */
  .rm-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .rm-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .rm-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 560px) {
  .rm-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--rm-space-5);
  }
}
