/**
 * Style CSS dla Grey Way Slider - Frontend
 * Przeniesione i zaadaptowane z oryginalnego slidera
 */

/* Zmienne CSS dla nawigacji i animacji slajdów */
:root {
    /* Kolory nawigacji - powiązane z tłem slidera */
    --nav-bg-color: rgba(255, 255, 255, 0.3);
    --nav-bg-hover: rgba(255, 255, 255, 0.5);
    --nav-arrow-color: #d89389;
    --nav-arrow-hover: rgb(76, 76, 86);
    
    /* Gradient tła slidera - dla synchronizacji kolorów */
    --slider-gradient-start: #d8938993;
    --slider-gradient-end: rgb(76, 76, 86);
    
    /* Animacje slajdów */
    --item1-transform: translateX(-100%) translateY(-5%) scale(1.5);
    --item1-filter: blur(30px);
    --item1-zIndex: 11;
    --item1-opacity: 0;

    --item2-transform: translateX(0);
    --item2-filter: blur(0px);
    --item2-zIndex: 10;
    --item2-opacity: 1;

    --item3-transform: translate(50%,10%) scale(0.8);
    --item3-filter: blur(10px);
    --item3-zIndex: 9;
    --item3-opacity: 1;

    --item4-transform: translate(90%,20%) scale(0.5);
    --item4-filter: blur(30px);
    --item4-zIndex: 8;
    --item4-opacity: 1;
    
    --item5-transform: translate(120%,30%) scale(0.3);
    --item5-filter: blur(40px);
    --item5-zIndex: 7;
    --item5-opacity: 0;
}

/* Carousel - kontener główny */
.carousel {
    position: relative;
    height: 800px;
    overflow: hidden;
    margin: 20px 0;
    font-family: Poppins, sans-serif;
}

/* Reset stylów WordPress/motywu dla całego kontenera */
.carousel * {
    box-sizing: border-box;
}

