@charset "UTF-8";

/* ======================
PC
====================== */
.products__ttl {
    font-family: var(--font-serif);
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1;
    border-bottom: 1px solid var(--orange);
    padding-bottom: var(--space-6);
}

.products__category {
    margin-top: var(--space-30);
}

.products__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, 240px);
    justify-content: center;
    gap: var(--space-12);
    margin-top: var(--space-12);
}

.products__modal-open {
    width: 240px;
    height: 240px;
    transition: transform 0.4s ease;
}

/* 商品画像　ホバー・フォーカス時 */
.products__modal-open:hover,
.products__modal-open:focus-visible {
    transform: scale(1.03);
}

.products__name {
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    margin-top: var(--space-6);
}

.btn__top {
    margin-top: var(--space-30);
}

/* ======================
SP
====================== */
@media (max-width: 767px) {
    .products__category {
        margin-top: var(--space-20);
    }

    .products__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: space-between;
        gap: var(--space-8) var(--space-4);
        margin-top: var(--space-16);
    }

    .products__modal-open {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .products__name {
        font-weight: 500;
        text-align: center;
        margin-top: var(--space-3);
    }

    .btn__top {
        margin-top: var(--space-20);
    }
}

/* ======================
商品モーダル
====================== */
.products__modal {
    width: min(600px, calc(100vw - 40px));
    height: clamp(350px, 85vw, 650px);
    max-height: calc(100vh - 40px);
    padding: var(--space-12);
    background-color: var(--base-white);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s ease,
        transform 0.3s ease;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 閉じているモーダルは非表示にする */
.products__modal:not([open]) {
    display: none;
}

/* 開いた時 */
.products__modal[open] {
    opacity: 1;
    transform: scale(1);

    @starting-style {
        opacity: 0;
        transform: scale(0.96);
    }
}

/* 閉じる時 */
.products__modal.is-closing {
    opacity: 0;
    transform: scale(0.96);
}

/* 中身 */
.products__modal-content {
    width: 100%;
    margin: var(--space-3) auto 0;
}

.products__modal-img {
    width: 90%;
    aspect-ratio: 1;
    margin: 0 auto;
}

.products__modal-name {
    line-height: 1;
    font-weight: 500;
    margin-top: var(--space-4);
    text-align: center;
}

.products__modal-desc {
    font-size: var(--font-size-xs);
    line-height: 1;
    width: 90%;
    margin: var(--space-4) auto 0;
}

/* 商品モーダル　閉じるボタン */
.products__modal-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products_close-inner {
    width: 48px;
    height: 18px;
    position: relative;
}

.close__line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%);
    width: 36px;
    height: 1px;
    background-color: var(--black);
}

.close__line:nth-of-type(1) {
    transform: translate(-50%, -50%) rotate(26deg);
}

.close__line:nth-of-type(2) {
    transform: translate(-50%, -50%) rotate(-26deg);
}

.products__modal-close .close__line {
    transition: width 0.3s ease;
}

.products__modal-close:hover .close__line,
.products__modal-close:focus-visible .close__line {
    width: 48px;
}

/* チラつき・リンク切れマーク防止 */
.products__modal-thumb:not([src]),
.products__modal-thumb[src=""] {
    opacity: 0;
}

/* ======================
商品モーダル　SP
====================== */
@media (max-width: 767px) {
    .products__modal {
        width: calc(100vw - 40px);
        height: min(650px, calc(80vw + 100px));
        max-height: calc(100vh - 32px);
    }

    /* 中身 */
    .products__modal-content {
        margin: var(--space-4) auto 0;
    }

    .products__modal-img {
        max-width: 90%;
        aspect-ratio: 1;
        margin: 0 auto;
    }

    .products__modal-name {
        line-height: 1;
        font-weight: 500;
        margin-top: var(--space-4);
        text-align: center;
    }

    .products__modal-desc {
        max-width: 90%;
    }

    /* 商品モーダル　閉じるボタン */
    .products__modal-close {
        width: 48px;
        height: 48px;
    }

    .products_close-inner {
        width: 32px;
        height: 12px;
        position: relative;
    }

    .close__line {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%);
        width: 24px;
        height: 1px;
        background-color: var(--black);
    }

    .products__modal-close:hover .close__line,
    .products__modal-close:focus-visible .close__line {
        width: 32px;
    }
}