/*
 * Valleypep cart + checkout styling
 * Loaded only on WooCommerce cart and checkout pages.
 */

/* 1. Cart-block action buttons use a compact variant. */
body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-panel__button,
body.woocommerce-cart .wc-block-components-totals-coupon__button {
    --vp-button-padding-y: 12px;
    --vp-button-padding-x: 18px;
    --vp-button-min-height: 38px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: var(--vp-button-min-height) !important;
    padding: var(--vp-button-padding-y) var(--vp-button-padding-x) !important;
    border: 1px solid var(--vp-button-border) !important;
    border-radius: var(--vp-button-radius) !important;
    background: var(--vp-button-bg) !important;
    color: var(--vp-button-color) !important;
    cursor: pointer !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    transition:
        background-color var(--vp-button-transition) ease,
        border-color var(--vp-button-transition) ease,
        color var(--vp-button-transition) ease;
    font-size: 0.95rem;
}

body.woocommerce-cart .wc-block-cart__submit-button:hover,
body.woocommerce-cart .wc-block-components-panel__button:hover,
body.woocommerce-cart .wc-block-components-totals-coupon__button:hover {
    background: var(--vp-button-bg-hover) !important;
    border-color: var(--vp-button-border-hover) !important;
    color: var(--vp-button-color) !important;
    text-decoration: none !important;
}

body.woocommerce-cart .wc-block-components-totals-coupon__button {
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 24px !important;
}

@media (max-width: 767px) {
    body.woocommerce-cart .wp-block-woocommerce-cart.alignwide {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.woocommerce-cart .wp-block-woocommerce-cart.alignwide .wc-block-components-sidebar-layout,
    body.woocommerce-cart .wp-block-woocommerce-cart.alignwide .wc-block-components-sidebar,
    body.woocommerce-cart .wp-block-woocommerce-cart.alignwide .wp-block-woocommerce-cart-items-block,
    body.woocommerce-cart .wp-block-woocommerce-cart.alignwide .wp-block-woocommerce-cart-totals-block {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (min-width: 1025px) {
    body.woocommerce-cart .wp-block-woocommerce-cart.alignwide {
        width: 100% !important;
        max-width: 1360px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .elementor-13 .elementor-element.elementor-element-57b1f3c7 {
        --content-width: 100%;
    }
}

/* 2. Checkout/cart action buttons should fill their action area. */
body .woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body .woocommerce-checkout #place_order {
    width: 100%;
}

/* 3. Cart thumbnails should have gently rounded corners. */
body.woocommerce-cart .wc-block-cart-item__image img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover !important;
    border-radius: 6px;
}

/* 4. Cart item text beside the thumbnail should be easier to read. */
body.woocommerce-cart .wc-block-cart-item__product-name,
body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-cart .wc-block-components-product-name a,
body.woocommerce-cart .wc-block-grid__product-title,
body.woocommerce-cart .wc-block-cart-item__prices,
body.woocommerce-cart .wc-block-components-product-metadata,
body.woocommerce-cart .wc-block-components-product-metadata__description,
body.woocommerce-cart .wc-block-components-product-metadata__description p {
    font-size: 1.1em !important;
    line-height: 1.35 !important;
}

body.woocommerce-cart .wc-block-components-product-metadata__description,
body.woocommerce-cart .wc-block-components-product-metadata__description p {
    font-size: 1em !important;
}

body.woocommerce-cart .wc-block-cart-item__product-name,
body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-cart .wc-block-grid__product-title {
    font-weight: 600 !important;
}

/* 5. Cart-page section headings should stay proportional to the cart layout. */
body.woocommerce-cart .elementor-widget-heading .elementor-heading-title {
    font-size: clamp(24px, 3vw, 36px) !important;
    line-height: 1.12 !important;
}

/* 6. Hide related products and feedback blocks on the cart page. */
body.woocommerce-cart .elementor-element-15911999,
body.woocommerce-cart .elementor-element-3dfb2fc1,
body.woocommerce-cart .related.products,
body.woocommerce-cart .vp-feedback,
body.woocommerce-cart [data-vp-feedback] {
    display: none !important;
}

/* 7. Rating stars keep the Valleypep accent color. */
body .woocommerce .star-rating span::before,
body .woocommerce p.stars:hover a::before,
body .woocommerce p.stars.selected a::before,
body .elementor-star-rating i,
body .elementor-star-rating i::before {
    color: rgb(155, 81, 224) !important;
}

/* 8. Exclusions: keep CTA-card buttons, pagination controls, and icon-only close controls untouched. */
body .woocommerce nav.woocommerce-pagination a,
body .woocommerce nav.woocommerce-pagination span,
body .elementor-cta__button,
body .vp-review-modal__close {
    min-height: initial !important;
}

/* 9. Checkout privacy notice should stay in normal sentence case. */
body.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .woocommerce-privacy-policy-text p,
body.woocommerce-checkout .woocommerce-privacy-policy-text p {
    text-transform: none !important;
}
