
/* PRICEHACK_CPA_GLOBAL_GEOMETRY_V1 */

/*
   Shared CPA styling for storefronts, coupons
   and canonical categories. Yandex is untouched.
*/

/* 1. Align CPA actions with the inside card edge. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
:is(.coupon,.cpa-preview-product-v13)
.offer-actions {
  box-sizing:border-box!important;
  padding-right:11px!important;
  max-width:100%!important;
  min-width:0!important;
}

/* The right inset is owned by the actions row. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
:is(.coupon,.cpa-preview-product-v13)
.offer-actions > .promo-action.card-promo {
  margin-right:0!important;
  margin-left:auto!important;
  max-width:100%!important;
}

/* 2. Compact horizontal coupon geometry. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon {
  position:relative!important;
  min-height:0!important;
}

body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon .picture {
  min-height:0!important;
}

body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon .details {
  position:relative!important;
  min-height:0!important;
  padding-top:34px!important;
  padding-bottom:9px!important;
}

/* 3. Publication and expiration are top-right. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon .details > .dates {
  position:absolute!important;
  top:6px!important;
  right:10px!important;
  left:auto!important;
  bottom:auto!important;
  z-index:3!important;
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:4px 7px!important;
  max-width:calc(100% - 20px)!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:#fff;
  line-height:1.2!important;
}

/* 4. Voting moves into the coupon action row;
      it no longer occupies the date position. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon .offer-actions.cpa-row-v81
.thermometer-rating {
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  left:auto!important;
  bottom:auto!important;
  z-index:4!important;
  margin:0!important;
  flex-shrink:0!important;
}

/* Allow responsive button/code placement. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon .offer-actions.cpa-row-v81 {
  flex-wrap:wrap!important;
  align-content:center!important;
  row-gap:5px!important;
  min-height:36px!important;
  margin-top:auto!important;
}

/* Keep the existing CPA ticket shape. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
.coupon .offer-actions.cpa-row-v81
> .promo-action.card-promo {
  align-self:center!important;
}

/* On very narrow cards, dates can wrap safely. */
@media(max-width:620px) {
  body :is(.ph-cpa-embed,.ph-cpa-standalone)
  .coupon .details {
    padding-top:42px!important;
  }

  body :is(.ph-cpa-embed,.ph-cpa-standalone)
  .coupon .details > .dates {
    font-size:9px!important;
  }
}


/* PRICEHACK_CPA_PUBLIC_VOTE_V1: product CTA inset only */

/* Product body already owns the inner 11px horizontal inset. */
body :is(.ph-cpa-embed,.ph-cpa-standalone)
.offer-card.cpa-preview-product-v13 .offer-actions {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding-right:0!important;
    padding-left:0!important;
    margin-right:0!important;
    overflow:visible!important;
}

body :is(.ph-cpa-embed,.ph-cpa-standalone)
.offer-card.cpa-preview-product-v13
.offer-actions > .promo-action.card-promo {
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    margin-right:0!important;
}


/* PRICEHACK_CPA_PRODUCT_LIKE_CLICK_FIX_V1 */

/* The full-card link stays below interactive controls. */
.ph-cpa-product-click {
  position:relative!important;
}

.ph-cpa-product-click > .ph-cpa-product-detail-link {
  z-index:2!important;
}

/* Lift only the action area, not the whole card. */
.ph-cpa-product-click
.cpa-preview-product-v13 .offer-actions {
  position:relative!important;
  z-index:20!important;
  pointer-events:auto!important;
}

.ph-cpa-product-click
.cpa-preview-product-v13 .ph-like-rating {
  position:relative!important;
  z-index:21!important;
  pointer-events:auto!important;
}

.ph-cpa-product-click
.cpa-preview-product-v13 .ph-like-button {
  position:relative!important;
  z-index:22!important;
  pointer-events:auto!important;
}

/* Decorative descendants should not intercept the button. */
.ph-cpa-product-click
.ph-like-button .ph-like-icon,
.ph-cpa-product-click
.ph-like-button .ph-like-count {
  pointer-events:none!important;
}


/* PRICEHACK_CPA_PRODUCT_HOVER_STABLE_V1 */

/* Prevent oscillation when the cursor enters the product card. */
body .ph-cpa-product-click
.offer-card.cpa-preview-product-v13,
body .ph-cpa-product-click
.offer-card.cpa-preview-product-v13:hover {
    transform:none!important;
}

/* Preserve visual hover feedback without moving the card. */
body .ph-cpa-product-click
.offer-card.cpa-preview-product-v13:hover {
    border-color:#a8b4c5!important;
    box-shadow:0 10px 24px rgba(22,28,38,.10)!important;
}

/* The clickable wrapper must also remain stationary. */
body .ph-cpa-product-click,
body .ph-cpa-product-click:hover {
    transform:none!important;
}
