/* ============================================================
   Eigene Elementor-Widgets – token-basiert
   ------------------------------------------------------------
   Alle Widgets liegen auf Website-Inhaltsbreite (--rm-container),
   zentriert, mit seitlichem Gutter auf kleinen Screens. So können
   sie in einem Full-Width-Container (Padding 0) platziert werden
   und richten sich selbst aus.
   ============================================================ */
.rm-hero,
.rm-heading-widget,
.rm-products-widget,
.rm-mediatext,
.rm-textbox,
.rm-richtext {
  width: min(100% - 2 * var(--rm-space-4), var(--rm-container));
  margin-inline: auto;
}

/* ---------- Hero ----------
   Hintergrundbild kommt als CSS-`background-image` direkt auf .rm-hero
   (vom Widget inline gesetzt). Dadurch kann KEIN Lazy-Load-/Bild-Plugin
   das Bild aus dem Layout reißen – der Text liegt garantiert darüber. */
.rm-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 350px;
  overflow: hidden;
  border-radius: var(--rm-radius-lg);
  color: #fff;
  text-decoration: none;
  isolation: isolate;          /* eigener Stacking-Context für Bild/Inhalt */
  background-color: var(--rm-primary-soft);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Text bleibt auch beim Hover weiß (globale a:hover-Regel überschreiben) */
.rm-hero:hover,
.rm-hero:focus {
  color: #fff;
}

/* Sanfter Verlauf von unten → bessere Lesbarkeit über jedem Bild */
.rm-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 45%);
}

/* Fallback: sollte doch ein <img> im Hero landen, füllt es den Hintergrund. */
.rm-hero > img,
.rm-hero__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  border-radius: inherit;
}

/* Beere-Kasten unten: halbtransparent (Bild scheint leicht durch),
   kein Verlauf/Übergang – nur der Kasten. Untere Ecken rundet das Hero. */
.rm-hero__content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: rgba(121, 57, 79, .85);
}

/* Eigene Farbe (kein Erben) – sonst greift Elementors globale Link-Farbe
   `.elementor-kit-… a { color:#775146 }`, weil das Hero ein <a> ist. */
.rm-hero__sub {
  display: block;
  margin-bottom: .35em;
  color: #fff;
  font-weight: var(--rm-weight-bold);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: clamp(.85rem, 1.6vw, 1.25rem);
}

.rm-hero__title {
  display: block;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.02;
  font-size: clamp(2rem, 6vw, 4.5rem);
}

/* Eck-Banderole (diagonal, oben rechts) – groß, flacher Winkel */
.rm-hero__badge {
  position: absolute;
  z-index: 3;
  top: 40px;
  right: -72px;
  width: 300px;
  padding: .7rem 0;
  transform: rotate(40deg);
  transform-origin: center;
  background: var(--rm-primary);
  box-shadow: var(--rm-shadow);
  text-align: center;
}

.rm-hero__badge-text {
  display: block;
  max-width: 150px;
  margin: 0 auto;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: var(--rm-fs-300);
  line-height: 1.25;
}

/* Tablet/Mobil: niedriger. !important, weil Elementors Inline-min-height
   (Responsive-Control, Default 460px) sonst die Media-Query überschreibt. */
@media (max-width: 768px) {
  .rm-hero {
    min-height: 350px !important;
  }
  .rm-hero__badge {
    top: 30px;
    right: -80px;
    width: 260px;
  }
}

