/* Keep the shared background visible around the native WooCommerce blocks. */
:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) {
    --epock-commerce-ink: #211910;
    --epock-commerce-muted: #4b3b2b;
    --epock-commerce-edge: #806742;
    box-sizing: border-box;
    padding: clamp(14px, 3vw, 32px);
    border: 1px solid rgba(86, 61, 32, .36);
    border-radius: 8px;
    background: rgba(255, 248, 230, .92);
    color: var(--epock-commerce-ink);
    font-size: 1rem;
    line-height: 1.5;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(.wc-block-cart-items__header, .wc-block-components-totals-item,
    .wc-block-components-product-name, .wc-block-components-product-price,
    .wc-block-components-formatted-money-amount, .wc-block-components-radio-control__secondary-label,
    .wc-block-components-form .wc-block-components-text-input label,
    .wc-block-components-text-input input, .wc-block-components-combobox label,
    .wc-block-components-combobox input, .wc-block-components-checkbox label,
    .wc-block-components-radio-control__label, .wc-block-components-address-form select,
    .wc-block-checkout__terms, .wc-block-components-quantity-selector input) {
    color: var(--epock-commerce-ink);
    font-size: 1rem;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(.wc-block-cart-items__header, .wc-block-components-product-name,
    .wc-block-components-totals-item__label, .wc-block-components-totals-item__value) {
    font-weight: 650;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(.wc-block-components-product-metadata, .wc-block-components-product-metadata p,
    .wc-block-components-totals-item__description, .wc-block-components-radio-control__description,
    .wc-block-components-checkout-step__description, .wc-block-components-order-summary-item__description p,
    .wc-block-cart-item__remove-link) {
    color: var(--epock-commerce-muted);
    font-size: .9375rem;
    line-height: 1.5;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(.wc-block-components-totals-footer-item, .wc-block-components-checkout-step__title,
    .wc-block-cart__totals-title, .wc-block-components-checkout-order-summary__title-text) {
    color: var(--epock-commerce-ink);
    font-size: 1.125rem;
    font-weight: 750;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(.wc-block-components-text-input input, .wc-block-components-combobox input,
    .wc-block-components-address-form select, .wc-block-components-quantity-selector) {
    background-color: #fffaf0;
    border-color: var(--epock-commerce-edge);
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(.wc-block-components-quantity-selector button, .wc-block-components-quantity-selector input) {
    min-height: 44px;
}

:is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(a, button, input, select, textarea):focus-visible {
    outline: 2px solid #443b30;
    outline-offset: 2px;
}

/* Preserve space for WooCommerce's smaller floating label above the field value. */
.wp-block-woocommerce-checkout .wc-block-components-form
.wc-block-components-text-input:is(.is-active, :focus-within) label {
    font-size: .875rem;
}

@media (max-width: 480px) {
    :is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) {
        padding: 12px;
    }
}

/* Give the line total its own row when the three-column cart would overflow. */
@media (max-width: 600px) {
    .wp-block-woocommerce-cart .wc-block-cart table.wc-block-cart-items tbody .wc-block-cart-items__row {
        grid-template-columns: 64px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 8px;
    }
    .wp-block-woocommerce-cart .wc-block-cart table.wc-block-cart-items tbody .wc-block-cart-item__image {
        padding-right: 0;
    }
    .wp-block-woocommerce-cart .wc-block-cart table.wc-block-cart-items tbody .wc-block-cart-item__product {
        grid-column: 2 / 3;
        grid-row: 1;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .wp-block-woocommerce-cart .wc-block-cart table.wc-block-cart-items tbody .wc-block-cart-item__total {
        grid-column: 2 / 3;
        grid-row: 2;
        padding: 0;
    }
    .wp-block-woocommerce-cart .wc-block-cart-item__quantity {
        flex-wrap: wrap;
    }
}
