@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Radio+Canada:ital,wght@0,300..700;1,300..700&display=swap');

* {
    transition: all 0.3s ease;
}

body {
    background-color: #1a1a2e;
    font-family: Kanit
}

body::-webkit-scrollbar {
    display: none;
}

.Printer {
    margin-inline: 1.5rem;
    padding-block: 5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.Printer__title {
    font-size: 1.5rem;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    margin-top: 100px;
}

.card__Printer {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
    gap: 2rem;

}

.card__product {
    border-radius: 10px;
    background-color: hsl(0, 0%, 95%);
    color: hsl(210, 20%, 15%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding-block: 1.25rem;
    text-align: center;
    display: grid;
    row-gap: 1.5rem;
    cursor: pointer;
}

.card_img {
    width: 200px;
    height: 200px;
    justify-self: center;
    filter: drop-shadow(0 8px 16px hsla(5, 90%, 4%, .2));
    transition: transform .3s;
}

.card__name {
    font-size: 30px;
    color: hsl(5, 15%, 15%);
    margin-bottom: .5rem;
}

.card__price {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(5, 15%, 15%);
}

.card__product:hover .card_img {
    transform: scale(1.1);
}

.modal {
    position: fixed;
    inset: 0;
    background-color: hsla(0, 0%, 1%, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: var(--z-modal);
    transition: opacity .4s, visibility .4s;
}

.modal__card {
    position: relative;
    background-color: hsl(0, 0%, 100%);
    padding: 3rem 1.25rem 2rem;
    display: grid;
    row-gap: 1.5rem;
    text-align: center;
    transform: rotateX(90deg);
    transition: transform .6s;
}

.modal__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: hsl(5, 15%, 15%);
    cursor: pointer;
    transition: 0.3s ease-in-out;
}

.modal__close:hover {
    transform: scale(1.2);
}

.modal__img {
    width: 220px;
    justify-self: center;
    filter: drop-shadow(0 8px 16px hsla(5, 90%, 4%, .2));
}

.modal__name {
    font-size: 1.25rem;
    color: hsl(5, 15%, 15%);
    margin-bottom: .5rem;
}

.modal__info {
    margin-bottom: 1rem;
    color: #201f1f;
}

.modal__price {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(0, 0%, 0%);
}

.modal__buttons {
    display: flex;
    justify-content: center;
}

.button {
    position: relative;
    transition: all 0.3s ease-in-out;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
    padding-block: 0.5rem;
    padding-inline: 1.25rem;
    background-color: hsl(45, 90%, 55%);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: hsl(0, 0%, 10%);
    gap: 10px;
    font-weight: bold;
    border: 3px solid #ffffff4d;
    outline: none;
    overflow: hidden;
    font-size: 15px;
}

.icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease-in-out;
}

.button:hover {
    transform: scale(1.05);
    border-color: #fff9;
}

.button:hover .icon {
    transform: translate(4px);
}

.button:hover::before {
    animation: shine 1.5s ease-out infinite;
}

.button::before {
    content: "";
    position: absolute;
    width: 100px;
    height: 100%;
    background-image: linear-gradient(120deg,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0.8),
            rgba(255, 255, 255, 0) 70%);
    top: 0;
    left: -100px;
    opacity: 0.6;
}

@keyframes shine {
    0% {
        left: -100px;
    }

    60% {
        left: 100%;
    }

    to {
        left: 100%;
    }
}


.active-modal {
    opacity: 1;
    visibility: initial;
    pointer-events: initial;
}

.active-modal .modal__card {
    transform: rotateX(0);
}

/* เเสดงผลมือถือ */
@media screen and (max-width: 300px) {
    .Printer {
        margin-inline: 1rem;
    }

    .modal {
        padding: 1rem;
    }

    .modal__buttons {
        flex-direction: column;
    }
}

@media screen and (max-width: 576px) {
    .card__Printer {
        grid-template-columns: 330px;
    }

    .modal__card {
        max-width: 350px;
    }

    .ToggleLanuuage {
        margin-top: 50px;
    }

}

@media screen and (min-width: 768px) {
    .card__Printer {
        grid-template-columns: repeat(2, 330px);
    }
}

@media screen and (min-width: 1150px) {
    .Printer__title {
        margin-bottom: 4.5rem;
    }

    .card__Printer {
        grid-template-columns: repeat(3, 330px);
        gap: 3rem;
    }

    .card__product {
        padding: 1rem;
        border-width: 6px;
    }

    .card__name,
    .card__price {
        font-size: 1rem;
    }

    .modal__card {
        max-width: 376px;
        padding: 3rem 2.5rem 2.5rem;
    }

    .modal__img {
        width: 250px;
    }

    .madal__name,
    .modal__price {
        font-size: 1rem;
    }

    .modal__buttons {
        column-gap: 1rem;
    }
}

.AnimationText {
    opacity: 0;
    transform: translateY(30px);
    animation: moveup 0.5s linear forwards;
}

@keyframes moveup {

    100% {
        opacity: 1;
        transform: translateY(0px);
    }
}