/* =========================================================
   Mega-Menue Prototype, Desktop Split (links Liste, rechts Preview)
   ========================================================= */

/* Design-Tokens, gespiegelt aus der Theme-Variablendatei des verpacking-
   Shops (Stand 2026-07-29). Das Plugin hat keinen SCSS-Compile-Schritt,
   daher hier als fertige Hex-/RGB-Werte hinterlegt - bei einer erneuten
   Anpassung der Graupalette im Theme muessen diese Werte manuell
   nachgezogen werden. Kommentare = Ursprungstoken der Theme-SCSS. */
:root {
  --vpmm-ink: #191202;              /* $ci-ink */
  --vpmm-ink-rgb: 25, 18, 2;
  --vpmm-ink-soft: #333333;         /* $ci-ink-soft */
  --vpmm-ink-soft-rgb: 51, 51, 51;
  --vpmm-ink-muted: #4D4D4D;        /* $ci-ink-muted */
  --vpmm-neutral-0: #FFFFFF;        /* $ci-neutral-0 */
  --vpmm-neutral-50: #F8F6F2;       /* $ci-neutral-50 */
  --vpmm-neutral-100: #ECE9E3;      /* $ci-neutral-100 */
  --vpmm-neutral-150: #DEDBD5;      /* $ci-neutral-150 */
  --vpmm-neutral-200: #D1CEC8;      /* $ci-neutral-200 */
  --vpmm-neutral-300: #B7B3AB;      /* $ci-neutral-300 */
  --vpmm-secondary-hover: #332B0C;  /* $color-secondary-light */
  --vpmm-focus: #888275;            /* $surface-page-focus, 3,60:1 zur Buehne, WCAG-2.2-Fokusindikator */
}

