/* ============================
   ✅ Standard Desktop-Ansicht
   ============================ */
.sjs-category-grid.desktop-only {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    justify-items: center;
    margin: 40px 0;
}

.sjs-category-card {
    width: 250px;
    height: 250px;
    perspective: 1000px;
}

.sjs-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

/* Flip-Effekt nur Desktop */
.sjs-category-card:hover .sjs-card-inner {
    transform: rotateY(180deg);
}

/* Vorder- und Rückseite */
.sjs-card-front,
.sjs-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
}

/* Vorderseite */
.sjs-card-front {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: rotateY(0deg);
    position: relative;
}

/* Overlay */
.sjs-card-front::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Titel */
.sjs-category-title {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease 0.3s;
    z-index: 3;
    pointer-events: none;
}

/* Hover: Overlay + Titel */
.sjs-category-card:hover .sjs-card-front::after {
    opacity: 1;
}
.sjs-category-card:hover .sjs-category-title {
    opacity: 1;
}

/* Rückseite */
.sjs-card-back {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    transform: rotateY(180deg);
    text-align: center;
}
.sjs-card-back a {
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
}
.sjs-card-back a:hover {
    text-decoration: underline;
}

/* Überschrift */
.sjs-category-heading {
    font-size: 1.6rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    text-align: center;
}

/* ============================
   ✅ Mobile & Tablet – Slider
   ============================ */
.mobile-only {
    display: none;
    margin: 30px 0;
    overflow: hidden;
}

/* Slider-Container */
.sjs-category-slider {
    display: flex;
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

/* Slides */
.sjs-category-slide {
    min-width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
}
.sjs-category-slide a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}
.sjs-category-slide-overlay {
    background: rgba(0,0,0,0.5);
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.sjs-category-slide h3 {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    text-transform: uppercase;
}

.sjs-category-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}
.sjs-category-link:hover {
    text-decoration: none;
}


/* ============================
   ✅ Sichtbarkeit für Desktop vs. Mobile
   ============================ */
.desktop-only { 
    display: grid; 
}
.mobile-only { 
    display: none; 
}

/* ✅ Nur Slider auf Tablet & Mobile */
@media (max-width: 820px) {
    .desktop-only { display: none !important; }   /* Grid ausblenden */
    .mobile-only { 
        display: block !important; 
        width: 100%;
        overflow: hidden;
        position: relative;
    }
}

/* ✅ Sicherstellen, dass Grid nur auf Desktop sichtbar ist */
@media (min-width: 821px) {
    .desktop-only { display: grid !important; }
    .mobile-only { display: none !important; }
}

@media (max-width: 820px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

    .sjs-category-slide-overlay {
    display: none;  /* ✅ Overlay komplett ausblenden */
  }

  /* ✅ Sichtbarer Rahmen, quadratisch */
  .sjs-category-slider {
    width: 100%;
    max-width: 400px;        /* optional */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0 auto 20px;
    position: relative;
    background: #000;
  }

  /* ✅ Track (wird verschoben per JS) */
  .sjs-slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
  }

  /* ✅ Einzelne Slides */

  .sjs-category-slide {
    flex: 0 0 100%;
    height: 100%;
    background-size: cover;       /* ✅ ersetzt contain */
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
  }

  .sjs-category-slide a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
  }

  .sjs-category-slide-overlay {
    background: rgba(0,0,0,0.4);
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  /* ✅ Text IMMER in der Mitte */
  .sjs-category-slide h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    z-index: 2;
    width: 90%;
    background: none;
    padding: 5px 10px;
    border-radius: 5px;
  }
}
