/*
 * CPS Website Suite CTA Design System
 * v1.1.28
 * Normalizes CTA sizing, spacing and responsive behavior across CPS public pages.
 */

:root{
  --cps-cta-h:52px;
  --cps-cta-radius:12px;
  --cps-cta-pad-x:20px;
  --cps-cta-font:14px;
  --cps-cta-gap:12px;
  --cps-cta-shadow:0 10px 24px rgba(18,60,50,.12);
}

/* ---------- Shared CPS landing/category buttons ---------- */
:is(
  .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpshb-btn,.cpsae-btn,.cpscs-btn,
  .cpsph-btn,.cpscap-btn,.cpsh-btn,.cpsai-btn
){
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:var(--cps-cta-h)!important;
  height:var(--cps-cta-h)!important;
  padding:0 var(--cps-cta-pad-x)!important;
  border-radius:var(--cps-cta-radius)!important;
  font-size:var(--cps-cta-font)!important;
  line-height:1.2!important;
  font-weight:800!important;
  text-align:center!important;
  text-decoration:none!important;
  white-space:normal!important;
  vertical-align:middle!important;
  transition:transform .18s ease,box-shadow .18s ease,background-color .18s ease,border-color .18s ease!important;
}

:is(
  .cpsbb-actions,.cpsbx-actions,.cpscv-actions,.cpsth-actions,.cpsdh-actions,.cpshb-actions,.cpsae-actions,.cpscs-actions,
  .cpsph-actions,.cpscap-actions,.cpsh-actions
){
  gap:var(--cps-cta-gap)!important;
  align-items:stretch!important;
}

/* Hero/action pairs get matching desktop widths. */
:is(
  .cpsbb-actions,.cpsbx-actions,.cpscv-actions,.cpsth-actions,.cpsdh-actions,.cpshb-actions,.cpsae-actions,.cpscs-actions
) > :is(
  .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpshb-btn,.cpsae-btn,.cpscs-btn
){
  width:220px!important;
  max-width:100%!important;
}

/* Dark CTA bands: consistent full-width action stack. */
:is(
  .cpsbb-cta__actions,.cpsbx-cta__actions,.cpscv-cta__actions,.cpsth-cta__actions,.cpsdh-cta__actions,.cpscs-cta__actions
) :is(
  .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpscs-btn
){
  width:100%!important;
  min-width:0!important;
}

:is(
  .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpshb-btn,.cpsae-btn,.cpscs-btn,
  .cpsph-btn,.cpscap-btn,.cpsh-btn,.cpsai-btn
):hover{
  transform:translateY(-1px)!important;
  box-shadow:var(--cps-cta-shadow)!important;
}

:is(
  .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpshb-btn,.cpsae-btn,.cpscs-btn,
  .cpsph-btn,.cpscap-btn,.cpsh-btn,.cpsai-btn,
  .cps-spe-final-button,.cps-spe-wa-button,.cps-ready-assurance__wa,
  .single_add_to_cart_button,.cps-buy-now-button
):focus-visible{
  outline:3px solid rgba(35,102,80,.28)!important;
  outline-offset:3px!important;
}

/* ---------- WooCommerce category/shop action buttons ---------- */
.cps-shop-card__actions{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
}
.cps-shop-btn{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  min-height:42px!important;
  height:42px!important;
  padding:0 10px!important;
  border-radius:9px!important;
  line-height:1.15!important;
  text-align:center!important;
}

:is(.cpsbb-page,.cpsbx-page,.cpscv-page,.cpsth-page,.cpsdh,.cpscs-page,.cpsae) ul.products li.product .button,
:is(.cpsbb-page,.cpsbx-page,.cpscv-page,.cpsth-page,.cpsdh,.cpscs-page,.cpsae) ul.products li.product .added_to_cart{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:42px!important;
  line-height:1.15!important;
}

/* ---------- Single Product primary purchase controls ---------- */
.cps-spe-summary form.cart .single_add_to_cart_button,
.cps-spe-summary form.cart .cps-buy-now-button{
  box-sizing:border-box!important;
  min-height:64px!important;
  height:64px!important;
  border-radius:13px!important;
  padding-top:10px!important;
  padding-bottom:10px!important;
}

.cps-product-simple .cps-spe-summary form.cart .qty,
.cps-spe-summary .woocommerce-variation-add-to-cart .qty{
  min-height:64px!important;
  height:64px!important;
}

.cps-spe-summary form.cart .single_add_to_cart_button.is-buy-enhanced,
.cps-spe-summary form.cart .cps-buy-now-button.is-buy-enhanced{
  grid-template-columns:minmax(0,1fr) 34px!important;
  align-items:center!important;
}

.cps-spe-summary .cps-buy-title{
  line-height:1.2!important;
}
.cps-spe-summary .cps-buy-note{
  line-height:1.3!important;
}

/* WhatsApp / final single-product CTAs use one visual rhythm. */
.cps-spe-wa-button,
.cps-ready-assurance__wa,
.cps-spe-final-button{
  box-sizing:border-box!important;
  min-height:54px!important;
  border-radius:12px!important;
}