@media (max-width: 600px) {
  .rm-hero__content {
    margin-top: auto;
    padding: var(--rm-space-4) var(--rm-space-4) var(--rm-space-5);
  }
  .rm-hero__sub {
    margin-bottom: .25em;
    font-size: .8rem;
    letter-spacing: .14em;
  }
  .rm-hero__title {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  /* Badge mobil: gerade Pill oben rechts – Text immer KOMPLETT sichtbar
     (die diagonale Banderole schnitt den Text am Rand ab). */
  .rm-hero__badge {
    top: var(--rm-space-3);
    right: var(--rm-space-3);
    left: auto;
    width: auto;
    max-width: 62%;
    padding: var(--rm-space-2) var(--rm-space-4);
    transform: none;
    border-radius: var(--rm-radius-pill);
  }
  .rm-hero__badge-text {
    max-width: none;
    font-size: 11px;
    letter-spacing: .03em;
    white-space: normal;
  }
}

/* Sehr schmale Phones */
@media (max-width: 400px) {
  .rm-hero__badge {
    max-width: 70%;
  }
  .rm-hero__badge-text {
    font-size: 10px;
  }
}

/* ---------- Überschrift ---------- */
.rm-heading {
  display: flex;
  align-items: center;
  gap: var(--rm-space-5);
}

.rm-heading--center {
  justify-content: center;
}

.rm-heading--left {
  justify-content: flex-start;
}

.rm-heading--right {
  justify-content: flex-end;
}

.rm-heading__text {
  margin: 0;
  color: var(--rm-primary);
  font-weight: var(--rm-weight-bold);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.2;
  white-space: nowrap;
}

.rm-heading__line {
  flex: 1 1 auto;
  height: 0;
  border-top: 2px dotted var(--rm-primary);
}

/* Ausrichtung: jeweils nur die sinnvolle Linie zeigen */
.rm-heading--left .rm-heading__line--before {
  display: none;
}

.rm-heading--right .rm-heading__line--after {
  display: none;
}

/* Text unter der Überschrift */
.rm-heading__sub {
  width: 100%;
  margin: var(--rm-space-3) 0 0;
  text-align: center;
  font-family: var(--rm-font);
  font-size: 17px;
  font-weight: 400;
  color: var(--rm-primary);
}

.rm-heading__sub > :first-child {
  margin-top: 0;
}

.rm-heading__sub > :last-child {
  margin-bottom: 0;
}

.rm-heading-widget--center .rm-heading__sub {
  text-align: center;
  margin-inline: auto;
}

.rm-heading-widget--left .rm-heading__sub {
  text-align: left;
  margin-inline: 0;
}

.rm-heading-widget--right .rm-heading__sub {
  text-align: right;
  margin-inline: 0 0 0 auto;
}

@media (max-width: 600px) {
  .rm-heading__line {
    display: none;
  }
  .rm-heading__text {
    white-space: normal;
    text-align: center;
  }
}

/* ---------- Produkt-Grid ---------- */
.rm-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--rm-space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rm-products__item {
  display: flex;
}

.rm-product {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--rm-bg);
  border-radius: var(--rm-radius-lg);
  /* Deutlich sichtbarer Ruhe-Schatten (der 5%-Token war praktisch unsichtbar) */
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}

.rm-product:hover {
  box-shadow: var(--rm-shadow-lg);
  transform: translateY(-3px);
}

.rm-product__media {
  position: relative;
  overflow: hidden;
}

.rm-product__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* „Stark reduziert"-Banderole (Ecke oben rechts) – bewährtes Ribbon-Rezept */
.rm-product__badge {
  position: absolute;
  top: 32px;
  right: -50px;
  width: 220px;
  padding: 9px 0;
  transform: rotate(45deg);
  background: var(--rm-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}

.rm-product__title {
  margin: var(--rm-space-4) var(--rm-space-4) var(--rm-space-2);
  text-align: center;
  color: var(--rm-primary);
  font-size: var(--rm-fs-500);
  font-weight: var(--rm-weight-bold);
  line-height: 1.25;
}

.rm-product__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: var(--rm-space-2);
  margin: 0 var(--rm-space-4) var(--rm-space-5);
  font-size: var(--rm-fs-500);
  font-weight: var(--rm-weight-bold);
  color: var(--rm-primary);
}

/* UVP aus der Kurzbeschreibung = erster Streichpreis (Mauve, durchgestrichen).
   Etwas kleiner als der echte Preis → klare Hierarchie. */
.rm-product__uvp {
  color: var(--rm-primary-dark);
  font-size: .82em;
  font-weight: 700;
  text-decoration: line-through;
}

.rm-product__uvp p {
  display: inline;
  margin: 0;
}

/* Auch der reguläre Streichpreis (bei Angebot) kleiner als der Aktionspreis */
.rm-product__price del {
  font-size: .82em;
}

