@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900");

@keyframes fadeInSpawn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes translateSpawn {
    0% {
        opacity: 0;
        translate: 0 1.5rem;
    }

    100% {
        opacity: 1;
        translate: 0;
    }
}

@keyframes timingBar {
    0% {
        width: 100%;
    }

    100% {
        width: 0;
    }
}

@keyframes load {
    0% {
        --tail: 0%;
        --nose: 0%;
    }

    40%,
    60% {
        --nose: 100%;
        --tail: 0%;
    }

    100% {
        --nose: 100%;
        --tail: 100%;
    }
}

@keyframes homePosterTransform {
    to {
        padding: calc(var(--header-height) * 1.5) var(--h-gap2);
        --border-radius-child: 1rem;
    }
}

@keyframes logoSlider {
    from {
        translate: 0;
    }

    to {
        translate: -100% 0;
    }
}

@keyframes hamburgerElementSpawn {
    0% {
        opacity: 0;
        translate: 0 1.25rem;
    }

    100% {
        opacity: 1;
        translate: 0;
    }
}

@keyframes upBump {
    0% {
        translate: 0;
    }

    100% {
        translate: 0 -.5rem;
    }
}

@keyframes articleSpawn {
    0% {
        scale: 0;
        height: 0;
        margin-bottom: 0;
        min-height: 0;
    }

    100% {
        scale: 1;
        height: 6.5rem;
        margin-bottom: 1.5rem;
        min-height: 7rem;
    }
}

@keyframes articleDelete {
    0% {
        scale: 1;
        height: 6.5rem;
        margin-bottom: 1.5rem;
        min-height: 7rem;
    }

    100% {
        scale: 0;
        height: 0;
        margin-bottom: 0;
        min-height: 0;
    }
}

:root {
    --transition-duration-popup: .2s;
    --transition-duration-hamburger: .5s;
    --squared-border-radius: 1rem;
    --rounded-border-radius: 100vmax;
    --header-height: clamp(77.5px, 9vh, 95px);
    --annoucement-headbar-height: clamp(30px, 4vh, 45px);
    --all-header-height: calc(var(--header-height) + var(--annoucement-headbar-height));
    --btn-height: 3.25rem;
    --h-gap: calc(10vw / 1.25);
    --h-gap2: calc(var(--h-gap) / 1.75);
    --v-gap: 5vh;
    --btn-gap: .75rem;
    --primary-color: hsl(0, 0%, 100%);
    --primary-color-hover: hsl(0, 0%, 95%);
    --primary-color-active: hsl(0, 0%, 90%);
    --accent-color: hsl(0, 0%, 10%);
    --accent-color-hover: hsl(0, 0%, 15%);
    --accent-color-active: hsl(0, 0%, 20%);
    --border-color: hsl(0, 0%, 88.2%);
    --text-color2: hsl(0, 0%, 67.8%);
    --text-color3: hsl(0, 0%, 44.3%);
    --color2: hsl(0, 0%, 97.3%);
    --color3: hsl(0, 0%, 88.2%);
    --color4: hsl(0, 0%, 54.5%);
    --second-color: hsl(44.9, 96.7%, 47.6%);
    --overlay-color: hsla(0, 0%, 0%, 0.65);
    --default-font-weight: 400;
    --stroke-width: 1;
}

.high-contrast {
    --accent-color: hsl(0, 0%, 0%);
    --accent-color-hover: hsl(0, 0%, 5%);
    --accent-color-active: hsl(0, 0%, 10%);
    --border-color: hsl(0, 0%, 80%);
    --primary-color: hsl(0, 0%, 100%);
    --primary-color-hover: hsl(0, 0%, 95%);
    --primary-color-active: hsl(0, 0%, 90%);
    --text-color2: hsl(0, 0%, 80%);
    --text-color3: hsl(0, 0%, 60%);
    --color3: hsl(0, 0%, 90%);
    --color4: hsl(0, 0%, 70%);
    --second-color: hsl(11, 97%, 48%);
    --overlay-color: hsla(0, 0%, 0%, 0.8);
    --default-font-weight: 500;
    --stroke-width: 1.25;
}

