/* Berr Chat – Website-Element „Katalogwand“ ([berr_katalogwand])
   Farben und Größen zentral als Variablen – bei Bedarf im Theme überschreiben. */
.bkw {
  --bkw-cols: 3;
  --bkw-gap: 32px;
  --bkw-accent: #d8107d;       /* Button / Hover (Berr-Magenta) */
  --bkw-text: inherit;
  --bkw-muted: #5f6b7a;
  --bkw-shadow: 0 10px 28px rgba(15, 30, 60, .22), 0 2px 6px rgba(15, 30, 60, .12);
  margin: 0 auto;
}
.bkw__grid { display: grid; grid-template-columns: repeat(var(--bkw-cols), minmax(0, 1fr)); gap: var(--bkw-gap); }
.bkw__item { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none !important; color: var(--bkw-text); }
.bkw__cover { position: relative; display: block; width: 100%; max-width: 320px; aspect-ratio: 427 / 600; border-radius: 4px; overflow: hidden; box-shadow: var(--bkw-shadow); transition: transform .25s ease, box-shadow .25s ease; background: #eef1f5; }
.bkw__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bkw__cover::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .25s;
  background: rgba(0, 0, 0, .28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h7a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H2zM22 4h-7a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h8z'/%3E%3C/svg%3E") center / 56px no-repeat;
}
.bkw__item:hover .bkw__cover, .bkw__item:focus-visible .bkw__cover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(15, 30, 60, .28), 0 4px 10px rgba(15, 30, 60, .14); }
.bkw__item:hover .bkw__cover::after, .bkw__item:focus-visible .bkw__cover::after { opacity: 1; }
.bkw__ph { display: flex; align-items: center; justify-content: center; height: 100%; padding: 16px; font-weight: 700; color: var(--bkw-muted); }
.bkw__title { margin-top: 16px; font-weight: 700; font-size: 1.05em; line-height: 1.3; }
.bkw__sub { margin-top: 2px; font-size: .92em; color: var(--bkw-muted); }
.bkw__btn {
  margin-top: 12px; display: inline-block; padding: 9px 20px; border-radius: 999px; border: 2px solid var(--bkw-accent);
  color: var(--bkw-accent); font-weight: 600; font-size: .92em; transition: background .2s, color .2s;
}
.bkw__item:hover .bkw__btn { background: var(--bkw-accent); color: #fff; }
.bkw__empty { text-align: center; color: var(--bkw-muted); }
.bkw__fx { display: none; }

/* ---------- Hinweis am Cover ----------
   .bkw__hint liegt als Ebene über dem Cover und schneidet das Eckband sauber ab (auch bei Hardcover/Stapel).
   Stil über die Klasse am Element: bkw-h--band (Standard) · bkw-h--lesezeichen · bkw-h--pille */
.bkw { --bkw-h-neu: #d8107d; --bkw-h-vorbestellbar: #0e8a7e; --bkw-h-vergriffen: #4b5563; --bkw-h-online: #2f5fbf; }
.bkw__hint { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; border-radius: inherit; container: bkwhint / inline-size; }
.bkw__badge {
  --c: var(--bkw-h-online);
  position: absolute; color: #fff; font-style: normal; font-weight: 700; line-height: 1.2; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%), var(--c);
}
.bkw__badge--neu { --c: var(--bkw-h-neu); }
.bkw__badge--vorbestellbar { --c: var(--bkw-h-vorbestellbar); }
.bkw__badge--vergriffen { --c: var(--bkw-h-vergriffen); }
.bkw__badge--online { --c: var(--bkw-h-online); }

/* Eckband: diagonal über die Ecke oben rechts */
.bkw-h--band .bkw__badge {
  top: 36px; right: -50px; width: 210px; padding: 7px 0; text-align: center; transform: rotate(45deg); letter-spacing: .09em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .28); border-top: 1px solid rgba(255, 255, 255, .35); border-bottom: 1px solid rgba(0, 0, 0, .15);
}
/* Lesezeichen: hängt oben rechts von der Kante, mit Kerbe */
.bkw-h--lesezeichen .bkw__badge {
  top: 0; right: 16px; max-width: calc(100% - 32px); padding: 12px 12px 18px; text-align: center; letter-spacing: .1em; overflow: hidden; text-overflow: ellipsis;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 7px), 0 100%);
}
/* Etikett: schlicht oben links (bisherige Darstellung, etwas feiner) */
.bkw-h--pille .bkw__badge {
  top: 10px; left: 10px; padding: 5px 11px; border-radius: 999px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .06em; box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
/* feine Ziernaht wie bei einem Satinband */
.bkw-h--band .bkw__badge::before, .bkw-h--lesezeichen .bkw__badge::before {
  content: ""; position: absolute; left: 0; right: 0; top: 3px; bottom: 3px; pointer-events: none;
  border-top: 1px dashed rgba(255, 255, 255, .5); border-bottom: 1px dashed rgba(255, 255, 255, .5);
}
.bkw-h--lesezeichen .bkw__badge::before { top: 0; bottom: 10px; left: 3px; right: 3px; border: 0; border-left: 1px dashed rgba(255, 255, 255, .5); border-right: 1px dashed rgba(255, 255, 255, .5); }
/* Kleine Cover (viele Spalten, Vorschau): Eckband wird zur schmalen Leiste oben */
@container bkwhint (max-width: 200px) {
  .bkw-h--band .bkw__badge { transform: none; top: 0; left: 0; right: 0; width: auto; padding: 5px 4px; font-size: 9px; letter-spacing: .08em; overflow: hidden; text-overflow: ellipsis; }
  .bkw-h--lesezeichen .bkw__badge { right: 8px; padding: 8px 7px 13px; font-size: 9px; letter-spacing: .06em; }
}
.bkw--hardcover.bkw-h--pille .bkw__badge { left: calc(9% + 8px); }
.bkw--hardcover .bkw__hint { border-radius: 3px 7px 7px 3px; }

/* ---------- Darstellungen des Vorschaubilds ---------- */
/* Hardcover: Buchrücken mit Falz, Seitenschnitt rechts, kräftiger Schatten */
.bkw--hardcover .bkw__cover { overflow: visible; border-radius: 3px 7px 7px 3px; box-shadow: 10px 14px 26px rgba(15, 30, 60, .3), 2px 3px 6px rgba(15, 30, 60, .2); margin-right: 8px; }
.bkw--hardcover .bkw__cover img { border-radius: 3px 7px 7px 3px; position: relative; z-index: 1; }
.bkw--hardcover .bkw__cover::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; right: -8px; width: 9px; z-index: 0; border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(90deg, #fdfdfd 0 1px, #dcdcdc 1px 2px); box-shadow: 2px 2px 4px rgba(0, 0, 0, .15);
}
.bkw--hardcover .bkw__fx {
  display: block; position: absolute; top: 0; bottom: 0; left: 0; width: 9%; z-index: 2; pointer-events: none; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .22) 35%, rgba(0, 0, 0, .18) 62%, rgba(255, 255, 255, .08) 80%, rgba(0, 0, 0, 0));
}
.bkw--hardcover .bkw__cover::after { z-index: 2; border-radius: 3px 7px 7px 3px; }