/* WooCommerce-Preis: Alt-Preis Mauve durchgestrichen, Aktionspreis Beere/fett – nebeneinander */
.rm-product__price del {
  color: var(--rm-primary-dark);
  font-weight: 700;
  text-decoration: line-through;
}

.rm-product__price ins {
  color: var(--rm-primary);
  font-weight: 800;
  text-decoration: none;
}

.rm-product__price .screen-reader-text {
  display: none;
}

/* Kategorie-Kacheln (Oberkategorie → Unterkategorien) */
.rm-product--cat {
  text-align: center;
}

/* Kategorie-Vorschaubild füllt die 4:3-Fläche komplett aus (kein Leerraum)
   und bleibt durch die größere Bildgröße (large) scharf. */
.rm-product--cat .rm-product__media {
  display: block;
  aspect-ratio: 4 / 3;
}

.rm-product--cat .rm-product__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}

.rm-product--cat .rm-product__title a {
  color: var(--rm-primary);
  text-decoration: none;
}

.rm-product--cat .rm-product__title a:hover {
  text-decoration: underline;
}

.rm-product__desc {
  margin: 0 var(--rm-space-4) var(--rm-space-4);
  color: var(--rm-primary);
  font-size: var(--rm-fs-400);
  line-height: 1.4;
}

.rm-product__cat-actions {
  margin-top: auto;
  padding: var(--rm-space-2) var(--rm-space-4) var(--rm-space-5);
}

/* Button unter dem Grid */
.rm-products__more {
  margin-top: var(--rm-space-6);
  text-align: center;
}

.rm-products__btn {
  display: inline-block;
  padding: var(--rm-space-2) var(--rm-space-4);
  border-radius: var(--rm-radius-btn);
  background: var(--rm-primary);
  color: #fff;
  font-size: var(--rm-fs-300);
  font-weight: var(--rm-weight-bold);
  text-decoration: none;
  transition: background-color .15s ease;
}

.rm-products__btn:hover {
  background: var(--rm-primary-deep);
  color: #fff;
}

/* Responsiv: 4 → 3 → 2 Spalten (gilt auch fürs Startseiten-Produktwidget,
   nicht nur fürs Shop-Archiv). */
@media (max-width: 980px) {
  .rm-products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 680px) {
  .rm-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  /* Mobil immer nur 1 Spalte – !important schlägt Elementors mobile
     Spalten-Einstellung des Produkt-Grid-Widgets. */
  .rm-products {
    grid-template-columns: 1fr !important;
    gap: var(--rm-space-4);
  }
}

/* Sehr schmale Phones: kompaktere Kachel-Typografie */
@media (max-width: 380px) {
  .rm-product__title {
    font-size: var(--rm-fs-400);
    margin: var(--rm-space-3) var(--rm-space-3) var(--rm-space-1);
  }
  .rm-product__price {
    margin: 0 var(--rm-space-3) var(--rm-space-4);
    font-size: var(--rm-fs-400);
  }
}

/* ---------- Text + Bild ---------- */
.rm-mediatext {
  display: flex;
  flex-wrap: wrap;
  border-radius: var(--rm-radius-lg);
  overflow: hidden;
}

.rm-mediatext__content {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 3rem);
}

.rm-mediatext__media {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 280px;
  overflow: hidden;
}

.rm-mediatext__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

/* Kleine Hover-Animation: sanfter Bild-Zoom (nur Einzelbild) */
.rm-mediatext:hover .rm-mediatext__media > img:only-child {
  transform: scale(1.05);
}

/* ---- Slideshow (mehrere Bilder, Crossfade) ---- */
.rm-mediatext__slider {
  position: relative;
}

.rm-mediatext__slider .rm-mediatext__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
}

.rm-mediatext__slider .rm-mediatext__slide.is-active {
  opacity: 1;
}

.rm-slider__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--rm-space-3);
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: var(--rm-space-2);
}

.rm-slider__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: var(--rm-radius-pill);
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}

.rm-slider__dot.is-active {
  background: #fff;
  transform: scale(1.3);
}