.carousel p,
.carousel h1,
.carousel h2,
.carousel h3,
.carousel h4,
.carousel h5,
.carousel h6,
.carousel div,
.carousel span,
.carousel a,
.carousel button {
    line-height: normal !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Nadpisanie typowych resetów motywów WordPress */
.carousel .list .item .introduce *,
.carousel .list .item .detail * {
    max-height: none !important;
    min-height: auto !important;
}

/* Lista slajdów */
.carousel .list {
    position: absolute;
    width: 1140px;
    max-width: 90%;
    height: 80%;
    left: 50%;
    transform: translateX(-50%);
}

/* Pojedynczy slajd */
.carousel .list .item {
    position: absolute;
    left: 0%;
    width: 70%;
    height: 100%;
    font-size: 15px;
    transition: left 0.5s, opacity 0.5s, width 0.5s;
}

/* Ukryj slajdy od 6 wzwyż */
.carousel .list .item:nth-child(n + 6) {
    opacity: 0;
}

/* Aktywny slajd (drugi w kolejności) */
.carousel .list .item:nth-child(2) {
    z-index: 10;
    transform: translateX(0);
}

/* Obraz slajdu */
.carousel .list .item img {
    width: 50%;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: right 1.5s;
}

/* Sekcja wprowadzająca (główny widok) */
.carousel .list .item .introduce {
    opacity: 0;
    pointer-events: none;
}

.carousel .list .item:nth-child(2) .introduce {
    opacity: 1;
    pointer-events: auto;
    width: 400px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.5s;
}

.carousel .list .item .introduce .title {
    font-size: 2em;
    font-weight: 500;
    line-height: 1.2em !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

.carousel .list .item .introduce .topic {
    font-size: 4em;
    font-weight: 500;
    line-height: 1em !important;
    margin: 10px 0 !important;
    padding: 0 !important;
    display: block;
}

.carousel .list .item .introduce .des {
    font-size: small;
    color: #5559;
    padding-left: 10px;
    line-height: 1.6em !important;
    margin: 10px 0 !important;
    display: block;
    max-height: none !important;
    overflow: visible !important;
}

.carousel .list .item .introduce .seeMore {
    font-family: Poppins;
    margin-top: 1.2em !important;
    margin-bottom: 0 !important;
    padding: 5px 0 !important;
    border: none;
    border-bottom: 1px solid #555 !important;
    background-color: transparent;
    font-weight: bold;
    letter-spacing: 3px !important;
    transition: background 0.5s;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-block;
    color: inherit;
    line-height: 1.4em !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

.carousel .list .item .introduce .seeMore:hover {
    background: #eee;
}

/* Pozycjonowanie slajdów */
.carousel .list .item:nth-child(1) {
    transform: var(--item1-transform);
    filter: var(--item1-filter);
    z-index: var(--item1-zIndex);
    opacity: var(--item1-opacity);
    pointer-events: none;
}

.carousel .list .item:nth-child(3) {
    transform: var(--item3-transform);
    filter: var(--item3-filter);
    z-index: var(--item3-zIndex);
}

.carousel .list .item:nth-child(4) {
    transform: var(--item4-transform);
    filter: var(--item4-filter);
    z-index: var(--item4-zIndex);
}

.carousel .list .item:nth-child(5) {
    transform: var(--item5-transform);
    filter: var(--item5-filter);
    opacity: var(--item5-opacity);
    pointer-events: none;
}

/* Animacja tekstu w aktywnym slajdzie */
.carousel .list .item:nth-child(2) .introduce .title,
.carousel .list .item:nth-child(2) .introduce .topic,
.carousel .list .item:nth-child(2) .introduce .des,
.carousel .list .item:nth-child(2) .introduce .seeMore {
    opacity: 0;
    animation: showContent 0.5s 1s ease-in-out 1 forwards;
}

@keyframes showContent {
    from {
        transform: translateY(-30px);
        filter: blur(10px);
    }
    to {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0px);
    }
}

.carousel .list .item:nth-child(2) .introduce .topic {
    animation-delay: 1.2s;
}

.carousel .list .item:nth-child(2) .introduce .des {
    animation-delay: 1.4s;
}

.carousel .list .item:nth-child(2) .introduce .seeMore {
    animation-delay: 1.6s;
}

/* Animacje przejścia "next" */
.carousel.next .item:nth-child(1) {
    animation: transformFromPosition2 0.5s ease-in-out 1 forwards;
}

@keyframes transformFromPosition2 {
    from {
        transform: var(--item2-transform);
        filter: var(--item2-filter);
        opacity: var(--item2-opacity);
    }
}

.carousel.next .item:nth-child(2) {
    animation: transformFromPosition3 0.7s ease-in-out 1 forwards;
}

@keyframes transformFromPosition3 {
    from {
        transform: var(--item3-transform);
        filter: var(--item3-filter);
        opacity: var(--item3-opacity);
    }
}

.carousel.next .item:nth-child(3) {
    animation: transformFromPosition4 0.9s ease-in-out 1 forwards;
}

@keyframes transformFromPosition4 {
    from {
        transform: var(--item4-transform);
        filter: var(--item4-filter);
        opacity: var(--item4-opacity);
    }
}

.carousel.next .item:nth-child(4) {
    animation: transformFromPosition5 1.1s ease-in-out 1 forwards;
}

@keyframes transformFromPosition5 {
    from {
        transform: var(--item5-transform);
        filter: var(--item5-filter);
        opacity: var(--item5-opacity);
    }
}

/* Animacje przejścia "previous" */
.carousel.prev .list .item:nth-child(5) {
    animation: transformFromPosition4 0.5s ease-in-out 1 forwards;
}

.carousel.prev .list .item:nth-child(4) {
    animation: transformFromPosition3 0.7s ease-in-out 1 forwards;
}

.carousel.prev .list .item:nth-child(3) {
    animation: transformFromPosition2 0.9s ease-in-out 1 forwards;
}

.carousel.prev .list .item:nth-child(2) {
    animation: transformFromPosition1 1.1s ease-in-out 1 forwards;
}

@keyframes transformFromPosition1 {
    from {
        transform: var(--item1-transform);
        filter: var(--item1-filter);
        opacity: var(--item1-opacity);        
    }
}

/* Widok szczegółowy (detail) */
.carousel .list .item .detail {
    opacity: 0;
    pointer-events: none;
}

/* Stan showDetail - widok szczegółowy */
.carousel.showDetail .list .item:nth-child(3),
.carousel.showDetail .list .item:nth-child(4) {
    left: 100%;
    opacity: 0;
    pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(2) {
    width: 100%;
}

.carousel.showDetail .list .item:nth-child(2) .introduce {
    opacity: 0;
    pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(2) img {
    right: 50%;
}

.carousel.showDetail .list .item:nth-child(2) .detail {
    opacity: 1;
    width: 50%;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    pointer-events: auto;
}

.carousel.showDetail .list .item:nth-child(2) .detail .title {
    font-size: 4em;
    line-height: 1em !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    display: block;
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications {
    display: flex;
    gap: 10px;
    width: 100%;
    border-top: 1px solid #5553;
    margin-top: 20px;
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications div {
    width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications div p:nth-child(1) {
    font-weight: bold;
    line-height: 1.4em !important;
    margin: 5px 0 !important;
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications div p:nth-child(2) {
    line-height: 1.4em !important;
    margin: 5px 0 !important;
}

.carousel.showDetail .list .item:nth-child(2) .detail .des {
    line-height: 1.6em !important;
    margin: 15px 0 !important;
    padding: 0 !important;
    max-height: none !important;
}

.carousel.carousel.showDetail .list .item:nth-child(2) .checkout button {
    font-family: Poppins;
    background-color: transparent;
    border: 1px solid #5555;
    margin-left: 5px;
    padding: 5px 10px;
    letter-spacing: 2px;
    font-weight: 500;
    cursor: pointer;
}

.carousel.carousel.showDetail .list .item:nth-child(2) .checkout button:nth-child(2) {
    background-color: #693EFF;
    color: #eee;
}

/* Animacja pojawiania się detali */
.carousel.showDetail .list .item:nth-child(2) .detail .title,
.carousel.showDetail .list .item:nth-child(2) .detail .des,
.carousel.showDetail .list .item:nth-child(2) .detail .specifications,
.carousel.showDetail .list .item:nth-child(2) .detail .checkout {
    opacity: 0;
    animation: showContent 0.5s 1s ease-in-out 1 forwards;
}

.carousel.showDetail .list .item:nth-child(2) .detail .des {
    animation-delay: 1.2s;
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications {
    animation-delay: 1.4s;
}

.carousel.showDetail .list .item:nth-child(2) .detail .checkout {
    animation-delay: 1.6s;
}

/* Nawigacja boczna - paski po lewej i prawej stronie */
.arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 12;
}

/* Paski nawigacyjne - białe z przezroczystością */
#prev,
#next {
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    border: none;
    background-color: var(--nav-bg-color);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Strzałki SVG - używamy mask dla kolorowania */
#prev::before,
#next::before {
    content: '';
    width: 50px;
    height: 50px;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    background-color: var(--nav-arrow-color);
    transition: background-color 0.3s ease;
}

#prev::before {
    mask-image: url('trangle-left.svg');
    -webkit-mask-image: url('trangle-left.svg');
}

#next::before {
    mask-image: url('triangle-right.svg');
    -webkit-mask-image: url('triangle-right.svg');
}

#prev {
    left: 0;
}

#next {
    right: 0;
}

/* Pokaż paski TYLKO przy najechaniu na krawędzie (na same paski) */
#prev:hover,
#next:hover {
    opacity: 1;
    background-color: var(--nav-bg-hover);
}

/* Zmiana koloru strzałki przy hover */
#prev:hover::before,
#next:hover::before {
    filter: brightness(0) saturate(100%) invert(27%) sepia(7%) saturate(864%) hue-rotate(183deg) brightness(94%) contrast(86%);
}

#back {
    position: absolute;
    z-index: 100;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border: none;
    border-bottom: 1px solid #555;
    font-family: Poppins;
    font-weight: bold;
    letter-spacing: 3px;
    background-color: transparent;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.5s;
    cursor: pointer;
    pointer-events: none;
}