/* Umgeblätterte Ecke: Ecke unten rechts klappt um, beim Darüberfahren weiter */
.bkw--ecke .bkw__cover { --bkw-curl: clamp(30px, 15%, 52px); background: #eef0f3; }
.bkw--ecke .bkw__cover img { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--bkw-curl)), calc(100% - var(--bkw-curl)) 100%, 0 100%); transition: clip-path .3s ease; }
.bkw--ecke .bkw__fx {
  display: block; position: absolute; right: 0; bottom: 0; z-index: 2; width: var(--bkw-curl); height: var(--bkw-curl); pointer-events: none;
  background: linear-gradient(to top left, transparent 50%, #c9ced6 50%, #ffffff 75%, #e4e7ec 100%);
  filter: drop-shadow(-3px -3px 4px rgba(0, 0, 0, .22)); transition: width .3s ease, height .3s ease;
}
.bkw--ecke .bkw__item:hover .bkw__cover, .bkw--ecke .bkw__item:focus-visible .bkw__cover { --bkw-curl: clamp(48px, 26%, 90px); }

/* Papierstapel: zwei Blätter darunter */
.bkw--stapel .bkw__cover { overflow: visible; margin: 0 10px 10px 0;
  box-shadow: 5px 5px 0 -1px #fff, 5px 5px 0 0 #d5d9e0, 10px 10px 0 -1px #fff, 10px 10px 0 0 #c3c8d1, 12px 16px 26px rgba(15, 30, 60, .25); }
.bkw--stapel .bkw__cover img { border-radius: 4px; }
.bkw--stapel .bkw__cover::after { border-radius: 4px; }

/* Schräg (3D): leicht gedreht, richtet sich beim Darüberfahren auf */
.bkw--schraeg .bkw__grid { perspective: 1600px; }
.bkw--schraeg .bkw__cover { transform: rotateY(-16deg) rotateX(2deg); transform-origin: left center; box-shadow: 16px 18px 30px rgba(15, 30, 60, .3); }
.bkw--schraeg .bkw__item:hover .bkw__cover, .bkw--schraeg .bkw__item:focus-visible .bkw__cover { transform: rotateY(0) translateY(-6px); }
@media (max-width: 900px) { .bkw__grid { grid-template-columns: repeat(min(var(--bkw-cols), 2), minmax(0, 1fr)); --bkw-gap: 24px; } }
@media (max-width: 560px) { .bkw__grid { grid-template-columns: minmax(0, 1fr); } .bkw__cover { max-width: 260px; } }

/* Popup */
.bkw-pop { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; background: rgba(10, 16, 28, .82); animation: bkw-in .2s ease-out; }
.bkw-pop__frame { position: relative; width: 100%; height: 100%; max-width: 1400px; border-radius: 10px; overflow: hidden; background: #1b1f27; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.bkw-pop__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.bkw-pop__close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .95); color: #111; font-size: 26px; line-height: 44px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
body.bkw-lock { overflow: hidden; }
@media (max-width: 760px) { .bkw-pop { padding: 0; } .bkw-pop__frame { border-radius: 0; } }
@keyframes bkw-in { from { opacity: 0; } to { opacity: 1; } }