.rm-mediatext--img-left .rm-mediatext__media {
  order: -1;
}

.rm-mediatext__heading {
  width: 100%;
  margin-bottom: var(--rm-space-4);
}

/* Überschrift im Block: kleiner und umbrechbar (schmale Textspalte) */
.rm-mediatext .rm-heading__text {
  white-space: normal;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.25;
}

.rm-mediatext__body > :first-child {
  margin-top: 0;
}

.rm-mediatext__body > :last-child {
  margin-bottom: 0;
}

.rm-mediatext__body p {
  margin: 0 0 var(--rm-space-4);
}

.rm-mediatext__actions {
  margin-top: var(--rm-space-5);
}

.rm-mediatext__btn {
  display: inline-block;
  padding: var(--rm-space-2) var(--rm-space-4);
  border-radius: var(--rm-radius-btn);
  background: var(--rm-primary);
  color: #fff;
  font-size: var(--rm-fs-300);
  font-weight: var(--rm-weight-bold);
  text-decoration: none;
  transition: background-color .15s ease;
}

.rm-mediatext__btn:hover {
  background: var(--rm-primary-deep);
  color: #fff;
}

/* Variante: Hell (zarte Beere) */
.rm-mediatext--bg-soft .rm-mediatext__content {
  background: var(--rm-primary-soft);
}

.rm-mediatext--bg-soft .rm-mediatext__body {
  color: var(--rm-primary);
}

/* Fließtext generell in Beere, fett ebenfalls in Beere (kräftig) */
.rm-heading__sub strong,
.rm-heading__sub b,
.rm-mediatext--bg-soft .rm-mediatext__body strong,
.rm-mediatext--bg-soft .rm-mediatext__body b {
  color: var(--rm-primary);
  font-weight: var(--rm-weight-bold);
}

/* Variante: Beere (dunkel, weißer Text) */
.rm-mediatext--bg-berry .rm-mediatext__content {
  background: var(--rm-primary);
}

.rm-mediatext--bg-berry .rm-heading__text,
.rm-mediatext--bg-berry .rm-mediatext__body {
  color: #fff;
}

.rm-mediatext--bg-berry .rm-heading__line {
  border-color: rgba(255, 255, 255, .6);
}

.rm-mediatext--bg-berry .rm-mediatext__btn {
  background: var(--rm-primary-deep);
}

.rm-mediatext--bg-berry .rm-mediatext__btn:hover {
  background: #4a2230;
  color: #fff;
}

