/* =========================================================
 * まとめ買い機能（pg_bulk_purchase）
 * 商品グループ／商品カテゴリ アーカイブで有効化される。
 * ========================================================= */

/* ガイド + ボタンブロック（スクロール追従するフローティングバー） */
.ec-bulk-purchase {
    position: sticky;
    bottom: 16px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 16px 24px;
    margin-top: 24px;
    margin-bottom: 24px;
    background-color: var(--ec-surface-card, #ffffff);
    border: 1px solid var(--ec-border-default, #cccccc);
    border-radius: var(--ec-radius-card, 8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.ec-bulk-purchase__guide {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-bulk-purchase__guide-text {
    color: var(--ec-text-main, #2d2d2d);
    font-size: var(--ec-fz-base, 1rem);
    line-height: 1.6;
}

.ec-bulk-purchase__guide-text > p {
    margin: 0 0 4px;
}

.ec-bulk-purchase__note {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin: 0;
    color: var(--ec-text-subdued, #a0a0a0);
    font-size: var(--ec-fz-xs, 0.75rem);
}

.ec-bulk-purchase__action {
    flex: 0 0 278px;
}

.ec-bulk-purchase__btn {
    width: 100%;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 32px;
    background-color: var(--ec-action-buy, #ed293e);
    color: var(--ec-brand-on-primary, #ffffff);
    border: 0;
    border-radius: var(--ec-radius-button, 4px);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: var(--ec-fz-lg, 1.25rem);
    letter-spacing: 0.05em;
    transition: filter 0.15s ease;
}

.ec-bulk-purchase__btn:hover {
    filter: brightness(0.9);
}

.ec-bulk-purchase__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ec-bulk-purchase__btn-icon {
    flex: 0 0 auto;
    color: currentColor;
}

/* SPレイアウト: ガイドは隠してボタンだけを画面下部に固定表示 */
@media (max-width: 768px) {
    .ec-bulk-purchase {
        bottom: 0;
        gap: 0;
        padding: 8px 12px;
        margin-left: calc(var(--ec-space-unit, 4px) * -4);
        margin-right: calc(var(--ec-space-unit, 4px) * -4);
        margin-top: 16px;
        margin-bottom: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 0;
    }
    .ec-bulk-purchase__guide {
        display: none;
    }
    .ec-bulk-purchase__action {
        flex: 1 1 auto;
        width: 100%;
    }
    .ec-bulk-purchase__btn {
        height: 56px;
        font-size: var(--ec-fz-base, 1rem);
    }
}

/* =========================================================
 * 商品カードの数量セレクタ
 * ========================================================= */

/* まとめ買いモードの商品カード:
 * グリッドの行高さに合わせてカードが伸びても、数量ピルは
 * 必ずカード末尾（下端）に揃うようにする。
 * .ec-product-card__body は flex column / flex:1 のため、
 * 末尾の bulk-qty に margin-top:auto を当てれば下に張り付く。 */
.ec-product-card.is-bulk-purchase {
    align-self: stretch;
    height: 100%;
}

.ec-product-card__bulk-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    height: 40px;
    margin-top: auto;
    padding: 0 8px;
    background-color: var(--ec-surface-card, #ffffff);
    color: var(--ec-text-main, #2d2d2d);
    border-radius: 54px;
    border: 1px solid var(--ec-border-default, #cccccc);
}

.ec-qty-btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--ec-text-main, #2d2d2d);
    cursor: pointer;
    padding: 0;
}

.ec-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ec-qty-btn__icon {
    position: relative;
    display: inline-block;
    width: 13px;
    height: 13px;
}

/* マイナス記号（横線） */
.ec-qty-btn__icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 13px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transform: translateY(-50%);
}

/* プラス記号（縦線を追加） */
.ec-qty-btn__icon--plus::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 13px;
    background-color: currentColor;
    border-radius: 2px;
    transform: translateX(-50%);
}

.ec-qty-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--ec-text-main, #2d2d2d);
    text-align: center;
    font-family: var(--ec-font-numeric, inherit);
    font-size: var(--ec-fz-lg, 1.25rem);
    font-weight: 600;
    -moz-appearance: textfield;
}

.ec-qty-input::-webkit-outer-spin-button,
.ec-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ec-qty-input:disabled {
    opacity: 0.4;
}