:disabled {
    opacity: 0.8;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    font-size: .925rem;
    -webkit-box-sizing: border-box !important;
    -moz-box-sizing: border-box !important;
    -o-box-sizing: border-box !important;
    -ms-box-sizing: border-box !important;
    box-sizing: border-box !important;
    font-family: "First Line", sans-serif;
}

html {
    scroll-behavior: smooth;
    background-color: var(--accent-color);
}

body {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--accent-color);
    font-weight: var(--default-font-weight);
    background-color: var(--primary-color);
    width: 100vw;
    overflow: hidden auto;
    visibility: hidden;

    &:has(.popup__container.open),
    &:has(.cart__added__announcement__popup__container.open) {
        overflow: hidden;
    }


    /* &:has(.cart__added__announcement__popup__container.open), */
    &:has(.search__section__container.unfolded),
    &:has(.search__section__container.open) {
        overflow: hidden;

/*         .overlay {
            height: calc(100vh - var(--header-height) + 1px);
            top: calc(var(--all-header-height) + 1px);

            display: block !important;

            &.open {
                opacity: 1;
                pointer-events: all;
            }
        } */
    }
}

h1,
h2,
h3,
h4 {
    font-weight: 500;
}

a {
    text-decoration: none;
    color: inherit;
    position: relative;
    width: fit-content;
    cursor: pointer;
    background: linear-gradient(#000, #000) no-repeat 0 100%/0 1px;
    background-size: 0px 1px;
    transition: background-size .3s cubic-bezier(.39, .575, .565, 1);

    /*     &::after {
        content: "";
        position: absolute;
        bottom: -.225rem;
        height: 1px;
        width: 0;
        background-color: var(--accent-color);
        transition: width .375s ease;
    } */

    [dir="ltr"] &::after {
        left: 0;
    }

    [dir="rtl"] &::after {
        right: 0;
    }

    &:hover {
        background-size: 100% 1px;
    }

    &:hover::after {
        width: 100%;
    }
}

button,
select {
    color: inherit;
}

li {
    list-style: none;
    cursor: pointer;
}

input {
    outline: none;
    font-size: 1rem;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none; /* Désactive l'apparence par défaut */
    appearance: none;
}

button {
    border: none;
    background-color: transparent;
    cursor: pointer;
}

svg {
    stroke-width: var(--stroke-width);

    &.lucide {
        stroke: var(--accent-color);
    }

    &.size-s {
        width: 1rem;
        height: 1rem;
    }

    &.size-m {
        width: 1.125rem;
        height: 1.125rem;
    }

    &.size-l {
        width: 1.5rem;
        height: 1.5rem;
    }
}

img {
    pointer-events: none;
    user-select: none;
}

.muted {
    font-size: 0.9rem;
    color: var(--text-color3);
}

main {
    background-color: var(--primary-color);
}

.lucide-chevron-right,
.lucide-chevron-left,
.lucide-chevron-up,
.lucide-chevron-down {
    stroke-width: calc(var(--stroke-width) * .75);
}

.popup__container {
    width: clamp(38rem, 45vw, 65rem);
    position: fixed;
    top: 0;
    height: 100dvh;
    z-index: 1000;
    background-color: var(--primary-color);
    transition: var(--transition-duration-popup) ease-in;
    padding: calc(var(--header-height) / 1.375 + 3rem) 0 0;

    &.open {
        transform: translateZ(0) !important;
    }

    [dir="ltr"] & {
        right: 0;
        transform: translate3d(100%, 0, 0);
    }

    [dir="rtl"] & {
        left: 0;
        transform: translate3d(-100%, 0, 0);
    }

    /*MARK: Popups Headers */
    .popup__container__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        width: calc(100% - 14vw);
        margin-top: calc(var(--header-height) / 1.375);
        background-color: var(--primary-color);
        height: 3rem;
        gap: clamp(1rem, 2vw, 2.5rem);
        margin: calc(var(--header-height) / 1.375) 7vw 1rem;

        &.popup__container__header__back {
            justify-content: flex-start;

            svg {
                stroke-width: var(--stroke-width);

                [dir="rtl"] & {
                    transform: rotate(180deg);
                }
            }
        }

        &.scrolled {
            border-bottom: solid 1px var(--border-color);
        }

        h1 {
            font-size: 1.55rem;
        }

        button {
            height: 2.5rem;
            width: auto;
            aspect-ratio: 1 / 1;

            svg {
                height: 100%;
                width: 100%;
                padding: .5rem;
            }
        }
    }
}

