/* ========================================
   VEGENERGY CAROUSEL STYLES - NEU STRUKTURIERT
   Version: 2.0
   Letzte Aktualisierung: 2026-01-05
   ======================================== */

/* ========================================
   CSS VARIABLEN FÜR CAROUSEL
   ======================================== */
:root {
    --carousel-height: 100vh;
    --carousel-margin-top: -91px;
    --carousel-margin-top-mobile: -80px;
    --carousel-height-mobile: 1400px;
    --carousel-height-small-mobile: 1250px;
    --w-image: 900px;
    --calculate: 1;
    --transform-from: 0;
    --transform-to: 0;
    --border-color: rgba(255, 255, 255, 0.2);
    --content-padding: 50px 20px 20px 80px;
    --content-padding-mobile: 0px;
    --image-width: 35em;
    --image-max-width: 650px;
    --image-drop-shadow: drop-shadow(0 150px 50px rgba(255, 255, 255, 0.114));
    --button-transition: all 0.5s ease;
    --animation-duration: 0.5s;
}

/* Desktop-spezifische Variablen */
@media screen and (min-width: 1201px) {
    :root {
        --w-image: 900px;
        --calculate: 0.90;
    }
    
    .carousel .list .item .image img {
        width: 24em !important;
        max-width: 380px !important;
    }
}

/* ========================================
   CAROUSEL CONTAINER
   ======================================== */
.carousel {
    margin-top: var(--carousel-margin-top);
    width: 100%;
    height: var(--carousel-height);
    overflow: hidden;
    z-index: 3;
    touch-action: pan-y;
    transform: translateY(0);
    opacity: 0;
    animation: slideInCarousel var(--animation-duration) ease-in-out forwards;
}

.carousel .list {
    height: 100%;
    position: relative;
}

/* Gradient Overlay Links */
.carousel .list::before {
    position: absolute;
    width: var(--w-image);
    height: 100%;
    content: '';
    top: 0;
    left: calc(100% - calc(var(--w-image) * var(--calculate)));
    z-index: 10;
    pointer-events: none;
}

/* Blur Effect Rechts Oben */
.carousel .list::after {
    position: absolute;
    top: 50px;
    left: 50px;
    content: '';
    background-color: rgba(255, 255, 255, 0);
    width: 400px;
    height: 300px;
    z-index: 10;
    pointer-events: none;
    border-radius: 20px 50px 110px 230px;
    filter: blur(150px);
    opacity: 0.6;
}

/* ========================================
   CAROUSEL ITEMS
   ======================================== */
.carousel .list .item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: none;
}

/* Nur aktive und die beiden anderen Items anzeigen */
.carousel .list .item.active,
.carousel .list .item.other_1,
.carousel .list .item.other_2 {
    display: block;
}

.carousel .list .item.active {
    z-index: 3;
}

.carousel .list .item.other_1,
.carousel .list .item.other_2 {
    pointer-events: none;
}

/* ========================================
   ITEM CONTENT BEREICH
   ======================================== */
.carousel .list .item .main-content {
    height: 100%;
    display: grid;
    grid-template-columns: calc(100% - calc(var(--w-image) * var(--calculate)));
}

.carousel .list .item .main-content .content {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: var(--content-padding);
}

/* Energy Tag Text */
.carousel .list .item .main-content .content .energy-tag {
    font-family: 'Mukta', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-color);
    margin-bottom: 0;
    padding-top: 1em;
    margin-top: 40px;
}

/* Produktname */
.carousel .list .item .main-content .content h2 {
    font-size: 4.2em;
    color: var(--text-color);
    font-family: 'Mukta', sans-serif;
    margin: 0;
    padding: 0;
}

/* Produktbeschreibung (Preis/Kategorie) */
.carousel .list .item .main-content .content .price {
    font-family: 'Mukta', sans-serif;
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--text-color);
}

/* Produktbeschreibung */
.carousel .list .item .main-content .content .description {
    color: var(--text-color);
    line-height: 1.6;
}

