/* global definitions */
:root {
    --cars-bg-color: #1D1D1B;
    --cars-titel-color: #fcbf00;
    --cars-text-color: #e0e0e0;
    --car-card-title-bg-color: #fcbf00;
    --car-card-title-color: #1D1D1B;
    --car-card-price-bg-color: #fcbf00;
    --car-card-price-color: #1D1D1B;
    --car-card-text-color: #e0e0e0;
    --car-card-sold-stamp-color: #ff0000;
}

.sec-cars {
    display: flex;
    width: 100%;
    background-color: var(--cars-bg-color);

    & h1 {
        color: var(--cars-titel-color);
        text-shadow: #202020 3px 5px 2px;
        word-wrap: break-word;
    }

    & .cars-act-box {
        width: 100%;
        display: flex;
        flex-wrap: wrap;

        & a {
            text-decoration: none;
        }
    }

    & .cars-sold-caroussel {
        position: relative;
        width: 100dvw;
        white-space: nowrap;
        overflow: hidden;

        & .cars-sold-box {
            display: inline-flex;
            flex-direction: row;
            animation: 30s roll-sold-cars infinite linear;
        }
    }

    & .cars-sold-caroussel::before {
        position: absolute;
        top: 0;
        left: 0;
        width: 5rem;
        height: 100%;
        content: "";
        z-index: 20;
        background: linear-gradient(to left, rgba(255, 255, 255, 0), var(--cars-bg-color));
    }

    & .cars-sold-caroussel::after {
        position: absolute;
        top: 0;
        right: 0;
        width: 5rem;
        height: 100%;
        content: "";
        z-index: 20;
        background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--cars-bg-color));
    }
}

.car-card {
    position: relative;
    border-radius: 2px;
    background-image: url(../images/textures/bg_ripple.jpg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    & .car-card-inner {
        display: flex;
        flex-direction: column;
        border-radius: 2px;
        overflow: hidden;

        & .car-card-title {
            position: absolute;
            top: 0;
            left: 0;
            text-align: left;
            font-weight: bold;
            color: var(--car-card-title-color);
            background-color: var(--car-card-title-bg-color);
            border-top-left-radius: 2px;
            clip-path: polygon(0% 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
            -webkit-clip-path: polygon(0% 0%, 100% 0%, calc(100% - 20px) 100%, 0% 100%);
        }

        & .car-card-price {
            position: absolute;
            bottom: 0;
            right: 0;
            text-align: left;
            font-weight: bold;
            color: var(--car-card-price-color);
            background-color: var(--car-card-price-bg-color);
            border-bottom-right-radius: 2px;
            clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 0% 100%);
            -webkit-clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 0% 100%);
        }

        & img {
            width: 100%;
            height: auto;
        }

        & .car-card-det {
            display: block;
            text-align: center;
            color: var(--car-card-text-color);
        }
    }
}

.car-card-sold {
    margin: 0 2rem;

    & .car-card-inner {
        & .car-card-price {
            text-decoration: line-through;
            color: transparent;
            text-shadow: 0 0 8px #000;
        }
    }
}

.car-card-sold::after {
    position: absolute;
    left: 50%;
    content: "VERKAUFT";
    border: solid 5px var(--car-card-sold-stamp-color);
    color: var(--car-card-sold-stamp-color);
    transform: translateX(-50%) rotate(-31deg);
    font-weight: bolder;
}

