/* ─── Payment Options ─── */

.list-payment-options {
    display: grid;
    grid-template-columns: repeat(4, 3.625rem);
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 2.625rem;
}

.payment-option-item {
    width: 3.625rem;
    height: 2rem;
    border: 1px solid var(--sf-border-color);
    border-radius: var(--sf-radius);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ─── Cart Form ─── */

.woocommerce .ct-woocommerce-cart-form {
    padding-bottom: 5.5rem;
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 5.75rem;

    @media (max-width: 1450px) {
        grid-template-columns: 1fr 380px;
        gap: 3rem;
        padding-bottom: 3rem;
    }

    @media (max-width: 1230px) {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    @media screen and (max-width: 480px) {
        padding-bottom: 2rem;
        gap: 2rem;
    }

    /* ─── Coupon ─── */

    .coupon {
        flex-wrap: wrap;

        @media screen and (max-width: 767px) {
            width: 100%;
            margin-bottom: 1rem;

            div {
                display: flex;
                width: 100%;
                gap: 1rem;
                justify-content: space-between;
                flex-wrap: wrap;
            }
        }

        @media screen and (max-width: 480px) {
            div {
                gap: 0.625rem;
            }
        }
    }

    #coupon-error-notice {
        width: 100%;
        font-size: 0.875rem;
        text-align: left;
        font-weight: 600;
        color: var(--sf-text-color-beige);
        margin-top: 0.5rem;
    }

    /* ─── Cart Table ─── */

    .woocommerce-cart-form {
        h2 {
            margin-bottom: 3rem;
        }

        td {
            padding-top: 1.5rem;
            padding-bottom: 1.5rem;
        }

        td:not(.actions) {
            border-bottom: 1px solid var(--sf-border-color);
        }

        td.product-name {
            padding-left: 2rem;

            a {
                font-size: 0.875rem;
                margin: 0 0 0.25rem 0;
                line-height: 1.2;
                letter-spacing: 0.02rem;
            }

            .variation {
                font-size: 0.875rem;
                margin: 0;
                line-height: 1.4;
                font-family: var(--font-inter);
            }

            .price {
                display: none;
            }
        }

        .product-thumbnail {
            width: 7.75rem;

            @media (max-width: 1450px) {
                width: 5.75rem;
            }
        }

        th {
            text-align: center;
            font-size: 1rem;
            line-height: 1.2;
            color: var(--sf-text-color-beige-dark);
            text-transform: uppercase;
            letter-spacing: 0.02rem;
            border-bottom: 1px solid var(--sf-border-color);
        }

        td > .amount {
            font-weight: 600;
            font-size: 1.125rem;
        }

        .product-subtotal {
            text-align: left;
        }
    }

    /* ─── Cart Totals ─── */

    .cart_totals {
        background: var(--sf-bg-light);
        border: none;
        padding: 2rem 4rem 4.5rem 4rem;

        @media (max-width: 1450px) {
            padding: 2rem 2rem 4.5rem 2rem;
        }

        @media screen and (max-width: 480px) {
            width: calc(100% + 3rem);
            margin: 0 -1.5rem;
            padding-inline: 1.5rem;
            padding-top: 2rem;
            padding-bottom: 2rem;
        }

        h2 {
            margin-bottom: 2.625rem;
        }

        .shop_table {
            th, td {
                padding-top: 2.25rem;
                padding-bottom: 1rem;
                border-bottom: 1px solid var(--sf-border-color);
            }

            td {
                text-align: right;
                font-weight: 600;
            }

            tr:first-child th,
            tr:first-child td {
                padding-top: 1rem;
            }

            tr:last-child th,
            tr:last-child td {
                border-bottom: none;
            }

            .cart-general-price-row td {
                del {
                    text-decoration: none;
                    opacity: 1;
                }

                .amount * {
                    color: var(--sf-text-color-beige);
                }
            }

            th {
                font-size: 1rem;
                font-weight: 500;
            }

            td {
                > strong > .amount {
                    font-size: 1.125rem;
                    font-weight: 600;
                }

                .sf-cart-price-suffix {
                    font-size: 0.75rem;
                    *{
                        font-size: 0.75rem;
                    }
                }
            }
        }
    }
}

/* ─── Cart Upsells ─── */

body .woocommerce .sf-cart-upsells {
    h2 {
        margin-bottom: 2rem;
    }

    .sf-upsell-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(auto, 584px));
        gap: 2rem;
        justify-content: space-between;
    }

    .sf-upsell-item {
        background: var(--sf-bg-light);
        padding: 2rem 3rem;
        border-radius: var(--sf-radius);

        .sf-upsell-controls {
            margin-top: 0 !important;
            margin-left: auto;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 1rem;
        }

        .quantity {
            width: 6.5rem;
            height: var(--sf-qty-height-sm);
            margin-top: 0.625rem;
            margin-bottom: 0.625rem;

            .ct-increase, .ct-decrease {
                width: var(--sf-qty-height-sm);
                height: var(--sf-qty-height-sm);
            }

            input {
                height: var(--sf-qty-height-sm);
            }
        }
    }

    .sf-upsell-item-wrapper {
        display: flex;
        align-items: center;
        gap: 2rem;

        .sf-upsell-thumb .quantity {
            display: none;
        }

        img {
            width: 5.75rem;
            min-width: 5.75rem;
            height: 5.75rem;
            border-radius: var(--sf-radius);
        }
    }

    .sf-upsell-info-wrapper {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 0.5rem;
    }

    .sf-upsell-title {
        font-size: 0.875rem;
        letter-spacing: 0.02rem;
        font-weight: 500;
        margin: 0;

        a {
            color: var(--sf-text-form-color);
        }
    }

    .sf-upsell-add-link {
        background: transparent;
        color: var(--sf-text-form-color);
        font-size: 0.75rem;
        padding-inline: 0.25rem !important;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
        line-height: 1;

        &::before {
            background-image: url('../assets/icons/icon-plus.svg');
            background-size: 1rem 1rem;
            width: 1rem;
            height: 1rem;
            margin-right: 0.25rem;
        }

        &:hover {
            color: var(--sf-text-color-beige);
        }
    }
}