.popup__container__content {
    background-color: var(--primary-color);
    padding-top: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden auto;
    padding: 0 7vw;
    padding-bottom: calc(var(--header-height) / 1.375 + 1.5rem);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    transition: opacity var(--transition-duration-popup) ease-in, height var(--transition-duration-popup) ease-in;
    opacity: 0;
    height: 100vh;
    width: 100vw;
    background-color: var(--overlay-color);
    z-index: 900;
    user-select: none;
    pointer-events: none;
}

.submit__btn {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-radius: var(--squared-border-radius);
    height: var(--btn-height);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-color);
    font-weight: 500;
    gap: 1rem;
    position: relative;
    transition: outline-color .2s, border .3s cubic-bezier(.39, .575, .565, 1), box-shadow .3s cubic-bezier(.39, .575, .565, 1), color .3s cubic-bezier(.39, .575, .565, 1), background-color .25s cubic-bezier(.19, 1, .22, 1);

    svg{
        stroke: var(--primary-color);
    }

    &:focus {
        outline: thin solid rgba(71, 71, 71, 0.45);
    }

    &:hover {
        background-color: var(--accent-color-hover);
    }

    &:active {
        background-color: var(--accent-color-active);
    }

    &.variant__primary {
        background-color: var(--primary-color);
        color: var(--accent-color);

        svg{
            stroke: var(--accent-color);
        }

        &:hover {
            background-color: var(--primary-color-hover);
        }

        &:active {
            background-color: var(--primary-color-active);
        }
    }
}

.input__container {
    display: flex;
    align-items: center;
    position: relative;
    transition: outline-color .2s;

    &:hover {
        label {
            color: var(--accent-color);
        }

        input {
            border: 1px solid var(--accent-color);
        }
    }

    &.hidded__container {
        opacity: 0;
        scale: 0;
        height: 0;
        margin-bottom: 0;
        transition: .25s ease;

        &.visible {
            opacity: 1;
            scale: 1;
            height: auto;
            margin-bottom: 1rem;
        }
    }
}

.input__field {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--squared-border-radius);
    width: 100%;
    background-color: transparent;
    transition: outline-color .2s, border .2s ease;

    &:focus {
        outline: thin solid rgba(71, 71, 71, 0.45);
    }

    &:focus,
    &.filled {
        border: 1px solid var(--accent-color);

        +label {
            font-size: .85rem;
            translate: -3px -26px;
            color: var(--accent-color);
            z-index: 1;
        }
    }
}

.label__input {
    position: absolute;
    left: 1.25rem;
    display: flex;
    cursor: text;
    color: var(--text-color2);
    height: fit-content;
    background-color: var(--primary-color);
    transition: .2s;
    z-index: 1;

    [dir="rtl"] & {
        left: unset;
        right: 1.25rem;
    }
}

/* 
    MARK: Select
*/

.select__container {
    display: flex;
    align-items: unset;
    height: var(--btn-height);
    position: relative;
    width: 100%;
}

.select__all__container {
    background-color: var(--primary-color);
    border: 1px solid var(--accent-color);
    border-radius: var(--squared-border-radius);
    display: flex;
    flex-direction: column;
    position: absolute;
    z-index: 2;
    width: 100%;
    transition: box-shadow .25s cubic-bezier(.55, .09, .68, .53), outline-color .2s;

    &:active {
        outline: thin solid rgba(71, 71, 71, 0.45);
    }

    &:has(.selected__item__container.open) {
        outline: none;
        box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
    }
}

