/* Wrapper nur für dieses Modul */
.rgb-stock-section {
  padding: 2.5rem 0;
  background: #f7f7f8;
  position: relative;
}

.rgb-stock-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Head */
.rgb-stock-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rgb-stock-head-left{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}
.rgb-stock-head-right{
  display:flex;
  gap: 8px;
  align-items:center;
}

/* Controls NUR mobile */
@media (min-width: 992px){
  .rgb-stock-head-right{ display:none; }
}

/* Buttons */
.rgb-view-btn{
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.rgb-view-btn.is-active{
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.rgb-view-btn--compare{
  border-color: rgba(124,58,237,0.35);
}

/* Grid Basis */
.rgb-stock-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  grid-template-columns: 1fr;
}

/* Desktop (wie vorher) */
@media (min-width: 992px) {
  .rgb-stock-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Karte */
.rgb-stock-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0.8rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 20, 30, 0.08);
  position: relative;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.rgb-stock-card:focus{
  outline: 3px solid rgba(124, 58, 237, 0.35);
  outline-offset: 3px;
}

/* Top Anzeige (lila Rahmen + Header) */
.rgb-stock-card.is-top-ad{
  border: 3px solid #7c3aed;
  box-shadow: 0 18px 44px rgba(15, 20, 30, 0.16);
  transform: translateY(-2px);
}
.rgb-stock-top-header{
  padding: 0.55rem 0.9rem;
  font-weight: 900;
  letter-spacing: .35px;
  text-transform: uppercase;
  background: #7c3aed;
  color: #fff;
  font-size: 0.85rem;
}

/* Animation */
.rgb-anim-active .rgb-stock-card.rgb-stock-animate {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
  will-change: transform, opacity;
}
.rgb-anim-active .rgb-stock-card--from-left { transform: translateX(-260px); }
.rgb-anim-active .rgb-stock-card--from-right { transform: translateX(260px); }
.rgb-anim-active .rgb-stock-card.rgb-stock-card--visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

/* Body */
.rgb-stock-card-body {
  padding: 0.95rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rgb-stock-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}
.rgb-stock-card-title a {
  color: #111;
  text-decoration: none;
}
.rgb-stock-card-title a:hover { text-decoration: underline; }

/* Preis groß */
.rgb-stock-price-big{
  margin-top: 0.4rem;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.1;
  color: #111;
}

/* Meta */
.rgb-stock-meta-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}
.rgb-stock-meta-item { display: flex; gap: 0.25rem; }
.rgb-stock-meta-label { color: #666; min-width: 7.2rem; }
.rgb-stock-meta-value { color: #222; }

/* Datum */
.rgb-stock-date-row {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #777;
}
.rgb-stock-date-label { margin-right: 0.25rem; font-weight: 600; }

/* Footer / Link */
.rgb-stock-more-link {
  font-size: 0.85rem;
  text-decoration: none;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.rgb-stock-more-link:hover { text-decoration: underline; }
.rgb-stock-more-arrow { font-size: 1rem; }

/* Swiper */
.rgb-stock-swiper {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  position: relative;
}
.rgb-stock-slide { display: flex; align-items: center; justify-content: center; }
.rgb-stock-image { width: 100%; height: 100%; object-fit: cover; }

/* Swiper Pagination */
.rgb-stock-pagination {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
}
.rgb-stock-section .swiper-pagination-bullet {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.7);
  opacity: 1;
}
.rgb-stock-section .swiper-pagination-bullet-active { background: #fff; }

/* Button unten */
.rgb-stock-more-ads { margin-top: 2rem; text-align: center; }
.rgb-stock-more-ads-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.rgb-stock-more-ads-btn:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Empty */
.rgb-stock-empty {
  margin-top: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fff;
  border-radius: 0.8rem;
  box-shadow: 0 6px 18px rgba(15, 20, 30, 0.06);
}
.rgb-stock-empty-icon {
  width: 2.1rem;
  height: 2.1rem;
  line-height: 2.1rem;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 1px solid #ddd;
  font-size: 1.1rem;
  font-weight: 600;
  color: #555;
}
.rgb-stock-empty-text { margin: 0; font-weight: 500; }

/* iOS/Safari: horizontales Swipen erlauben */
.rgb-stock-swiper,
.rgb-stock-swiper .swiper-wrapper,
.rgb-stock-swiper .swiper-slide { touch-action: pan-y; }
.rgb-stock-slide a { display:block; width:100%; height:100%; }

/* ---------------- MOBILE: LISTE (Standard) ---------------- */
@media (max-width: 991.98px){
  .rb-view-list .rgb-stock-grid{ grid-template-columns: 1fr; }

  .rb-view-list .rgb-stock-card{
    flex-direction: row;
    align-items: stretch;
  }

  .rb-view-list .rgb-stock-swiper{
    width: 42%;
    min-width: 190px;
    aspect-ratio: auto;
    height: 100%;
  }

  .rb-view-list .rgb-stock-card-body{
    width: 58%;
    padding: 0.85rem 0.9rem 0.9rem;
  }

  .rb-view-list .rgb-stock-card-title{
    font-size: 1.02rem;
  }

  /* In Liste: Label/Wert nebeneinander */
  .rb-view-list .rgb-stock-meta-item{ flex-direction: row; }
  .rb-view-list .rgb-stock-meta-label{ min-width: 7.1rem; }

  @media (max-width: 820px){
    .rb-view-list .rgb-stock-card{ flex-direction: column; }
    .rb-view-list .rgb-stock-swiper{ width: 100%; min-width: unset; aspect-ratio: 4 / 3; }
    .rb-view-list .rgb-stock-card-body{ width: 100%; }
  }
}

/* ---------------- MOBILE: VERGLEICH-KACHEL (2 Spalten) ---------------- */
@media (max-width: 991.98px){
  .rb-compare-mode .rgb-stock-card{ cursor: pointer; }

  /* Im Vergleich: keine Navigation/Buttons */
  .rb-compare-mode .rgb-stock-card a,
  .rb-compare-mode .rgb-stock-card button{
    pointer-events: none;
  }

  /* Auswahl: dunkler + Overlay */
  .rb-compare-mode .rgb-stock-card.rb-selected{ filter: brightness(0.88); }
  .rb-compare-mode .rgb-stock-card.rb-selected::after{
    content:"";
    position:absolute;
    inset:0;
    background: rgba(0,0,0,0.12);
    pointer-events:none;
  }

  /* ✅ Vergleich-Kachel: 2er-Reihen */
  .rb-compare-mode .rgb-stock-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  @media (max-width: 360px){
    .rb-compare-mode .rgb-stock-grid{ grid-template-columns: 1fr; }
  }

  /* ✅ Im Vergleich-Kachelmodus UI ausblenden */
  .rb-compare-mode .d-flex.align-items-center.justify-content-between.mt-2{ display:none !important; } /* Mehr Infos + ansehen */
  .rb-compare-mode .collapse.mt-3{ display:none !important; } /* Beschreibung */
  .rb-compare-mode .rgb-stock-date-row{ display:none !important; } /* Datum */

  /* kompakter */
  .rb-compare-mode .rgb-stock-card-body{
    padding: 0.65rem 0.7rem 0.7rem;
    gap: 0.25rem;
  }
  .rb-compare-mode .rgb-stock-card-title{
    font-size: 0.95rem;
    line-height: 1.15;
  }
  .rb-compare-mode .rgb-stock-price-big{
    font-size: 1.15rem;
    margin-top: 0.2rem;
  }

  /* ✅ WICHTIG: Meta in Kachelansicht UNTEREINANDER (Label oben / Wert unten) */
  .rb-compare-mode .rgb-stock-meta-list{
    font-size: 0.78rem;
    margin-top: 0.2rem;
  }
  .rb-compare-mode .rgb-stock-meta-item{
    flex-direction: column;
    gap: 0.06rem;
  }
  .rb-compare-mode .rgb-stock-meta-label{
    min-width: unset;
    font-weight: 900;
    color: #555;
  }
}

/* ---------------- COMPARE BAR ---------------- */
.rgb-compare-bar{
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  border-top: 1px solid #e5e7eb;
  backdrop-filter: blur(10px);
}
.rgb-compare-bar-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rgb-compare-btn{
  border: 1px solid #7c3aed;
  background: #7c3aed;
  color: #fff;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}
.rgb-compare-btn:disabled{
  opacity: .45;
  cursor: not-allowed;
}
.rgb-compare-btn--ghost{
  background:#fff;
  color:#111;
  border-color:#d1d5db;
}

/* ---------------- COMPARE DIALOG ---------------- */
.rgb-compare-dialog{
  border: none;
  border-radius: 14px;
  width: min(1100px, 92vw);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
}
.rgb-compare-dialog::backdrop{ background: rgba(0,0,0,0.4); }
.rgb-compare-dialog-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.rgb-compare-x{
  border: 1px solid #d1d5db;
  background:#fff;
  border-radius: 10px;
  padding: .35rem .55rem;
  font-weight: 900;
  cursor:pointer;
}
.rgb-compare-dialog-body{ padding: 14px 16px 18px; }
.rgb-compare-table-wrap{ overflow:auto; }
.rgb-compare-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.rgb-compare-table th,
.rgb-compare-table td{
  border: 1px solid #e5e7eb;
  padding: 10px 10px;
  vertical-align: top;
  text-align: left;
  font-size: 0.9rem;
}
.rgb-compare-rowhead{
  background:#fafafa;
  width: 160px;
  font-weight: 900;
}
.rgb-compare-title{ font-weight: 900; margin-bottom: 4px; }
.rgb-compare-link{
  color:#7c3aed;
  font-weight: 800;
  text-decoration: none;
}
.rgb-compare-link:hover{ text-decoration: underline; }