/* WCBR Desktop-Mega-Menü – nur ab Desktop-Breite (darunter Astras Handy-Menü) */
@media (min-width: 1025px) {

  /* Astras eigenes Dropdown für Punkte mit Mega-Panel unterdrücken */
  .wcbr-dm-has-mega .sub-menu,
  .wcbr-dm-has-mega .astra-full-megamenu-wrapper { display: none !important; }
  .wcbr-dm-has-mega > .menu-link .sub-arrow,
  .wcbr-dm-has-mega > a .sub-arrow { pointer-events: none; }

  /* „Angebote" im alten Kopf (Bordeaux-Leiste): weiße Pille */
  body:not(.wcbr-header-neu) .main-header-menu .wcbr-dm-salepill > .menu-link,
  body:not(.wcbr-header-neu) .main-header-menu .wcbr-dm-salepill > a {
    display: inline-flex !important; width: auto !important; align-items: center;
    background: #fff !important; color: #8e153c !important;
    border-radius: 999px; padding: 6px 16px !important; font-weight: 700; line-height: 1.4;
  }

  /* ---------- Container ---------- */
  #wcbr-dm { position: fixed; left: 0; right: 0; top: 0; z-index: 100050; font-family: inherit; }
  #wcbr-dm[hidden] { display: none; }
  .wcbr-dm__scrim { position: absolute; left: 0; right: 0; top: 0; height: 100vh; background: rgba(40, 10, 20, .28); }

  .wcbr-dm__panel {
    position: relative; z-index: 1; border-top: 1px solid #e3d7cc;
    box-shadow: 0 18px 34px rgba(60, 20, 30, .14);
    max-height: calc(100vh - var(--wcbr-dm-top, 160px) - 12px);
    overflow-y: auto; overscroll-behavior: contain;
    /* Scroll-Schatten: unten sichtbar, solange noch etwas darunter liegt */
    background:
      linear-gradient(#fffdfb 30%, rgba(255, 253, 251, 0)) center top,
      linear-gradient(rgba(255, 253, 251, 0), #fffdfb 70%) center bottom,
      radial-gradient(farthest-side at 50% 0, rgba(60, 20, 30, .16), rgba(60, 20, 30, 0)) center top,
      radial-gradient(farthest-side at 50% 100%, rgba(60, 20, 30, .22), rgba(60, 20, 30, 0)) center bottom,
      #fffdfb;
    background-repeat: no-repeat;
    background-size: 100% 40px, 100% 40px, 100% 14px, 100% 16px, auto;
    background-attachment: local, local, scroll, scroll, scroll;
    scrollbar-width: thin; scrollbar-color: #c9a9b3 transparent;
  }
  .wcbr-dm__panel[hidden] { display: none; }
  @media (prefers-reduced-motion: no-preference) {
    .wcbr-dm__panel { animation: wcbr-dm-in .14s ease; }
    @keyframes wcbr-dm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  }

  /* ---------- Raster: Gruppen | rechte Spalte, darunter Fußzeile ---------- */
  .wcbr-dm__inner {
    --dm-cols: 4;
    max-width: 1600px; margin: 0 auto; box-sizing: border-box; padding: 24px 40px 0;
    display: grid; column-gap: 36px;
    grid-template-areas: "groups rail" "chips chips" "foot foot";
    grid-template-columns: minmax(0, 1fr) 270px;
    font-size: 14px; line-height: 1.4; color: #33302d;
  }
  .wcbr-dm__groups {
    grid-area: groups; display: grid; align-content: start;
    grid-template-columns: repeat(var(--dm-cols), minmax(0, 1fr)); gap: 20px 22px;
  }
  .wcbr-dm__grp { min-width: 0; }
  .wcbr-dm__grp-head { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #33302d; }
  .wcbr-dm__grp-head img { width: 36px !important; height: 36px !important; max-width: none; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
  .wcbr-dm__thumb-fallback {
    width: 36px; height: 36px; border-radius: 50%; background: #efe6dc; color: #8e153c; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
  }
  .wcbr-dm__grp-txt { display: flex; flex-direction: column; min-width: 0; }
  .wcbr-dm__grp-txt strong { font-size: 14px; font-weight: 700; line-height: 1.25; color: #33302d; }
  .wcbr-dm__grp-txt small { display: none; font-size: 11.5px; color: #6b5e58; line-height: 1.35; margin-top: 2px; }
  #wcbr-dm .wcbr-dm__grp-head:hover strong { color: #8e153c; }

  .wcbr-dm__links { list-style: none; margin: 6px 0 0; padding: 0; }
  .wcbr-dm__links li { margin: 0; }
  #wcbr-dm .wcbr-dm__links a, #wcbr-dm .wcbr-dm__more {
    display: block; padding: 3px 0 3px 46px; font-size: 13px; line-height: 1.35; color: #5c4a44; text-decoration: none;
  }
  #wcbr-dm .wcbr-dm__links a:hover { color: #8e153c; text-decoration: underline; text-underline-offset: 2px; }
  #wcbr-dm .wcbr-dm__more { font-weight: 700; color: #8e153c; padding-top: 4px; }
  .wcbr-dm__more:hover { text-decoration: underline; }
  #wcbr-dm .wcbr-dm__more--compact { display: none; }

  /* Rechte Spalte: Highlight + Direkt stöbern */
  .wcbr-dm__rail { grid-area: rail; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .wcbr-dm__hl { display: block; border-radius: 14px; overflow: hidden; background: #8e153c; color: #fff !important; text-decoration: none; }
  .wcbr-dm__hl img { display: block; width: 100%; height: 128px; object-fit: cover; }
  .wcbr-dm__hl-body { display: block; padding: 12px 16px 14px; }
  .wcbr-dm__hl-title { display: block; font-family: 'Amatic SC', cursive; font-size: 30px; font-weight: 700; line-height: 1; }
  .wcbr-dm__hl-text { display: block; font-size: 12.5px; line-height: 1.45; opacity: .93; margin-top: 4px; }
  .wcbr-dm__hl-btn {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 7px 14px; border-radius: 999px;
    background: #fff; color: #8e153c; font-size: 12.5px; font-weight: 700;
  }
  .wcbr-dm__hl:hover .wcbr-dm__hl-btn, .wcbr-dm__hl:focus-visible .wcbr-dm__hl-btn { background: #f6e9ed; }
  .wcbr-dm__label { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #6b5e58; margin-bottom: 2px; }
  .wcbr-dm__direct ul { list-style: none; margin: 0; padding: 0; }
  .wcbr-dm__direct li { margin: 0; }
  #wcbr-dm .wcbr-dm__row {
    display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #ece1d8;
    font-size: 13.5px; font-weight: 600; color: #33302d; text-decoration: none;
  }
  .wcbr-dm__direct li:last-child .wcbr-dm__row { border-bottom: 0; }
  .wcbr-dm__row small { display: block; font-size: 11.5px; font-weight: 500; color: #6b5e58; }
  .wcbr-dm__row img { width: 30px !important; height: 30px !important; border-radius: 50%; object-fit: cover; flex: 0 0 auto; max-width: none; }
  .wcbr-dm__badge {
    width: 30px; height: 30px; border-radius: 50%; background: #efe6dc; color: #8e153c; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
  }
  .wcbr-dm__row--sale .wcbr-dm__badge { background: #8e153c; color: #fff; font-size: 14px; }
  #wcbr-dm .wcbr-dm__row:hover { color: #8e153c; }

  /* Chips (nur kompakt) */
  .wcbr-dm__chips { grid-area: chips; display: none; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  #wcbr-dm .wcbr-dm__chip {
    display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 13px; border-radius: 16px;
    background: #f3ebe3; color: #33302d; font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  }
  .wcbr-dm__chip img { width: 24px !important; height: 24px !important; border-radius: 50%; object-fit: cover; margin-left: -9px; max-width: none; }
  #wcbr-dm .wcbr-dm__chip--hl { background: #8e153c; color: #fff !important; }
  #wcbr-dm .wcbr-dm__chip--sale { color: #8e153c; }
  .wcbr-dm__chip:hover { background: #ead9ce; }
  .wcbr-dm__chip--hl:hover { background: #6d0f2e; }

  /* Fußzeile */
  .wcbr-dm__foot {
    grid-area: foot; display: flex; align-items: center; gap: 14px;
    margin-top: 20px; padding: 13px 0 15px; border-top: 1px solid #ece1d8;
  }
  .wcbr-dm__all { font-size: 14px; font-weight: 700; color: #8e153c !important; text-decoration: none; }
  .wcbr-dm__all:hover { text-decoration: underline; }
  .wcbr-dm__count { margin-left: auto; font-size: 12px; color: #6b5e58; }

  /* Kleine Panels (Wein, Bio, Geschenke): Kacheln mit Kurztext */
  .wcbr-dm__panel--small .wcbr-dm__inner { --dm-cols: 3; }
  .wcbr-dm__panel--small .wcbr-dm__grp-txt small { display: block; }
  .wcbr-dm__panel--small .wcbr-dm__grp-head img,
  .wcbr-dm__panel--small .wcbr-dm__thumb-fallback { width: 52px !important; height: 52px !important; }
  .wcbr-dm__panel--small .wcbr-dm__grp-head { padding: 10px 12px; border-radius: 12px; background: #fdfaf7; border: 1px solid #ece1d8; }
  .wcbr-dm__panel--small .wcbr-dm__grp-head:hover { border-color: #8e153c; }

  /* Fokus sichtbar (Tastatur) */
  #wcbr-dm a:focus-visible { outline: 2px solid #8e153c; outline-offset: 2px; border-radius: 4px; }
  .wcbr-dm__hl:focus-visible { outline-offset: 3px; }
}

/* ---------- Breiten ---------- */
@media (min-width: 1360px) {
  .wcbr-dm__inner { grid-template-columns: minmax(0, 1fr) 290px; }
}
@media (min-width: 1600px) {
  .wcbr-dm__inner { --dm-cols: 5; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 44px; padding-top: 28px; }
}

/* ---------- Niedrige Bildschirme: rechte Spalte wird zur Chip-Zeile ---------- */
@media (min-width: 1025px) and (max-height: 860px) {
  .wcbr-dm__inner { grid-template-areas: "groups" "chips" "foot"; grid-template-columns: minmax(0, 1fr); padding: 18px 32px 0; --dm-cols: 5; }
  .wcbr-dm__rail { display: none; }
  .wcbr-dm__chips { display: flex; }
  .wcbr-dm__groups { gap: 16px 20px; }
  .wcbr-dm__grp-txt small { display: none !important; }
  .wcbr-dm__grp-head img, .wcbr-dm__thumb-fallback { width: 30px !important; height: 30px !important; }
  .wcbr-dm__grp-txt strong { font-size: 13.5px; }
  .wcbr-dm__links { margin-top: 4px; }
  #wcbr-dm .wcbr-dm__links a, #wcbr-dm .wcbr-dm__more { padding: 2.5px 0 2.5px 40px; font-size: 12.5px; }
  .wcbr-dm__links li:nth-child(n+5) { display: none; }
  #wcbr-dm .wcbr-dm__more--compact { display: block; }
  .wcbr-dm__foot { margin-top: 14px; padding: 10px 0 12px; }
  .wcbr-dm__panel--small .wcbr-dm__inner { --dm-cols: 4; }
  .wcbr-dm__panel--small .wcbr-dm__grp-head img, .wcbr-dm__panel--small .wcbr-dm__thumb-fallback { width: 40px !important; height: 40px !important; }
}
@media (min-width: 1300px) and (max-height: 860px) {
  .wcbr-dm__inner { --dm-cols: 6; }
}

/* =====================================================================
   Feinschliff nach Test (18.10.): Empfehlungen als Band UNTER den
   Gruppen statt rechter Spalte – 6 Spalten passen, Menü bleibt ohne
   Scrollen; auf niedrigen Schirmen Chips + „Alle ansehen" in einer Zeile
   ===================================================================== */
@media (min-width: 1025px) {
  .wcbr-dm__inner { --dm-cols: 5; grid-template-areas: "groups" "rail" "foot"; grid-template-columns: minmax(0, 1fr); max-width: 1720px; padding: 22px 40px 0; }
  .wcbr-dm__rail { flex-direction: row; align-items: stretch; gap: 24px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #ece1d8; }
  .wcbr-dm__hl { flex: 0 0 400px; display: flex; align-items: stretch; }
  .wcbr-dm__hl img { width: 150px; height: auto; min-height: 100%; flex: 0 0 150px; }
  .wcbr-dm__hl-body { padding: 12px 16px; }
  .wcbr-dm__hl-title { font-size: 28px; }
  .wcbr-dm__direct { flex: 1 1 auto; min-width: 0; }
  .wcbr-dm__direct ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 20px; }
  #wcbr-dm .wcbr-dm__row { border-bottom: 0; padding: 6px 0; }
  .wcbr-dm__foot { margin-top: 16px; }
}
@media (min-width: 1360px) {
  .wcbr-dm__inner { --dm-cols: 6; grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1025px) and (max-width: 1279px) {
  .wcbr-dm__hl { flex-basis: 320px; }
  .wcbr-dm__hl img { width: 110px; flex-basis: 110px; }
}
@media (min-width: 1025px) and (max-height: 860px) {
  .wcbr-dm__inner { grid-template-areas: "groups groups" "chips foot"; grid-template-columns: minmax(0, 1fr) auto; padding: 16px 32px 0; }
  .wcbr-dm__chips { margin-top: 14px; padding: 10px 0 12px; border-top: 1px solid #ece1d8; align-self: start; }
  .wcbr-dm__foot { margin-top: 14px; padding: 10px 0 12px; align-self: start; }
  .wcbr-dm__count { display: none; }
}

/* ---------- Feinschliff 2: niedrige Schirme dichter, 6 Spalten ab 1200 ---------- */
@media (min-width: 1200px) and (max-height: 860px) {
  .wcbr-dm__inner { --dm-cols: 6; }
}
@media (min-width: 1025px) and (max-height: 860px) {
  .wcbr-dm__inner { padding-top: 12px; }
  .wcbr-dm__groups { gap: 12px 20px; }
  .wcbr-dm__chips, .wcbr-dm__foot { margin-top: 10px; padding: 8px 0 10px; }
}