.selected__item__container {
    display: flex;
    justify-content: space-between;
    height: var(--btn-height);
    align-items: center;
    padding: 0 1.25rem;
    width: 100%;

    &.open {
        svg {
            transition: rotate .25s cubic-bezier(.55, .09, .68, .53);
            rotate: 180deg;
        }

        ~.select__other__items__wrapper {
            transition: grid-template-rows .25s cubic-bezier(.55, .09, .68, .53);
            grid-template-rows: 1fr;
            /* z-index: 99; */
            /* max-height: 20rem; */

            .select__other__items__container {
                transition: height .25s cubic-bezier(.55, .09, .68, .53);
                height: auto;

                ul,
                header {
                    transition: unset;
                    visibility: visible;

                    li {
                        transition: opacity .25s cubic-bezier(.55, .09, .68, .53) calc((var(--order) + 1) * 40ms), background-color .15s ease-in;
                        opacity: 1;
                    }
                }
            }
        }
    }

    svg {
        stroke-width: .75;
        transition: rotate .2s cubic-bezier(.17, .84, .44, 1);
    }
}

.select__other__items__wrapper {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows .2s cubic-bezier(.17, .84, .44, 1), z-index .15s cubic-bezier(.17, .84, .44, 1);
    /* margin-top: 2.6rem; */
    /* position: absolute; */
    /* z-index: -1; */
    width: 100%;
    background-color: var(--primary-color);
    border-bottom-left-radius: var(--squared-border-radius);
    border-bottom-right-radius: var(--squared-border-radius);
    /* border: 1px solid var(--accent-color);
    border-top: none; */
}

.select__other__items__container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    transition: height .2s cubic-bezier(.17, .84, .44, 1);
    background-color: var(--primary-color);
    overflow: hidden;

    header,
    ul {
        display: flex;
        visibility: hidden;
        transition: visibility .2s cubic-bezier(.17, .84, .44, 1);
    }

    header {
        justify-content: space-between;
        padding: 0 1.25rem;
        margin-top: .5rem;
        height: auto;
    }

    ul {
        flex-direction: column;
        border-top: 1px solid var(--border-color);
        margin-top: .5rem;

        li {
            display: flex;
            width: 100%;
            text-align: left;
            opacity: 0;
            padding: .5rem 1.25rem;
            justify-content: space-between;

            &:hover {
                background-color: var(--color2);
            }

            &.selected {
                background-color: var(--color3);
            }

            span {
                width: 6rem;
                height: auto;
                text-align: center;

                &:first-of-type {
                    text-align: left;
                    width: 5rem;
                }

                &:last-of-type {
                    text-align: right;
                }
            }
        }
    }
}

.spinner {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 800;
    stroke-width: .25;

    max-height: 100%;
    width: auto;
    aspect-ratio: 1/1;
    min-height: 1.3rem;
    height: calc(15% / 3.14);
}

/* Progress Bar Like Youtube */
.progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    z-index: 9999;
    visibility: visible;
}

.progress-bar {
    height: 3px;
    width: 0%;
    background-color: #000;
    transition: width 0.4s ease;
    opacity: 0.65;
}

.caroussel__img {
    width: 100%;
    user-select: none;
    object-fit: contain;
    pointer-events: none;
}

/*
MARK: Card 
*/

.product__list__container {
    display: flex;
    flex-direction: column;
    padding: 0 var(--h-gap2);
    margin-top: 1rem;

    h1 {
        font-size: 1.1rem;
        height: calc(var(--header-height) / 1.25);
        display: flex;
        align-items: center;
    }

    .product__cards__list {
        display: grid;
        grid-auto-flow: row;
        grid-template-columns: repeat(6, 1fr);
        height: 100%;
        position: relative;

        /*&::before,
        &::after {
            content: "";
            position: absolute;
            top: 0;
            width: 20%;
            height: 100%;
            z-index: 9;
        }

        &::before {
            left: 0;
            background: linear-gradient(to left, rgba(255, 255, 255, 0), white);
        }

        &::after {
            right: 0;
            background: linear-gradient(to right, rgba(255, 255, 255, 0), white);
        }*/

        /*.card__arrow__navigation {
            position: absolute;
            top: 50%;
            left: 0;
            z-index: 99;

            &.right {
                left: unset;
                right: 0;
            }
        }*/
    }
}