/* ─── Buttons & Inputs ─── */

body.woocommerce-cart {
    .ct-woocommerce-cart-form .button {
        font-weight: 600;
        letter-spacing: 0.02rem;
        border-radius: var(--sf-radius);
        padding: 1rem;

        &::before {
            content: "";
            width: 1.125rem;
            height: 1.125rem;
            background-repeat: no-repeat;
            background-size: 1.125rem 1.125rem;
            background-position: center center;
            display: block;
            margin-right: 0.5rem;
            filter: none;
            position: static;
            opacity: 1;
            z-index: 0;
        }
    }

    [name="apply_coupon"].button {
        background: transparent;
        color: var(--sf-text-color);
        font-size: 0.75rem;
        padding-inline: 0.25rem;

        &::before {
            width: 1rem;
            height: 1rem;
            background-image: url('../assets/icons/icon-plus.svg');
        }

        &:hover {
            color: var(--sf-text-color-beige);
        }

        @media screen and (max-width: 480px) {
            margin: 0 0 0 auto;
            width: auto;
            padding: 0.5rem 0.25rem;
        }
    }

    [name="coupon_code"] {
        font-size: 1rem;
        line-height: 1.2;
        font-weight: 600;
        height: auto;
        padding: 0.85rem 1.25rem;
        border-width: 0 0 1px 0;
        border-radius: 0;
        border-color: var(--sf-darker-border-color);
        margin-right: 0.625rem;

        &::placeholder {
            color: var(--sf-darker-border-color);
        }

        @media screen and (max-width: 480px) {
            width: 100%;
            margin: 0 !important;
        }
    }

    [name="update_cart"] {
        background-color: transparent;
        color: var(--sf-text-color-beige-dark);
        border: 1px solid var(--sf-text-color-beige-dark);
        padding: 0.825rem 1.25rem;
        font-size: 0.75rem;
        line-height: 1;

        @media screen and (max-width: 767px) {
            width: 100%;
        }

        &::before {
            display: none !important;
        }

        &::after {
            content: "";
            width: 1em;
            height: 1rem;
            background-repeat: no-repeat;
            background-size: 1rem 1rem;
            background-position: center center;
            display: block;
            margin-left: 0.5rem;
            filter: none;
            position: static;
            opacity: 1;
            z-index: 0;
            background-image: url('../assets/icons/icon-refresh.svg');
        }

        &:hover {
            background-color: transparent;
            border-color: var(--sf-text-color-beige);
            color: var(--sf-text-color-beige);
        }
    }
}

/* ─── Checkout ─── */

.wc-proceed-to-checkout {
    .checkout-button {
        margin-bottom: 0.5rem;
    }

    .button {
        width: 100%;
        color: var(--sf-text-color);
    }

    .checkout-button + .button {
        background: transparent;

        &:hover {
            color: var(--sf-text-color-beige);
        }

        &::before {
            background-image: url('../assets/icons/icon-arrow-left.svg');
        }
    }
}