@media (min-width: 992px) {
  .vp-mega-split {
    /* An das Seitenmenue (Sidebar-Kategorie-Nav) angeglichen: Hover =
       $ci-neutral-100, aktueller/aktiver Eintrag eine Stufe dunkler =
       $ci-neutral-150. Panel-Hintergrund bleibt weiss (Menue-Flaeche). */
    --vp-mega-surface-hover: var(--vpmm-neutral-100);
    --vp-mega-surface-current: var(--vpmm-neutral-150);
    --vp-mega-overview-button-bg: var(--vpmm-neutral-50);
    --vp-mega-filter-button-bg: var(--vpmm-neutral-0);
    --vp-mega-button-border: var(--vpmm-neutral-200);
  }
  header .navbar-nav > .nav-item.dropdown-full > .dropdown-menu, header .navbar-nav > .nav-item.dropdown.dropdown-full > .dropdown-menu {
    max-height: calc(100dvh - 9rem) !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  header .navbar-nav > .nav-item > .nav-link:focus-visible {
    outline: 0 !important;
    box-shadow: inset 0 0 0 2px var(--vpmm-ink) !important;
    position: relative;
    z-index: 2;
  }
  @supports not (height: 100dvh) {
    header .navbar-nav > .nav-item.dropdown-full > .dropdown-menu, header .navbar-nav > .nav-item.dropdown.dropdown-full > .dropdown-menu {
    max-height: calc(100vh - 9rem) !important;
    }
  }
  .vp-mega-split .vp-mega-split__desktop {
    width: 100%;
    min-height: 340px;
    gap: 1rem;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }
  .vp-mega-split .vp-mega-split__list {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding-right: 0;
    border-right: 0;
    min-width: 0;
    align-content: start;
  }
  .vp-mega-split .vp-mega-split__item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.5rem;
    border-radius: 5px;
    background: transparent;
    color: var(--vpmm-ink-soft) !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    will-change: background-color, border-color;
    min-height: 40px;
  }
  .vp-mega-split .vp-mega-split__item:hover {
    background: var(--vp-mega-surface-hover);
  }
  .vp-mega-split .vp-mega-split__item:focus-visible {
    outline: 2px solid var(--vpmm-focus);
    outline-offset: 2px;
  }
  .vp-mega-split .vp-mega-split__item.is-active {
    background: var(--vp-mega-surface-current);
    border-color: var(--vpmm-neutral-200);
  }
  .vp-mega-split .vp-mega-split__item.is-current, .vp-mega-split .vp-mega-split__item[aria-current="page"] {
    background: var(--vp-mega-surface-current);
  }
  .vp-mega-split .vp-mega-split__thumb {
    width: 35px;
    height: 35px;
    object-fit: contain;
    flex: 0 0 35px;
    margin-bottom: 0;
  }
  .vp-mega-split .vp-mega-split__item-title {
    display: block;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 1rem;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .vp-mega-split .vp-mega-split__preview {
    min-width: 0;
    display: grid;
    align-items: start;
    align-self: stretch;
    position: relative;
    min-height: 0;
    overflow: visible;
  }
  .vp-mega-split .vp-mega-split__panel {
    display: grid;
    position: absolute;
    inset: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "content media";
    align-items: start;
    border: 0;
    border-radius: 5px;
    background: transparent;
    gap: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
    will-change: opacity;
  }
  .vp-mega-split .vp-mega-split__panel.is-active {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.24s ease, visibility 0s linear 0s;
  }
  .vp-mega-split .vp-mega-split__panel:not(.vp-mega-split__panel--overview).is-active {
    align-self: stretch;
    height: 100%;
    min-height: 100%;
  }
  .vp-mega-split .vp-mega-split__panel-media, .vp-mega-split .vp-mega-split__panel-content {
    transition: opacity 0.22s ease;
  }
  .vp-mega-split .vp-mega-split__panel:not(.is-active) .vp-mega-split__panel-media, .vp-mega-split .vp-mega-split__panel:not(.is-active) .vp-mega-split__panel-content {
    opacity: 0;
  }
  .vp-mega-split .vp-mega-split__panel.is-active .vp-mega-split__panel-media, .vp-mega-split .vp-mega-split__panel.is-active .vp-mega-split__panel-content {
    opacity: 1;
    transition-delay: 0.04s;
  }
  .vp-mega-split .vp-mega-split__panel-media {
    grid-area: media;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1.5;
    min-height: 0;
    border-radius: 5px;
    background: transparent;
    box-sizing: border-box;
    overflow: visible;
  }
  .vp-mega-split .vp-mega-split__panel:not(.vp-mega-split__panel--overview) .vp-mega-split__panel-media {
    align-self: center;
    align-items: center;
  }
  .vp-mega-split .vp-mega-split__panel-media picture, .vp-mega-split .vp-mega-split__panel-media .vp-mega-split__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }
  .vp-mega-split .vp-mega-split__panel-media picture img, .vp-mega-split .vp-mega-split__panel-media img.vp-mega-split__image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0;
    object-fit: contain !important;
    object-position: center center !important;
    display: block;
  }
  .vp-mega-split .vp-mega-split__panel:not(.vp-mega-split__panel--overview) .vp-mega-split__panel-media picture {
    align-items: center;
  }
  .vp-mega-split .vp-mega-split__panel:not(.vp-mega-split__panel--overview) .vp-mega-split__panel-media picture img,
  .vp-mega-split .vp-mega-split__panel:not(.vp-mega-split__panel--overview) .vp-mega-split__panel-media img.vp-mega-split__image {
    object-position: center center !important;
  }
  .vp-mega-split .vp-mega-split__panel-content {
    grid-area: content;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
    padding-right: 0.5rem;
    white-space: normal;
  }
  .vp-mega-split .vp-mega-split__panel:not(.vp-mega-split__panel--overview) .vp-mega-split__panel-content {
    align-self: start;
    justify-content: flex-start;
  }
  .vp-mega-split .vp-mega-split__headline {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
    font-weight: 700;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .vp-mega-split .vp-mega-split__overview-copy {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 0;
    max-width: min(100%, 36rem);
    white-space: normal;
  }
  .vp-mega-split .vp-mega-split__overview-text {
    margin: 0;
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--vpmm-ink-muted);
    white-space: normal;
    overflow-wrap: break-word;
  }
  .vp-mega-split .vp-mega-split__overview-highlights {
    margin-top: 0;
  }
  .vp-mega-split .vp-mega-split__empty-note {
    margin: 0;
    padding: 0.45rem 0.6rem;
    border: 1px dashed var(--vpmm-neutral-200);
    border-radius: 5px;
    background: var(--vpmm-neutral-50);
    color: var(--vpmm-ink-muted);
    font-size: 0.9rem;
    line-height: 1.35;
  }
  .vp-mega-split .vp-mega-split__subnav {
    margin-top: 0.1rem;
    width: 100%;
    max-width: 460px;
  }
  .vp-mega-split .vp-mega-split__subnav-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--vpmm-ink-muted);
  }
  .vp-mega-split .vp-mega-split__subnav-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .vp-mega-split .vp-mega-split__subnav-item {
    margin: 0;
    padding: 0;
  }
  .vp-mega-split .vp-mega-split__subnav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    padding: 0.34rem 0.52rem;
    border-radius: 5px;
    background: transparent;
    color: var(--vpmm-ink-soft) !important;
    text-decoration: none !important;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 600;
    text-transform: none;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  .vp-mega-split .vp-mega-split__subnav-link:hover, .vp-mega-split .vp-mega-split__subnav-link:focus-visible {
    background: var(--vp-mega-surface-hover);
    color: var(--vpmm-ink-soft) !important;
    box-shadow: none;
  }
  .vp-mega-split .vp-mega-split__subnav-link:focus-visible {
    outline: 2px solid var(--vpmm-focus);
    outline-offset: 1px;
  }
  .vp-mega-split .vp-mega-split__subnav-link.is-current, .vp-mega-split .vp-mega-split__subnav-link[aria-current="page"] {
    background: var(--vp-mega-surface-current);
    color: var(--vpmm-ink-soft) !important;
  }
  .vp-mega-split .vp-mega-split__subnav-label {
    display: block;
    min-width: 0;
  }
  .vp-mega-split .vp-mega-split__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.1rem;
  }
  .vp-mega-split .vp-mega-split__chip {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.68rem;
    border: 1px solid var(--vp-mega-button-border);
    border-radius: 3px;
    background: var(--vp-mega-overview-button-bg);
    color: var(--vpmm-ink) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    line-height: 1.2;
    text-transform: none;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
    box-shadow: 0 1px 0 rgba(var(--vpmm-ink-rgb), 0.06);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .vp-mega-split .vp-mega-split__chip:hover, .vp-mega-split .vp-mega-split__chip:focus-visible {
    background: var(--vpmm-secondary-hover);
    border-color: var(--vpmm-secondary-hover);
    color: var(--vpmm-neutral-0) !important;
    box-shadow: none;
  }
  .vp-mega-split .vp-mega-split__chip:focus-visible {
    outline: 2px solid var(--vpmm-ink);
    outline-offset: 2px;
  }
  .vp-mega-split .vp-mega-split__quick-filter {
    width: min(100%, 34rem);
    max-width: none;
    padding: 0.78rem 0.9rem 0.86rem;
    border: 0;
    border-radius: 5px;
    background: var(--vp-mega-surface-hover);
    box-sizing: border-box;
  }
  .vp-mega-split .vp-mega-split__quick-filter-header {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-bottom: 0.62rem;
  }
  .vp-mega-split .vp-mega-split__quick-filter-title {
    color: var(--vpmm-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
    text-transform: uppercase;
  }
  .vp-mega-split .vp-mega-split__quick-filter-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 1.05rem;
    border: 1px solid var(--vpmm-neutral-300);
    border-radius: 999px;
    background: var(--vpmm-neutral-0);
    color: var(--vpmm-ink-muted);
    cursor: help;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
  }
  .vp-mega-split .vp-mega-split__quick-filter-info::after {
    content: attr(aria-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.5rem);
    z-index: 4;
    width: max-content;
    max-width: 15rem;
    padding: 0.42rem 0.55rem;
    border-radius: 3px;
    background: var(--vpmm-ink);
    color: var(--vpmm-neutral-0);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    text-transform: none;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .vp-mega-split .vp-mega-split__quick-filter-info:hover::after,
  .vp-mega-split .vp-mega-split__quick-filter-info:focus-visible::after {
    opacity: 1;
    visibility: visible;
  }
  .vp-mega-split .vp-mega-split__quick-filter-info:focus-visible {
    outline: 2px solid var(--vpmm-ink);
    outline-offset: 2px;
  }
  .vp-mega-split .vp-mega-split__quick-filter-body {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
  }
  .vp-mega-split .vp-mega-split__size {
    margin-top: 0;
  }
  .vp-mega-split .vp-mega-split__size-title {
    margin: 0 0 0.32rem 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--vpmm-ink-muted);
  }
  .vp-mega-split .vp-mega-split__title-icon {
    display: inline-block;
    margin-right: 0.4em;
    font-size: 0.85em;
    color: var(--vpmm-ink-muted);
    opacity: 0.75;
    width: 1em;
    text-align: center;
  }
  .vp-mega-split .vp-mega-split__title-icon--width {
    transform: rotate(90deg);
  }
  .vp-mega-split .vp-mega-split__size-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .vp-mega-split .vp-mega-split__size-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.34rem 0.68rem;
    border: 1px solid var(--vp-mega-button-border);
    border-radius: 3px;
    background: var(--vp-mega-filter-button-bg);
    color: var(--vpmm-ink) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    line-height: 1.2;
    text-transform: none;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
    box-shadow: 0 1px 0 rgba(var(--vpmm-ink-rgb), 0.06);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .vp-mega-split .vp-mega-split__size-chip:hover, .vp-mega-split .vp-mega-split__size-chip:focus-visible {
    background: var(--vpmm-secondary-hover);
    border-color: var(--vpmm-secondary-hover);
    color: var(--vpmm-neutral-0) !important;
    box-shadow: none;
  }
  .vp-mega-split .vp-mega-split__size-chip:focus-visible {
    outline: 2px solid var(--vpmm-ink);
    outline-offset: 2px;
  }
  .vp-mega-split .vp-mega-split__color-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    flex: 0 0 0.7rem;
    margin-right: 0.32rem;
    border: 1px solid rgba(var(--vpmm-ink-soft-rgb), 0.24);
    border-radius: 999px;
    background: var(--vpmm-neutral-200);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  }
  /* Ab hier: literale Produktfarben (Farbfilter), KEINE Theme-Grautoene -
     bewusst nicht auf die CI-Palette gemappt, da sie reale Warenfarben
     abbilden muessen (z.B. "grau" muss neutral-grau bleiben, nicht warm). */
  .vp-mega-split .vp-mega-split__color-dot--braun {
    background: #8A5A33;
  }
  .vp-mega-split .vp-mega-split__color-dot--weiss {
    background: #FFFFFF;
    border-color: var(--vpmm-neutral-300);
  }
  .vp-mega-split .vp-mega-split__color-dot--schwarz {
    background: #191202;
  }
  .vp-mega-split .vp-mega-split__color-dot--rot {
    background: #C7362F;
  }
  .vp-mega-split .vp-mega-split__color-dot--blau {
    background: #2F65C7;
  }
  .vp-mega-split .vp-mega-split__color-dot--dunkelblau {
    background: #173A6A;
  }
  .vp-mega-split .vp-mega-split__color-dot--gruen {
    background: #3E8E41;
  }
  .vp-mega-split .vp-mega-split__color-dot--hellgruen {
    background: #9CCC65;
  }
  .vp-mega-split .vp-mega-split__color-dot--gelb {
    background: #FEB518;
  }
  .vp-mega-split .vp-mega-split__color-dot--grau {
    background: #8E8E8E;
  }
  .vp-mega-split .vp-mega-split__color-dot--silber {
    background: linear-gradient(135deg, #F4F4F4 0%, #BDBDBD 48%, #ECECEC 100%);
  }
  .vp-mega-split .vp-mega-split__color-dot--gold {
    background: linear-gradient(135deg, #F9D56E 0%, #DBA815 55%, #F6E3A1 100%);
  }
  .vp-mega-split .vp-mega-split__color-dot--pink {
    background: #E75480;
  }
  .vp-mega-split .vp-mega-split__color-dot--rosa {
    background: #F7A8C6;
  }
  .vp-mega-split .vp-mega-split__color-dot--beige {
    background: #D8C3A5;
  }
  .vp-mega-split .vp-mega-split__color-dot--violett {
    background: #7E57C2;
  }
  .vp-mega-split .vp-mega-split__color-dot--natura {
    background: #C49A6C;
  }
  .vp-mega-split .vp-mega-split__color-dot--transparent {
    background:
            linear-gradient(45deg, rgba(var(--vpmm-ink-soft-rgb), 0.14) 25%, transparent 25%, transparent 75%, rgba(var(--vpmm-ink-soft-rgb), 0.14) 75%),
            linear-gradient(45deg, rgba(var(--vpmm-ink-soft-rgb), 0.14) 25%, transparent 25%, transparent 75%, rgba(var(--vpmm-ink-soft-rgb), 0.14) 75%),
            #FFFFFF;
    background-position: 0 0, 3px 3px, 0 0;
    background-size: 6px 6px, 6px 6px, auto;
    border-color: var(--vpmm-neutral-300);
  }
  .vp-mega-split .vp-mega-split__color-dot--mehrfarbig {
    background: conic-gradient(#C7362F 0 20%, #FEB518 0 40%, #3E8E41 0 60%, #2F65C7 0 80%, #7E57C2 0 100%);
  }
  .vp-mega-split .vp-mega-split__color-dot--rot-bedruckt {
    background: repeating-linear-gradient(135deg, #C7362F 0 4px, #F5E7E4 4px 6px);
  }
  .vp-mega-split .vp-mega-split__color-dot--schwarz-silber {
    background: linear-gradient(135deg, #191202 0 50%, #D8D8D8 50% 100%);
  }
  .vp-mega-split .vp-mega-split__all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    padding: 0.4rem 0.7rem;
    margin-top: auto;
    text-decoration: none !important;
    line-height: 1.2;
    box-shadow: none !important;
  }
  .vp-mega-split .vp-mega-split__all-btn--solo {
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vp-mega-split__item, .vp-mega-split__panel, .vp-mega-split__panel-media, .vp-mega-split__panel-content {
    transition: none !important;
    transform: none !important;
  }
}

/* =========================================================
   Admin-Preview-Indikator (Etappe C). Nur fuer eingeloggte
   Admins, wenn das Frontend den Entwurf statt Live liest.
   Voellig losgeloest vom Layout (position: fixed), dezente
   Pill oben rechts. Tooltip via title-Attribut.
   ========================================================= */
.vp-mega-admin-preview {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  color: #5c3c00;
  background: #ffe69c;
  border: 1px solid #d39e00;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  cursor: help;
  user-select: none;
}
.vp-mega-admin-preview__dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #d39e00;
  box-shadow: 0 0 0 2px rgba(211,158,0,.25);
  animation: vp-mega-admin-pulse 2s ease-in-out infinite;
}
@keyframes vp-mega-admin-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(211,158,0,.25); }
  50%      { box-shadow: 0 0 0 5px rgba(211,158,0,.10); }
}
@media (max-width: 540px) {
  .vp-mega-admin-preview {
    top: .5rem;
    right: .5rem;
    padding: .25rem .55rem;
    font-size: .7rem;
  }
}
