@charset "utf-8";

/* ===== cart page base ===== */
.cartPage {
    max-width: 1920px;
    width: 100%;
    padding: 60px 30px 40px;
}

.cartPage__container {
    max-width: 1220px;
    width: 100%;
    margin: 0 auto;
}

.cartPage__titleRow {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.cartPage__title {
    font-size: 2.6rem;
    font-weight: 700;
    margin: 0;
}

/* タブレットで右上に出す小計（PCでは隠す） */
.cartPage__summaryInline {
    display: none;
}

/* ===== layout ===== */
.cartPage__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

.cartList {
    border-top: 1px solid #dcdcdc;
}

/* ===== cart item row (PC/Tablet default) ===== */
.cartItem {
    display: grid;
    grid-template-columns: 140px 1fr 120px;
    gap: 18px;
    padding: 18px 10px;
    border-bottom: 1px solid #dcdcdc;
    align-items: center;
}

.cartItem__thumb {
    background: #f3f3f3;
    display: grid;
    place-items: center;
    width: 140px;
    height: 140px;
}

.cartItem__image {
    max-width: 140px;
    max-height: 140px;
    width: 100%;
    height: 100%;
    display: block;
}

.cartItem__imageLink {
    display: block;
}

.cartItem__name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.4em * 2);
}

.cartItem__nameLink {
    display: block;
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.cartItem__nameLink:hover {
    text-decoration: underline;
}

.cartItem__meta {
    font-size: 1.5rem;
    line-height: 1.6;
}

.cartItem__variant {
    font-weight: 600;
    margin-bottom: 2px;
}

.cartItem__stock {
    font-weight: 600;
}

.cartItem__stock--ok {
    color: var(--picky-green);
}

.cartItem__stock--low {
    color: var(--picky-orange);
}

.cartItem__stock--none {
    color: #D60000;
}

.cartItem__right {
    justify-self: end;
    align-self: end;
    text-align: right;
}

.cartItem__qtyRow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 5px;
}

.cartItem__qty {
    width: 18px;
    text-align: center;
    font-weight: 700;
    font-size: 1.4rem;
}

.cartItem__qtyBtn {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    line-height: 1;
    font-weight: 900;
    font-size: 1.4rem;
    border: 1px solid var(--button-bg-primary);
    padding: 0;
    cursor: pointer;
}

.cartItem__qtyBtn--minus {
    background: #fff;
    color: var(--button-bg-primary);
}

.cartItem__qtyBtn--plus {
    background: var(--button-bg-primary);
    color: #fff;
}

.cartItem__deleteForm {
    width: 82px;
    margin: 0 0 11px auto;
    text-align: center;
}

.cartItem__deleteLink {
    border: 0;
    background: transparent;
    color: var(--color-link);
    font-size: 1.4rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.cartItem__price {
    font-size: 1.8rem;
    font-weight: 800;
}

.cartSummaryCard {
    border: 1px solid #dcdcdc;
    background: #fff;
}

.cartSummaryCard__inner {
    padding: 18px;
}

.cartSummaryCard__row {
    font-size: 1.8rem;
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 6px;
}
.cartSummaryCard__label { font-weight: 600; }
.cartSummaryCard__price { font-weight: 800; }
.cartSummaryCard__tax { font-size: 1.2rem; }

.cartSummaryCard__btn {
    display: block;
    text-align: center;
    background: var(--button-bg-primary);
    color: #FFF;
    font-size: 1.6rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
}

.cartPage__bottomSummary {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 8px;
    padding: 10px 0 0;
    font-size: 1.8rem;
}
.cartBottomSummary__label { font-weight: 600; }
.cartBottomSummary__price { font-weight: 800; }
.cartBottomSummary__tax { font-size: 1.2rem; }

/* 下部ボタン（タブレット/スマホで使う） */
.cartPage__bottomCta {
    display: none;
}

/* ===== empty cart ===== */
.cartEmpty {
    padding: 28px 0 10px;
    text-align: center;
}

.cartEmpty__text {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 800;
}

.cartEmpty__link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #f29a83;
    color: #f29a83;
    font-weight: 900;
    text-decoration: none;
    background: #fff;
}

/* ===============================================
 *
 * メディアクエリ タブレット縦 (768px ~ 1023px)
 *
 * ============================================ */

@media (max-width: 1023px) {
    .cartPage {
        padding: 40px 30px;
    }

    .cartPage__title {
        font-size: 2.4rem;
    }

    .cartPage__layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cartPage__summaryInline {
        display: flex;
        justify-content: flex-end;
        align-items: baseline;
        gap: 8px;
        padding: 10px 0 0;
        font-size: 1.8rem;
    }
    .cartSummaryInline__label { font-weight: 600; }
    .cartSummaryInline__price { font-weight: 800;}
    .cartSummaryInline__tax { font-size: 1.2rem;}

    .cartItem__name {
        font-size: 1.6rem;
    }

    .cartItem__qtyBtn {
        width: 32px;
        height: 32px;
        font-weight: 600;
        font-size: 1.8rem;
    }

    .cartItem__qty {
        font-size: 1.6rem;
    }

    .cartItem__deleteForm {
        width: 102px;
    }

    .cartPage__bottomCta {
        padding-top: 40px;
    }

    .cartCtaBtn {
        display: block;
        width: 100%;
        text-align: center;
        background: var(--button-bg-primary);
        color: #fff;
        font-weight: 600;
        border-radius: 12px;
        padding: 12px 20px;
        text-decoration: none;
        font-size: 1.8rem;
    }

    .cartSummaryCard {
        display: none;
    }
    .cartPage__summaryInline {
        display: block;
    }
    .cartPage__bottomCta {
        display: block;
    }
}

/* ===============================================
 *
 * メディアクエリ SP標準 (480px ~ 767px)
 *
 * ============================================ */

@media (max-width: 767px) {
    .cartItem {
        grid-template-columns: 100px 1fr 120px;
    }

    .cartItem__thumb {
        width: 100px;
        height: 100px;
    }

    .cartItem__image {
        max-width: 100px;
        max-height: 100px;
    }

    .cartItem__name {
        margin: 0 0 5px;
        line-height: 1.2;
        min-height: calc(1.25em * 2);
    }

    .cartItem__meta {
        font-size: 1.4rem;
        line-height: normal;
    }

    .cartItem__variant {
        font-weight: 600;
        margin-bottom: 0;
    }
}

/* ===== Mobile (画像3枚目) ===== */
@media (max-width: 479px) {
    .cartPage {
        padding: 40px 15px 40px;
    }

    .cartPage__titleRow {
        margin-bottom: 6px;
    }

    .cartPage__title {
        font-size: 2rem;
    }

    .cartPage__summaryInline {
        font-size: 1.4rem;
    }

    .cartItem {
        padding: 10px 5px;
        grid-template-columns: 110px 1fr;
        grid-template-rows: auto auto;
        align-items: start;
        gap: 12px 14px;
    }

    .cartItem__thumb {
        width: 110px;
        height: 110px;
    }

    .cartItem__image {
        max-width: 110px;
        max-height: 110px;
    }

    .cartItem__right {
        grid-column: 1 / 4;
        justify-self: stretch;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 6px 0 0 4px;
    }

    .cartItem__deleteForm {
        width: auto;
        margin: 0;
    }

    .cartItem__qtyRow {
        margin: 0;
        justify-content: flex-start;
    }

    .cartPage__bottomSummary {
        justify-content: center;
    }

    .cartPage__bottomCta {
        padding-top: 20px;
    }

    .cartCtaBtn {
        font-size: 1.6rem;
        padding: 10px 20px;
    }
}