.carousel.showDetail #back {
    opacity: 1;
    pointer-events: auto;
}

.carousel.showDetail #prev,
.carousel.showDetail #next {
    opacity: 0;
    pointer-events: none;
}

/* Efekt tła blur */
.carousel::before {
    width: 500px;
    height: 300px;
    content: '';
    background-image: linear-gradient(70deg, var(--slider-gradient-start), var(--slider-gradient-end));
    position: absolute;
    z-index: -1;
    border-radius: 20% 30% 80% 10%;
    filter: blur(150px);
    top: 50%;
    left: 50%;
    transform: translate(-10%, -50%);
    transition: 1s;
}

.carousel.showDetail::before {
    transform: translate(-100%, -50%) rotate(90deg);
    filter: blur(130px);
}

/* Responsywność - tablety */
@media screen and (max-width: 991px) {
    .carousel .list .item {
        width: 90%;
    }
    
    .carousel.showDetail .list .item:nth-child(2) .detail .specifications {
        overflow: auto;
    }
    
    .carousel.showDetail .list .item:nth-child(2) .detail .title {
        font-size: 2em;
    }
}

/* Responsywność - mobile */
@media screen and (max-width: 767px) {
    .carousel {
        height: 600px;
    }
    
    .carousel .list .item {
        width: 100%;
        font-size: 10px;
    }
    
    .carousel .list {
        height: 100%;
    }
    
    .carousel .list .item:nth-child(2) .introduce {
        width: 50%;
    }
    
    .carousel .list .item img {
        width: 80%
    }
    
    .carousel.showDetail .list .item:nth-child(2) .detail {
        backdrop-filter: blur(30px) !important;
        -webkit-backdrop-filter: blur(30px) !important;
        font-size: small;
    }
    
    .carousel .list .item:nth-child(2) .introduce .des,
    .carousel.showDetail .list .item:nth-child(2) .detail .des {
        height: 100px;
        overflow: auto;
        color: #0009;
        text-shadow: white 1px 1px 4px;
    }
    
    .carousel.showDetail .list .item:nth-child(2) .detail .checkout {
        display: flex;
        width: max-content;
        float: right;
    }
    
    /* Ukryj paski nawigacyjne na mobile - zastąpione przez swipe */
    #prev,
    #next {
        display: none;
    }
}

/* Komunikat gdy brak slajdów */
.greyway-slider-notice {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    color: #999;
    font-style: italic;
    margin: 20px 0;
}
