/* ============================================================
   Evolution_DealerGate
   Cart gating, compare removal, rating suppression.

   Selectors are broad and !important-heavy on purpose: Porto
   renders these controls from ~15 templates across widgets,
   category listings, PageBuilder carousels and ajax grids.
   ============================================================ */

/* ---------- 1. Cart controls: hidden until the dealer is known ----------
   Hidden by default; the evo-is-dealer body class (set from customer-data)
   reveals them. Failing closed means a JS error hides the button rather
   than exposing it to guests. */
.product-item .tocart,
.product-item-actions .actions-primary,
.box-tocart,
.product-add-form .tocart,
.product-social-links .action.tocart,
.product-info-main .box-tocart,
.product-item .field.qty,
.box-tocart .field.qty {
    display: none !important;
}

body.evo-is-dealer .product-item .tocart,
body.evo-is-dealer .product-item-actions .actions-primary,
body.evo-is-dealer .box-tocart,
body.evo-is-dealer .product-add-form .tocart,
body.evo-is-dealer .product-social-links .action.tocart,
body.evo-is-dealer .product-info-main .box-tocart,
body.evo-is-dealer .product-item .field.qty,
body.evo-is-dealer .box-tocart .field.qty {
    display: block !important;
}

/* Porto's hover action strip on grid tiles */
.product-item .product-item-inner .actions-secondary .action.tocart,
.owl-carousel .product-item .action.tocart {
    display: none !important;
}
body.evo-is-dealer .product-item .product-item-inner .actions-secondary .action.tocart,
body.evo-is-dealer .owl-carousel .product-item .action.tocart {
    display: inline-block !important;
}

/* ---------- 2. Compare: removed for everyone ----------
   Layout XML strips the sidebar, header link and PDP button.
   These cover the inline markup in Porto's list templates. */
.action.tocompare,
.action.compare,
.product-item .tocompare,
.product-addto-links .action.tocompare,
.product-social-links .action.tocompare,
.compare.wrapper,
.block-compare,
.link.compare,
#product-comparison {
    display: none !important;
}

/* ---------- 3. Ratings: removed for everyone ----------
   Porto hardcodes empty star markup with title="0%" rather than
   reading review data, so catalog/review/active=0 does not touch it. */
.product-reviews-summary,
.product-item .rating-summary,
.product-item .reviews-actions,
.reviews-actions,
.rating-summary,
.rating-result,
.review-control-vote,
.product.attribute.rating,
#reviews,
#tab-label-reviews,
#tab-label-reviews-title,
.review-list,
.review-add,
.review-form,
.block.review-add,
.products-grid .product-reviews-summary,
.porto-product-rating,
.product-item .ratings {
    display: none !important;
}

/* Reclaim the gap the star row leaves in Porto grid tiles */
.product-item .product-item-details > .product-reviews-summary {
    margin: 0 !important;
    padding: 0 !important;
}
