/* ==========================
   Article Cards & Detail Carousel
   ========================== */

/* ===== Card Container ===== */
.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

@media (max-width: 992px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .card-container {
        grid-template-columns: 1fr;
    }
}

/* ===== Article Card ===== */
.article-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.article-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 0.75rem;
    position: relative;
    z-index: 3; /* Form bleibt klickbar */
    pointer-events: auto;
}

.article-card .card-title a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.article-card .card-title a:hover {
    text-decoration: underline;
}

/* ===== Images ===== */
.uniform-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* ===== Stretched Link for Card Click ===== */
.article-card .stretched-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2; /* Bild/Titel klickbar, blockiert Swipe nicht */
}

/* ===== Carousel (Card & Detail) ===== */
.carousel-inner {
    pointer-events: auto; /* Swipe funktioniert sofort */
    z-index: 1;
}

.carousel-indicators {
    bottom: -10px;
    justify-content: center;
    z-index: 2; /* Über Bild, unter Formular */
}

.carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 2px;
    background-color: #ccc;
}

.carousel-indicators .active {
    background-color: #007bff;
}

.carousel-control-prev,
.carousel-control-next {
    width: 25px;
    height: 25px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

/* ===== Forms inside Cards ===== */
.article-card .no-stretch-link,
.article-card select,
.article-card button,
.article-purchase-form {
    position: relative;
    z-index: 3;
    cursor: default;
    pointer-events: auto;
}

/* ===== Pfeile nur für Article Cards, oben 25% ===== */
.article-card .carousel-control-prev,
.article-card .carousel-control-next {
    position: absolute;    /* wichtig, damit sie über dem Bild liegen */
    top: 50%;              /* oben 25% */
    transform: translateY(0); /* keine vertikale Verschiebung */
    width: 25px;
    height: 25px;
    opacity: 1 !important;   /* zwingt sie sichtbar zu sein */
    z-index: 4;              /* über den Dots und Formular */
}

/* Hover-Effekt */
.article-card .carousel-control-prev:hover,
.article-card .carousel-control-next:hover {
    opacity: 1;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;               /* Abstand zwischen Pfeil und Text */
    padding: 6px 12px;       /* Button-artiger Look */
    border: 2px solid #999;
    border-radius: 6px;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Hover, Focus & Active */
.back-link:hover,
.back-link:focus,
.back-link:active {
    background-color: #333;
    color: #fff;
    text-decoration: none;
}

/* Damit besuchter Link die Farbe nicht ändert */
.back-link:visited {
    color: #333;
}

.back-arrow {
    font-size: 1.2em;
}

/* Base style for all filter buttons */
.filter-btn, .filter-sub-btn {
  border: 1px solid #999;       /* grey border */
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  background-color: white;      /* default white */
  color: #333;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

/* Subcategory style */
.filter-sub-btn {
  font-size: 0.8rem;            /* smaller */
}
/* Text zentrieren innerhalb der Buttons */
.filter-btn,
.filter-sub-btn {
    text-align: center;   /* Text mittig */
    display: inline-block; /* nötig für text-align */
}

/* Active state */
.btn-check:checked + .filter-btn,
.btn-check:checked + .filter-sub-btn {
  background-color: #999;       /* grey background */
  color: white;                 /* text white for contrast */
  border-color: #999;
}

/* Hover effect */
.filter-btn:hover,
.filter-sub-btn:hover {
  background-color: #e0e0e0;
}

/* Mobile horizontal scroll */
@media (max-width: 768px) {
  .filter-container form > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
}