.product__card {
    position: relative;
    display: flex;
    grid-column: span 1;
    cursor: pointer;
    height: 425px;

    .caroussel__product__card {
        position: relative;
        height: 100%;
        width: 100%;

        &::-webkit-scrollbar {
            display: none;
        }

        .caroussel__product__card__img__wrapper {
            overflow: auto;
            width: 100%;
            height: 100%;
            display: flex;
            scroll-behavior: smooth;
            scroll-snap-type: x mandatory;
            scrollbar-width: none;
        }

        .product__section__arrow__navigator {
            background-color: transparent;
            position: absolute;
            top: 50%;
            left: 1.25rem;
            translate: 0 -50%;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: var(--squared-border-radius);
            transition: scale .15s ease, opacity .125s ease;
            height: 1.5rem;
            aspect-ratio: 1/1;
            opacity: 0;
            z-index: 1;

            &:active {
                scale: 0.9;
            }

            &#arrow__right {
                left: unset;
                right: 1.25rem;
            }

            svg {
                color: var(--accent-color);
                height: auto;
                width: 1.5rem;
                z-index: 9;

                &:has(:disabled:is(:true)) {
                    opacity: 0.5;
                    pointer-events: none;
                }
            }

            .caroussel__product__card:hover & {
                opacity: 1;
            }
        }

        .caroussel__product__card__img__container {
            min-width: 100%;
            display: flex;
            scroll-snap-align: center;
            scroll-snap-stop: always;
            position: relative;
            background: url("../../assets/product-card-gradients/gradient_default.svg") 0 0/cover no-repeat;
        }
    }

    .product__card__infos__container {
        position: absolute;
        bottom: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 1rem 1.25rem;

        .product__card__infos__wrapper {
            display: flex;
            flex-direction: column;
            gap: 0.225rem;
        }

        .product__section__color__dots {
            display: flex;
            gap: 0.275rem;
            align-items: end;
        }
    }

    .product__features {
        position: absolute;
        top: 0;
        width: 100%;
        padding: 1.25rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.product__section__color__dot {
    padding: .45rem;
    aspect-ratio: 1/1;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;

    &::after {
        content: "";
        display: block;
        position: absolute;
        left: 50%;
        bottom: min(-.25rem, -.15rem);
        height: 1px;
        width: 0;
        background-color: var(--accent-color);
        transition: width .25s ease, left .25s ease;
    }

    &:hover::after,
    &.active::after {
        width: 100%;
        left: 0;
    }
}

.wishlist__btn {
    display: flex;
    transition: scale .1s;
    position: relative;

    .spinner {
        position: static !important;
        transform: none;
    }

    &:hover {
        scale: 1.1;
    }

    &:active {
        scale: 0.9;
    }
}

/* 
    MARK: Toggle
*/

.toggle__switch {
    position: relative;
    display: inline-block;
    min-width: 2.5rem;
    height: 1.5rem;

    input {
        opacity: 0;
        width: 0;
        height: 0;

        &:checked+.toggle__slider {
            background-color: var(--accent-color);
        }

        &:checked+.toggle__slider:before {
            transform: translateX(1rem);
        }

        &:focus+.toggle__slider {
            box-shadow: 0 0 1px var(--accent-color);
        }

        &:disabled+.toggle__slider {
            opacity: 0.8;
            cursor: not-allowed;
            pointer-events: none;
        }
    }

    .toggle__slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #767676;
        transition: .4s;
        border-radius: 100vmax;

        &:before {
            position: absolute;
            content: "";
            height: 1.25rem;
            width: 1.25rem;
            left: 0.125rem;
            bottom: 0.125rem;
            background-color: var(--primary-color);
            transition: .4s;
            border-radius: 100vmax;
        }
    }
}

/* 
    MARK: Checkbox personalized
*/

.checkbox__container {
    display: flex;
    flex-direction: row;
    gap: .3rem;
    cursor: pointer;
    user-select: none;
    align-items: center;
}

.checkbox {
    display: none;
}

.checked__container {
    display: flex;
    flex-direction: row;
    align-self: start;
}

@media screen and (max-width: 1028px) {
    .product__card {
        grid-column: span 3;
    }
}