@keyframes roll-sold-cars {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@media screen and (min-width: 1200px) {
    .sec-cars {
        padding: 3rem 0;

        & h1 {
            padding: 2.5rem 0rem;
            font-size: 5rem;
        }

        & .cars-act-box {
            min-width: 1000px;
            padding: 3rem 0;
            flex-direction: row;
            justify-content: space-around;
            gap: 3rem;
        }

        & .cars-sold-caroussel {
            max-width: 1200px;
            padding: 3rem 0;;
        }
    }

    .car-card {
        width: 350px;

        & .car-card-inner {
            & .car-card-title {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 20px;
                padding-right: 40px;
                font-size: 2rem;
                transition: all 200ms ease;
            }

            & .car-card-price {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 40px;
                padding-right: 20px;
                font-size: 2rem;
            }

            & .car-card-det {
                padding: 2rem 0;
                padding-bottom: 50px;
                font-size: 1.6rem;
            }
        }

        & .car-card-inner:hover {
            & .car-card-title {
                padding-left: 50px;
            }
        }
    }

    .car-card-sold::after {
        top: 100px;
        font-size: 3rem;
        padding: 1.5rem 3rem;
        border-radius: 1.5rem;
    }
}

@media screen and (min-width: 992px) and (max-width: 1200px) {
    .sec-cars {
        padding: 3rem 0;

        & h1 {
            padding: 2.5rem 0rem;
            font-size: 5rem;
        }

        & .cars-act-box {
            width: 100%;
            flex-direction: row;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 3rem;
            padding: 3rem 0;
        }

        &.cars-sold-caroussel {
            padding: 3rem 0;
        }
    }

    .car-card {
        width: 350px;

        & .car-card-inner {
            & .car-card-title {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 20px;
                padding-right: 40px;
                font-size: 2rem;
                transition: all 200ms ease;
            }

            & .car-card-price {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 40px;
                padding-right: 20px;
                font-size: 2rem;
            }

            & .car-card-det {
                padding: 2rem 0;
                padding-bottom: 50px;
                font-size: 1.6rem;
            }
        }

        & .car-card-inner:hover {
            & .car-card-title {
                padding-left: 50px;
            }
        }
    }

    .car-card-sold::after {
        top: 100px;
        font-size: 2.8rem;
        padding: 1.4rem 2.8rem;
        border-radius: 1.5rem;
    }
}

@media screen and (min-width: 768px) and (max-width: 992px) {
    .sec-cars {
        padding: 3rem 0;

        &  h1 {
            padding: 2.5rem 0rem;
            font-size: 5rem;
        }

        & .cars-act-box {
            width: 100%;
            flex-direction: row;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 3rem;
            padding: 2.5rem 0;
        }

        & .cars-sold-caroussel {
            padding: 2.5rem 0;
        }
    }

    .car-card {
        width: 320px;

        & .car-card-inner {
            & .car-card-title {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 20px;
                padding-right: 40px;
                font-size: 2rem;
                transition: all 200ms ease;
            }

            & .car-card-price {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 40px;
                padding-right: 20px;
                font-size: 2rem;
            }

            & .car-card-det {
                padding: 2rem 0;
                padding-bottom: 50px;
                font-size: 1.6rem;
            }
        }

        & .car-card-inner:hover {
            & .car-card-title {
                padding-left: 50px;
            }
        }
    }

    .car-card-sold::after {
        top: 100px;
        font-size: 2.3rem;
        padding: 1rem 2.3rem;
        border-radius: 1.5rem;
    }
}

@media screen and (min-width: 480px) and (max-width: 768px) {
    .sec-cars {
        padding: 3rem 0;

        & h1 {
            padding: 2.5rem 0rem;
            font-size: 4rem;
        }

        & .cars-act-box {
            width: 100%;
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            gap: 3rem;
            padding: 2.5rem 0;
        }

        & .cars-sold-caroussel {
            padding: 2.5rem 0;
        }
    }

    .car-card {
        width: 350px;

        & .car-card-inner {
            & .car-card-title {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 20px;
                padding-right: 40px;
                font-size: 2rem;
                transition: all 200ms ease;
            }

            & .car-card-price {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 40px;
                padding-right: 20px;
                font-size: 2rem;
            }

            & .car-card-det {
                padding: 2rem 0;
                padding-bottom: 50px;
                font-size: 1.6rem;
            }
        }

        & .car-card-inner:hover {
            & .car-card-title {
                padding-left: 50px;
            }
        }
    }

    .car-card-sold::after {
        top: 80px;
        font-size: 2.3rem;
        padding: 1rem 2.3rem;
        border-radius: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .sec-cars {
        padding: 1rem 0;

        & h1 {
            padding: 2.5rem 0rem;
            font-size: 4rem;
        }

        & .cars-act-box {
            width: 100%;
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            gap: 2rem;
            padding: 2.5rem 0;
        }

        & .cars-sold-caroussel {
            padding: 2.5rem 0;
        }
    }

    .car-card {
        width: 300px;

        & .car-card-inner {
            & .car-card-title {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 20px;
                padding-right: 40px;
                font-size: 2rem;
                transition: all 200ms ease;
            }

            & .car-card-price {
                padding-top: 5px;
                padding-bottom: 5px;
                padding-left: 40px;
                padding-right: 20px;
                font-size: 2rem;
            }

            & .car-card-det {
                padding: 2rem 0;
                padding-bottom: 50px;
                font-size: 1.6rem;
            }
        }

        & .car-card-inner:hover {
            & .car-card-title {
                padding-left: 50px;
            }
        }
    }

    .car-card-sold::after {
        top: 80px;
        font-size: 2.3rem;
        padding: 1rem 2.3rem;
        border-radius: 1.5rem;
    }
}