/* Buttons pasted inside WooCommerce short/long descriptions.
 * This also normalizes inline-styled CPS contact/WhatsApp links. */
.cps-spe-summary .woocommerce-product-details__short-description a[href*="/kontak/"],
.cps-spe-summary .woocommerce-product-details__short-description a[href*="wa.me"],
.cps-spe-tabs .woocommerce-Tabs-panel a[href*="/kontak/"],
.cps-spe-tabs .woocommerce-Tabs-panel a[href*="wa.me"],
.woocommerce-product-details__short-description a[href*="/kontak/"],
.woocommerce-product-details__short-description a[href*="wa.me"]{
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  min-width:220px!important;
  min-height:52px!important;
  padding:0 20px!important;
  margin:5px 6px 5px 0!important;
  border-radius:12px!important;
  font-size:14px!important;
  line-height:1.2!important;
  font-weight:800!important;
  text-align:center!important;
  text-decoration:none!important;
}

/* Description CTA components generated by CPS rich product content. */
.cps-spe-tabs .cg-product .cg-buy-btn.is-cg-enhanced,
.cps-spe-tabs .cg-product .cg-cta-action.is-cg-enhanced,
.cps-spe-tabs .cg-product .cg-final-btn.is-cg-enhanced{
  box-sizing:border-box!important;
  min-height:70px!important;
  height:70px!important;
  align-items:center!important;
}

/* ---------- Tablet ---------- */
@media (min-width:768px) and (max-width:1024px){
  :root{--cps-cta-h:52px;--cps-cta-pad-x:18px}

  :is(
    .cpsbb-actions,.cpsbx-actions,.cpscv-actions,.cpsth-actions,.cpsdh-actions,.cpshb-actions,.cpscs-actions
  ) > :is(
    .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpshb-btn,.cpscs-btn
  ){
    width:210px!important;
  }
}

/* ---------- Mobile ---------- */
@media (max-width:767px){
  :root{--cps-cta-h:50px;--cps-cta-radius:11px;--cps-cta-pad-x:16px;--cps-cta-font:13.5px;--cps-cta-gap:9px}

  :is(
    .cpsbb-actions,.cpsbx-actions,.cpscv-actions,.cpsth-actions,.cpsdh-actions,.cpshb-actions,.cpsae-actions,.cpscs-actions,
    .cpsph-actions,.cpscap-actions,.cpsh-actions
  ){
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:var(--cps-cta-gap)!important;
    width:100%!important;
  }

  :is(
    .cpsbb-actions,.cpsbx-actions,.cpscv-actions,.cpsth-actions,.cpsdh-actions,.cpshb-actions,.cpsae-actions,.cpscs-actions,
    .cpsph-actions,.cpscap-actions,.cpsh-actions
  ) > :is(
    .cpsbb-btn,.cpsbx-btn,.cpscv-btn,.cpsth-btn,.cpsdh-btn,.cpshb-btn,.cpsae-btn,.cpscs-btn,
    .cpsph-btn,.cpscap-btn,.cpsh-btn
  ){
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
  }

  .cps-shop-card__actions{
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  .cps-shop-btn{
    min-height:40px!important;
    height:40px!important;
  }

  .cps-spe-summary form.cart .single_add_to_cart_button,
  .cps-spe-summary form.cart .cps-buy-now-button,
  .cps-product-simple .cps-spe-summary form.cart .qty,
  .cps-spe-summary .woocommerce-variation-add-to-cart .qty{
    min-height:58px!important;
    height:58px!important;
  }

  .cps-spe-wa-button,
  .cps-ready-assurance__wa,
  .cps-spe-final-button{
    width:100%!important;
    min-height:50px!important;
    height:auto!important;
  }

  .cps-spe-summary .woocommerce-product-details__short-description a[href*="/kontak/"],
  .cps-spe-summary .woocommerce-product-details__short-description a[href*="wa.me"],
  .cps-spe-tabs .woocommerce-Tabs-panel a[href*="/kontak/"],
  .cps-spe-tabs .woocommerce-Tabs-panel a[href*="wa.me"],
  .woocommerce-product-details__short-description a[href*="/kontak/"],
  .woocommerce-product-details__short-description a[href*="wa.me"]{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    min-height:50px!important;
    margin:6px 0!important;
    padding:0 15px!important;
  }

  .cps-spe-tabs .cg-product .cg-buy-btn.is-cg-enhanced,
  .cps-spe-tabs .cg-product .cg-cta-action.is-cg-enhanced,
  .cps-spe-tabs .cg-product .cg-final-btn.is-cg-enhanced{
    width:100%!important;
    min-height:66px!important;
    height:66px!important;
  }
}

@media (max-width:380px){
  .cps-spe-summary form.cart .single_add_to_cart_button.is-buy-enhanced,
  .cps-spe-summary form.cart .cps-buy-now-button.is-buy-enhanced{
    grid-template-columns:minmax(0,1fr) 29px!important;
    gap:7px!important;
  }
}