@media (max-width: 768px) {
  /* Einspaltig: Text zuerst, Bild immer darunter – egal welche Bildseite.
     So bleibt die Lese-Reihenfolge (Überschrift → Text → Bild) konsistent. */
  .rm-mediatext {
    flex-direction: column;
  }
  .rm-mediatext__content,
  .rm-mediatext__media {
    flex: 1 1 auto;
    width: 100%;
  }
  .rm-mediatext__content {
    order: 1;
    padding: var(--rm-space-5) var(--rm-space-4);
  }
  .rm-mediatext__media,
  .rm-mediatext--img-left .rm-mediatext__media {
    order: 2;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  /* Bild liegt unten → nur die unteren Ecken runden
     (der Container clippt ohnehin, das ist die saubere Absicherung). */
  .rm-mediatext .rm-mediatext__media,
  .rm-mediatext--img-left .rm-mediatext__media {
    border-radius: 0 0 var(--rm-radius-lg) var(--rm-radius-lg);
  }
}

/* ---------- Textbox ---------- */
.rm-textbox {
  position: relative;
  overflow: hidden;
  border-radius: var(--rm-radius-lg);
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.rm-textbox--bg-soft {
  background: var(--rm-primary-soft);
}

.rm-textbox--bg-berry {
  background: var(--rm-primary);
}

.rm-textbox__watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60%;
  max-width: 520px;
  transform: translate(-50%, -50%);
  opacity: .06;
  pointer-events: none;
}

.rm-textbox__inner {
  position: relative;
  z-index: 1;
}

.rm-textbox__heading {
  margin-bottom: var(--rm-space-4);
}

.rm-textbox__body {
  color: var(--rm-primary);
  font-size: 17px;
  line-height: 1.6;
}

.rm-textbox__body > :first-child {
  margin-top: 0;
}

.rm-textbox__body > :last-child {
  margin-bottom: 0;
}

.rm-textbox__body p {
  margin: 0 0 var(--rm-space-3);
}

.rm-textbox__body strong,
.rm-textbox__body b,
.rm-textbox__body h1,
.rm-textbox__body h2,
.rm-textbox__body h3,
.rm-textbox__body h4,
.rm-textbox__body h5,
.rm-textbox__body h6 {
  color: var(--rm-primary);
  font-weight: var(--rm-weight-bold);
}

/* Beere-Variante: weißer Text */
.rm-textbox--bg-berry .rm-heading__text,
.rm-textbox--bg-berry .rm-textbox__body,
.rm-textbox--bg-berry .rm-textbox__body strong,
.rm-textbox--bg-berry .rm-textbox__body b,
.rm-textbox--bg-berry .rm-textbox__body h1,
.rm-textbox--bg-berry .rm-textbox__body h2,
.rm-textbox--bg-berry .rm-textbox__body h3,
.rm-textbox--bg-berry .rm-textbox__body h4,
.rm-textbox--bg-berry .rm-textbox__body h5,
.rm-textbox--bg-berry .rm-textbox__body h6 {
  color: #fff;
}

.rm-textbox--bg-berry .rm-heading__line {
  border-color: rgba(255, 255, 255, .6);
}

/* ---------- Inhalt / Text (Rechtstexte) ---------- */
.rm-richtext__title {
  margin: 0 0 var(--rm-space-5);
  color: var(--rm-primary);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.25;
}

.rm-richtext__body {
  color: var(--rm-ink);
  font-size: var(--rm-fs-400);
  line-height: 1.7;
}

.rm-richtext__body > :first-child {
  margin-top: 0;
}

.rm-richtext__body > :last-child {
  margin-bottom: 0;
}

.rm-richtext__body h2,
.rm-richtext__body h3,
.rm-richtext__body h4 {
  margin: var(--rm-space-6) 0 var(--rm-space-3);
  color: var(--rm-primary);
  font-weight: var(--rm-weight-bold);
  line-height: 1.3;
}

.rm-richtext__body p {
  margin: 0 0 var(--rm-space-4);
}

.rm-richtext__body a {
  color: var(--rm-primary);
  text-decoration: underline;
}

.rm-richtext__body a:hover {
  color: var(--rm-primary-deep);
}

.rm-richtext__body ul,
.rm-richtext__body ol {
  margin: 0 0 var(--rm-space-4);
  padding-left: 1.4em;
}

.rm-richtext__body li {
  margin-bottom: var(--rm-space-2);
}

.rm-richtext__body strong,
.rm-richtext__body b {
  color: var(--rm-ink);
  font-weight: var(--rm-weight-bold);
}

/* ============================================================
   Schutz gegen globale Elementor-Kit-Styles
   ------------------------------------------------------------
   Elementor setzt u. a.:
     .elementor-kit-… a { color:#775146 }   → färbt weiße Button-/Hero-Texte um
     .elementor a       { box-shadow:none }  → entfernt den Card-Schatten
   Beide haben höhere Spezifität als einfache Theme-Klassen. Hier setzen wir
   die gewünschten Werte gezielt durch (höhere Spezifität bzw. !important),
   ohne die globale Link-Farbe für normale Textlinks zu verändern.
   ============================================================ */

/* Alle Theme-Buttons/Hero-Texte, die WEISS sein sollen, bleiben weiß */
.rm-products__btn,
.rm-mediatext__btn,
.rm-hero__title,
.rm-hero__sub,
.rm-hero__badge-text {
  color: #fff !important;
}

/* Card-Schatten gegen `.elementor a { box-shadow:none }` durchsetzen
   (höhere Spezifität als .elementor a → ohne !important). */
.rm-products__item .rm-product {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.rm-products__item .rm-product:hover {
  box-shadow: var(--rm-shadow-lg);
}