/* Button Container */
.carousel .list .item .main-content .content div {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Links */
.carousel .list .item .main-content .content a {
    color: var(--vegaenergy-dark);
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
}

/* Buttons */
.carousel .list .item .main-content .content .addToCard {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    margin-top: 20px;
    margin-right: 5px;
    font-size: 1em;
    background-color: var(--text-color);
    color: var(--vegaenergy-dark);
    padding: 10px 25px;
    border: 0px solid var(--border-color);
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Mukta', sans-serif;
    transition: var(--button-transition);
}

.carousel .list .item .main-content .content .addToCard:hover {
    transform: scale(1.05);
    background-color: var(--vegaenergy-dark);
    color: #fff;
}

.carousel .list .item .main-content .content .addToCard:active {
    transform: translateY(-5%) scale(0.85);
}

/* ========================================
   ITEM IMAGE BEREICH (DOSE)
   ======================================== */
.carousel .list .item .image {
    width: var(--w-image);
    height: 100%;
    position: absolute;
    top: 0;
    left: calc(100% - calc(var(--w-image) * var(--calculate)));
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    font-weight: 500;
}

.carousel .list .item .image img {
    width: 22em;
    max-width: 350px;
    object-fit: contain;
    filter: var(--image-drop-shadow);
    margin-bottom: -10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carousel .list .item .image img:hover {
    transform: scale(1.02);
}

.carousel .list .item .image figcaption {
    font-family: 'Mukta', sans-serif;
    font-weight: bold;
    font-size: 2em;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 10px;
    width: 70%;
    padding-bottom: 20px;
    color: var(--text-color);
}

/* ========================================
   CAROUSEL NAVIGATION ARROWS
   ======================================== */
.arrows {
    position: sticky;
    bottom: 20px;
    width: calc(100% - calc(var(--w-image) * var(--calculate)));
    display: grid;
    grid-template-columns: repeat(2, 50px);
    grid-template-rows: 50px;
    justify-content: end;
    gap: 10px;
    cursor: pointer;
    z-index: 10;
}

.arrows i {
    display: flex;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    font-size: 1.25rem;
    background-color: #dfdfdf;
    color: var(--vegaenergy-dark);
    border-radius: 10%;
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 0.1s linear, background-color 0.3s ease;
}

.arrows i:hover {
    background-color: rgb(39, 150, 60);
    color: var(--text-color);
}

.arrows i:active {
    transform: translateY(-50%) scale(0.85);
}

.arrows svg {
    cursor: pointer;
    transition: all 0.3s ease;
}

.arrows svg:hover {
    border-radius: 5px;
}

/* ========================================
   CAROUSEL ANIMATIONS - NEXT
   ======================================== */
.carousel.next .item.other_1 {
    z-index: 2;
}

.carousel.next .item .image img,
.carousel.next .item .image figcaption {
    animation: effectNext var(--animation-duration) ease-in-out 1 forwards;
}

@keyframes effectNext {
    from {
        transform: translateX(var(--transform-from));
    }
    to {
        transform: translateX(calc(var(--transform-from) - var(--w-image)));
    }
}

.carousel.next .item.active .image {
    --transform-from: var(--w-image);
}

.carousel.next .item.other_1 .image {
    z-index: 4;
    --transform-from: 0px;
    overflow: hidden;
}

.carousel.next .item.other_2 .image {
    z-index: 4;
    --transform-from: calc(var(--w-image) * 2);
}

/* ========================================
   CAROUSEL ANIMATIONS - PREV
   ======================================== */
.carousel.prev .list .item .image img,
.carousel.prev .list .item .image figcaption {
    animation: effectPrev var(--animation-duration) ease-in-out 1 forwards;
}

@keyframes effectPrev {
    from {
        transform: translateX(var(--transform-from));
    }
    to {
        transform: translateX(calc(var(--transform-from) + var(--w-image)));
    }
}

.carousel.prev .list .item.active .image {
    --transform-from: calc(var(--w-image) * -1);
    overflow: hidden;
}

.carousel.prev .list .item.other_1 .image {
    --transform-from: 0px;
    z-index: 10;
}

.carousel.prev .list .item.other_2 .image {
    z-index: 4;
    --transform-from: var(--w-image);
}

.carousel.prev .list .item.other_2 .main-content {
    opacity: 0;
}

/* ========================================
   CONTENT SHOW ANIMATION
   ======================================== */
.carousel .list .item.active .main-content {
    animation: showContent 1s ease-in-out 1 forwards;
}

@keyframes showContent {
    from {
        clip-path: circle(0% at 70% 50%);
    }
    to {
        clip-path: circle(100% at 70% 50%);
    }
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media screen and (max-width: 1200px) {
    :root {
        --w-image: 900px;
        --calculate: 1;
    }

    .arrows {
        display: none;
    }

    .carousel .list .item .image img {
        width: 28em;
        max-width: 420px;
    }

    .carousel .list .item .main-content {
        grid-template-columns: 50%;
    }

    .carousel .list .item .main-content .content h2 {
        font-size: 2.5em;
    }

    .carousel .list .item .image {
        padding: 0;
        padding-left: 8vw;
        padding-top: 40px;
        justify-content: center;
    }

    .carousel .list .item .image figcaption {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .carousel .list .item .main-content .content {
        padding: 0px 20px 0px 80px;
    }
}

@media screen and (max-width: 1023px) {
    :root {
        --calculate: 1;
        --w-image: 100px;
    }

    .carousel .list .item .main-content .content h2 {
        font-size: 2.5em;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media screen and (max-width: 850px) {
    .carousel {
        height: var(--carousel-height-mobile);
        margin-top: var(--carousel-margin-top-mobile);
    }

    .main-content {
        display: flex;
        position: relative;
        padding: 20px;
    }

    .carousel .list .item .main-content .content {
        position: absolute;
        top: 80px;
        left: 20px;
        right: 20px;
        margin-bottom: 0;
        padding: 0;
    }

    .carousel .list .item .main-content .content h2 {
        font-size: 8vw;
    }

    .carousel .list .item .main-content .content .price {
        font-size: 5.2vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .carousel .list .item .main-content .content p.description {
        unicode-bidi: normal;
        margin-block-start: 0;
        margin-block-end: 0;
        margin-inline-start: 1px;
        margin-inline-end: 1px;
        display: block;
        width: calc(100vw - 40px);
        line-height: 1.3;
        font-size: 3.8vw;
    }

    .carousel .list .item .main-content .content p {
        unicode-bidi: normal;
        margin-block-start: 0;
        margin-block-end: 0;
        margin-inline-start: 2px;
        margin-inline-end: 2px;
        display: flex;
        width: calc(100vw - 40px);
        word-break: keep-all;
    }

    .carousel .list .item .main-content .content div {
        display: flex;
        gap: 8px;
        width: calc(100vw - 40px);
        padding-top: 5px;
    }

    .carousel .list .item .main-content .content a {
        display: block;
        flex: 1;
    }

    .carousel .list .item .main-content .content .addToCard {
        width: 100%;
        font-size: 0.9em;
        padding: 12px 10px;
        white-space: nowrap;
        cursor: pointer;
    }

    .carousel .list .item .image {
        width: 100%;
        left: 0;
        padding-top: 300px;
        padding-left: 0;
        padding-bottom: 0;
        justify-content: flex-end;
        position: absolute;
        bottom: 0;
        top: auto;
        z-index: 1;
        height: auto;
        pointer-events: none;
    }

    .carousel .list .item .image img {
        margin-bottom: 0;
    }

    .carousel .list .item .image figcaption {
        color: #fff;
        width: 100%;
        text-align: center;
        padding-bottom: 80px;
        margin-bottom: 0;
    }

    /* Use same slide animation as desktop with mobile-sized w-image */
    :root {
        --w-image: 100vw;
    }

    .carousel .list .item .main-content img {
        width: 75vw;
    }

    .arrows {
        display: none;
    }

    .carousel .list .item .image img {
        width: 35em;
    }
}

/* ========================================
   RESPONSIVE - KLEINE SMARTPHONES
   ======================================== */
@media screen and (max-width: 450px) {
    .carousel {
        height: var(--carousel-height-small-mobile);
        margin-top: -70px;
    }

    .carousel .list .item .image {
        padding-top: 240px;
    }

    .carousel .list .item .image img {
        width: 28em;
        max-width: 650px;
        height: 600px;
        object-fit: contain;
    }

    .carousel .list .item .main-content .content h2 {
        font-size: 10vw;
    }

    .carousel .list .item .main-content .content {
        padding-top: 50px;
    }

    .carousel .list .item .image figcaption {
        padding-bottom: 80px;
    }

    .carousel .list .item.other_1 .image figcaption {
        padding-bottom: 80px !important;
    }
}

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */
@keyframes slideInCarousel {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* ========================================
   SAFARI-SPEZIFISCHE ANPASSUNGEN (Mobile)
   ======================================== */
@media screen and (max-width: 850px) {
    /* Safari-only: -webkit-touch-callout ist nur in Safari verfügbar */
    @supports (-webkit-touch-callout: none) {
        .carousel .list .item .main-content .content {
            top: 40px !important;
        }
    }
}