.checkout-button {
    background-color: #eed4b2;

    &::before {
        background-image: url('../assets/icons/icon-checkout-button.svg');
    }
}

/* ─── Remove Controls ─── */

.product-subtotal {
    width: 2.5rem !important;
}

.cart_item .remove {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 2.5rem !important;
    border: 1px solid var(--sf-border-color);
    background-image: url('../assets/icons/icon-trash.svg');
    background-position: center;
    background-repeat: no-repeat;

    &:hover {
        background-color: var(--theme-button-background-hover-color);
    }

    svg {
        display: none;
    }
}

.product-subtotal-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    > .amount > bdi{
        font-size: 1.125rem;
        font-weight: 600;
    }
}

/* ─── Quantity Controls ─── */

body .woocommerce .quantity {
    width: 8rem;
    height: var(--sf-qty-btn-size);

    .ct-increase, .ct-decrease {
        width: var(--sf-qty-btn-size);
        height: var(--sf-qty-btn-size);
        border-radius: var(--sf-qty-btn-size) !important;
        border: 1px solid var(--sf-border-color);
        background-repeat: no-repeat !important;
        background-size: 1.125rem !important;
        background-position: center center !important;
        color: transparent;
        display: block;
        top: 0;

        &:hover {
            color: transparent;
        }
    }

    .ct-increase {
        background-image: url('../assets/icons/icon-plus.svg');
        right: 0;
        left: auto;

        &:hover {
            background-image: url('../assets/icons/icon-plus.svg');
        }
    }

    .ct-decrease {
        background-image: url('../assets/icons/icon-minus.svg');
        left: 0;

        &:hover {
            background-image: url('../assets/icons/icon-minus.svg');
        }
    }

    input {
        border: none;
        font-family: var(--font-inter);
        font-size: 1rem;
        padding-inline: 2.75rem;

        &:focus {
            box-shadow: none !important;
        }
    }
}

/* ─── Responsive: max-width 999px ─── */

@media screen and (max-width: 999px) {
    body .woocommerce .shop_table.woocommerce-cart-form__contents {
        thead {
            display: none;
        }

        td, .product-quantity, .product-subtotal {
            display: block;
            border: none !important;
        }

        .woocommerce-cart-form__cart-item {
            display: grid;
            grid-template-columns: 5.75rem 1fr;
            column-gap: 2em;
            row-gap: 0.5rem;
            padding-bottom: 0.75rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--sf-border-color);
        }

        td.actions {
            padding-top: 0.5rem;
            padding-bottom: 0;
        }

        .product-thumbnail {
            padding: 0;
        }

        .product-name {
            display: flex;
            align-items: center;
            max-width: none;
            justify-content: space-between;
            padding: 0;
        }

        .product-subtotal {
            padding: 0;
            width: 100% !important;

            .product-subtotal-inner {
                justify-content: flex-end;
            }

            .sf-cart-price--amount {
                text-align: right;
            }

            .remove {
                display: none;
            }
        }

        .product-quantity {
            padding: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;

            .quantity {
                width: 100%;
                height: var(--sf-qty-height-sm);
            }

            .ct-increase, .ct-decrease {
                width: var(--sf-qty-btn-size-sm);
                height: var(--sf-qty-btn-size-sm);
            }

            input {
                height: var(--sf-qty-height-sm);
            }
        }
    }

    body .woocommerce .sf-cart-upsells {
        .sf-upsell-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .sf-upsell-item-wrapper {
            gap: 0.5rem;
        }

        .sf-upsell-item {
            padding: 0.5rem 1.5rem;

            .quantity {
                display: block;
                width: 5.75rem;
                margin: 0.5rem 0;
            }

            .sf-upsell-controls {
                flex-direction: row;
                align-items: center;
                justify-content: space-between;
            }
        }
    }
}

/* ─── Responsive: max-width 480px ─── */

@media screen and (max-width: 480px) {
    body.woocommerce-cart .ct-container-full {
        padding-bottom: 1.5rem;
    }

    body .woocommerce .shop_table.woocommerce-cart-form__contents {
        .woocommerce-cart-form__cart-item {
            column-gap: 0.5rem;
        }
    }

    body .woocommerce .shop_table {
        td{
            padding: 1rem 0;
        }
    }

    body .woocommerce {
        .sf-cart-upsells {
            width: calc(100% + 3rem);
            margin: 0 -1.5rem;
            padding-inline: 0;
        }

        .sf-cart-upsells-title {
            margin: 0 1.5rem 1rem 1.5rem;
            padding: 1rem !important;
        }
    }

}