/**
 * Stage 13 final visual polish — Cart + Checkout.
 *
 * Presentation only. This layer fixes the remaining visual defects confirmed
 * in production screenshots without changing WooCommerce business logic,
 * gateways, shipping, taxes, inventory, orders, customers or translations.
 */

/* Keep Cart vertical rhythm consistent with Checkout and the rest of the site. */
body.woocommerce-cart .content-layout {
  padding-top: clamp(3.75rem, 6vw, 5.5rem) !important;
}

/* Page titles belong to the page, not the transactional grid. Force their
 * header wrapper to the true viewport width so Cart and Checkout titles sit on
 * the geometric center of the page regardless of the asymmetric columns below. */
body.woocommerce-cart .entry-header,
body.woocommerce-checkout .entry-header {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw !important;
  text-align: center !important;
}

body.woocommerce-cart .entry-header .entry-title,
body.woocommerce-checkout .entry-header .entry-title {
  width: 100%;
  margin-inline: auto !important;
  text-align: center !important;
}

/* ================================================================
   CART — controls, summary breathing room and CTA spacing
   ================================================================ */

body.woocommerce-cart .wc-block-cart-item__quantity {
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: .55rem !important;
}

/* WooCommerce's native selector can retain a narrow width that clips the +
 * control after our wider product-card treatment. Give all three controls a
 * deterministic track so minus / quantity / plus remain visible. */
body.woocommerce-cart .wc-block-components-quantity-selector {
  display: grid !important;
  grid-template-columns: 44px 48px 44px !important;
  width: 136px !important;
  min-width: 136px !important;
  max-width: 136px !important;
  min-height: 46px !important;
  overflow: visible !important;
}

body.woocommerce-cart .wc-block-components-quantity-selector button,
body.woocommerce-cart .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 44px !important;
  margin: 0 !important;
}

body.woocommerce-cart .wc-block-cart-item__remove-link {
  flex: 0 0 42px;
  margin: 0 !important;
}

/* The native Woo sidebar class is the same element as the styled totals card.
 * Restore card padding after the grid-width remediation intentionally removed
 * native track padding. */
body.woocommerce-cart .wc-block-components-sidebar.wc-block-cart__sidebar {
  padding: 1.35rem 1.45rem 1.45rem !important;
}

body.woocommerce-cart .wc-block-cart__totals-title {
  padding-inline: 0 !important;
}

body.woocommerce-cart .wc-block-cart__payment-options,
body.woocommerce-cart .wc-block-components-express-payment,
body.woocommerce-cart .wc-block-cart__submit,
body.woocommerce-cart .wc-block-cart__submit-container {
  margin-inline: 0 !important;
}

body.woocommerce-cart .wc-block-components-express-payment__event-buttons,
body.woocommerce-cart .wc-block-cart__submit-button {
  box-sizing: border-box;
}

/* ================================================================
   CHECKOUT — radios, payment density, summary readability and sticky offset
   ================================================================ */

/* Reserve explicit space for the native radio circle so it never overlaps the
 * first characters of USPS, PayPal or ATH Móvil labels. */
body.woocommerce-checkout .wc-block-components-radio-control__option {
  position: relative !important;
  padding-left: 3.1rem !important;
}

body.woocommerce-checkout .wc-block-components-radio-control__input {
  position: absolute !important;
  left: 1rem !important;
  top: 50% !important;
  margin: 0 !important;
  transform: translateY(-50%) !important;
}

body.woocommerce-checkout .wc-block-components-radio-control__label-group,
body.woocommerce-checkout .wc-block-components-radio-control__option-layout {
  min-width: 0 !important;
}

/* Payment method cards should feel like a single coherent component rather
 * than several heavily nested boxes. */
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option {
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) {
  background: rgba(215, 25, 32, .025) !important;
  box-shadow: inset 3px 0 0 var(--ecms-accent, #d71920) !important;
}

body.woocommerce-checkout .wc-block-components-radio-control-accordion-content {
  padding: .55rem 1rem .85rem 3.1rem !important;
  line-height: 1.5 !important;
}

body.woocommerce-checkout .wc-block-components-radio-control-accordion-content p {
  margin: .35rem 0 !important;
  text-align: left !important;
}

/* Use the available ~400px summary width more efficiently. */
body.woocommerce-checkout .wc-block-components-order-summary-item {
  grid-template-columns: 64px minmax(0, 1fr) 68px !important;
  gap: .7rem !important;
  padding-block: 1rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image {
  width: 64px !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
  width: 60px !important;
  height: 60px !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name {
  font-size: .95rem !important;
  line-height: 1.25 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-metadata {
  margin-top: .35rem !important;
  font-size: .81rem !important;
  line-height: 1.45 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price {
  min-width: 0 !important;
  width: 68px !important;
  white-space: nowrap;
}

/* Keep the desktop sticky summary below the sticky storefront header instead
 * of allowing it to slide underneath the header while scrolling. */
@media (min-width: 961px) {
  body.woocommerce-checkout .wc-block-components-sidebar.wc-block-checkout__sidebar {
    position: sticky !important;
    top: 106px !important;
    align-self: start !important;
  }

  body.admin-bar.woocommerce-checkout .wc-block-components-sidebar.wc-block-checkout__sidebar {
    top: 138px !important;
  }
}

/* PayPal Pay Later messaging may be injected as a sibling of the summary card
 * by the gateway. Make that message read as a continuation of the summary
 * instead of an unpadded line floating below the card. */
body.woocommerce-checkout .wc-block-checkout__sidebar + [data-pp-message],
body.woocommerce-checkout .wc-block-checkout__sidebar + .ppcp-messages,
body.woocommerce-checkout .wc-block-checkout__sidebar + .ppcp-paylater-message,
body.woocommerce-checkout .wc-block-components-sidebar > [data-pp-message],
body.woocommerce-checkout .wc-block-components-sidebar > .ppcp-messages,
body.woocommerce-checkout .wc-block-components-sidebar > .ppcp-paylater-message {
  box-sizing: border-box;
  width: 100% !important;
  margin: 0 !important;
  padding: .7rem 1.25rem 1rem !important;
  border: 1px solid var(--ecms-commerce-border, #dfe3e5);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  background: #fff;
}

body.woocommerce-checkout .wc-block-checkout__sidebar:has(+ [data-pp-message]),
body.woocommerce-checkout .wc-block-checkout__sidebar:has(+ .ppcp-messages),
body.woocommerce-checkout .wc-block-checkout__sidebar:has(+ .ppcp-paylater-message) {
  border-radius: 20px 20px 0 0 !important;
}

/* If PayPal renders the message inside the sidebar rather than beside it,
 * preserve the same visual inset. */
body.woocommerce-checkout .wc-block-checkout__sidebar [data-pp-message],
body.woocommerce-checkout .wc-block-checkout__sidebar .ppcp-messages,
body.woocommerce-checkout .wc-block-checkout__sidebar .ppcp-paylater-message {
  box-sizing: border-box;
  margin: 0 !important;
  padding: .7rem 1.25rem 1rem !important;
}

@media (max-width: 960px) {
  body.woocommerce-checkout .wc-block-components-sidebar.wc-block-checkout__sidebar {
    position: static !important;
    top: auto !important;
  }
}

@media (max-width: 767px) {
  body.woocommerce-cart .content-layout {
    padding-top: clamp(2.5rem, 9vw, 3.5rem) !important;
  }

  body.woocommerce-cart .wc-block-components-sidebar.wc-block-cart__sidebar {
    padding: 1rem !important;
  }

  body.woocommerce-cart .wc-block-components-quantity-selector {
    grid-template-columns: 42px 46px 42px !important;
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item {
    grid-template-columns: 58px minmax(0, 1fr) 62px !important;
    gap: .6rem !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image,
  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    width: 54px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    height: 54px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce-cart .wc-block-components-quantity-selector button,
  body.woocommerce-checkout .wc-block-components-radio-control__option {
    transition: none !important;
  }
}


/* ================================================================
   CHECKOUT — order summary readability refinement
   ================================================================ */

/* Give the summary enough horizontal room for a readable title and metadata
 * without making the primary checkout form feel secondary. */
@media (min-width: 961px) {
  body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout {
    grid-template-columns: minmax(0, 1fr) minmax(430px, 460px) !important;
  }
}

/* Use a deliberate image / content / line-total grid. */
body.woocommerce-checkout .wc-block-components-order-summary-item {
  grid-template-columns: 60px minmax(0, 1fr) 70px !important;
  gap: .8rem !important;
  align-items: start !important;
  padding-block: 1rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image {
  position: relative;
  width: 60px !important;
  min-width: 60px !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
  display: block;
  width: 58px !important;
  height: 58px !important;
  object-fit: cover;
}

/* Keep the quantity badge attached to the image rather than competing with
 * the first line of the product name. */
body.woocommerce-checkout .wc-block-components-order-summary-item__quantity {
  top: -.45rem !important;
  right: -.4rem !important;
}

/* Clear hierarchy: title, unit price, short description, compact specs. */
body.woocommerce-checkout .wc-block-components-order-summary-item__description {
  min-width: 0 !important;
  padding-right: .15rem;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name {
  display: block !important;
  margin: 0 0 .35rem !important;
  font-size: 1rem !important;
  line-height: 1.22 !important;
  font-weight: 850 !important;
  overflow-wrap: anywhere;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price {
  display: block;
  margin: 0 0 .45rem !important;
  color: var(--ecms-ink, #111315);
  font-size: .9rem !important;
  font-weight: 700;
  line-height: 1.25;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-metadata {
  margin-top: 0 !important;
  color: #687179;
  font-size: .82rem !important;
  line-height: 1.42 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-metadata__description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 .45rem !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

body.woocommerce-checkout .ecms-checkout-compact-specs {
  margin-top: .15rem;
  color: #4f5961;
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price {
  align-self: start !important;
  width: 70px !important;
  min-width: 70px !important;
  padding-top: .05rem;
  color: var(--ecms-ink, #111315);
  font-size: .94rem !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  text-align: right !important;
  white-space: nowrap;
}

/* Slightly more separation between products; less visual noise inside each. */
body.woocommerce-checkout .wc-block-components-order-summary-item + .wc-block-components-order-summary-item {
  border-top: 0;
}

@media (max-width: 960px) {
  body.woocommerce-checkout .wc-block-components-order-summary-item {
    grid-template-columns: 64px minmax(0, 1fr) 72px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image {
    width: 64px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    width: 60px !important;
    height: 60px !important;
  }
}

@media (max-width: 600px) {
  body.woocommerce-checkout .wc-block-components-order-summary-item {
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: .7rem !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image,
  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    width: 54px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    height: 54px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__total-price {
    grid-column: 2;
    grid-row: auto;
    width: auto !important;
    min-width: 0 !important;
    margin-top: .2rem;
    text-align: left !important;
  }
}


/* ================================================================
   CHECKOUT — square thumbnail, corner quantity badge and wider info column
   ================================================================ */

@media (min-width: 961px) {
  body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout {
    grid-template-columns: minmax(0, 1fr) minmax(480px, 510px) !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item {
    grid-template-columns: 64px minmax(0, 1fr) 64px !important;
    column-gap: .7rem !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name {
    font-size: .98rem !important;
    line-height: 1.2 !important;
  }

  body.woocommerce-checkout .ecms-checkout-compact-specs {
    white-space: nowrap;
  }
}

/* Lock every order-summary thumbnail to a true 1:1 square. */
body.woocommerce-checkout .wc-block-components-order-summary-item__image {
  position: relative !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  aspect-ratio: 1 / 1 !important;
  overflow: visible !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
  display: block !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 12px !important;
}

/* Anchor quantity directly to the thumbnail's upper-right corner. */
body.woocommerce-checkout .wc-block-components-order-summary-item__image .wc-block-components-order-summary-item__quantity,
body.woocommerce-checkout .wc-block-components-order-summary-item__quantity {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 2;
  margin: 0 !important;
  transform: translate(38%, -38%) !important;
}

/* Keep the information column visually compact and easy to scan. */
body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name {
  margin-bottom: .22rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price {
  margin-bottom: .35rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-metadata__description {
  margin-bottom: .35rem !important;
  color: #707981 !important;
  font-size: .8rem !important;
  line-height: 1.38 !important;
}

body.woocommerce-checkout .ecms-checkout-compact-specs {
  margin-top: 0 !important;
  color: #4c555d;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price {
  width: 64px !important;
  min-width: 64px !important;
  padding-top: 0 !important;
}

/* Keep product rows clearly separated without adding visual bulk. */
body.woocommerce-checkout .wc-block-components-order-summary-item {
  border-bottom: 1px solid var(--ecms-commerce-border) !important;
}

@media (max-width: 960px) {
  body.woocommerce-checkout .wc-block-components-order-summary-item__image,
  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image {
    aspect-ratio: 1 / 1 !important;
  }

  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    aspect-ratio: 1 / 1 !important;
  }
}

@media (max-width: 600px) {
  body.woocommerce-checkout .wc-block-components-order-summary-item__image,
  body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
  }

  body.woocommerce-checkout .ecms-checkout-compact-specs {
    white-space: normal;
  }
}


/* ================================================================
   CHECKOUT — independent payment cards + PayPal branding
   ================================================================ */

/* Remove the generic WooCommerce frame that wraps the complete list of
 * gateways. Each gateway keeps its own card border below. */
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control__options,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-options {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Keep PayPal and ATH Móvil as separate cards. */
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option {
  position: relative;
  overflow: hidden !important;
  border: 1px solid var(--ecms-commerce-border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
}

/* Selected gateway: clean continuous red edge, without the inset rounded
 * artifact/tab produced by stacking WooCommerce's generic selected styles. */
body.woocommerce-checkout .wc-block-components-radio-control__option:has(input:checked),
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) {
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) {
  border-color: rgba(215, 25, 32, .6) !important;
  border-left: 4px solid var(--ecms-accent, #d71920) !important;
}

/* Prevent a second red left-edge treatment on the clickable header itself. */
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) > .wc-block-components-radio-control__option {
  border-left: 0 !important;
  box-shadow: none !important;
}

/* Align the PayPal brand to the right, matching ATH Móvil's row composition. */
body.woocommerce-checkout .ecms-payment-option--paypal .ecms-payment-option__header,
body.woocommerce-checkout .ecms-payment-option--paypal .wc-block-components-radio-control__label-group,
body.woocommerce-checkout .ecms-payment-option--paypal .wc-block-components-radio-control__option-layout {
  min-width: 0;
}

body.woocommerce-checkout .ecms-payment-option--paypal .wc-block-components-radio-control__label-group,
body.woocommerce-checkout .ecms-payment-option--paypal .wc-block-components-radio-control__option-layout {
  display: flex !important;
  align-items: center !important;
  gap: .75rem;
  width: 100%;
}

body.woocommerce-checkout .ecms-payment-option__paypal-logo {
  display: block;
  flex: 0 0 auto;
  width: 112px;
  height: 28px;
  margin-left: auto;
  object-fit: contain;
  object-position: right center;
}

/* The expanded PayPal explanation belongs inside its own selected card. */
body.woocommerce-checkout .ecms-payment-option--paypal .wc-block-components-radio-control-accordion-content {
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 600px) {
  body.woocommerce-checkout .ecms-payment-option__paypal-logo {
    width: 96px;
    height: 24px;
  }
}


/* ================================================================
   CHECKOUT — payment cards final cleanup
   ================================================================ */

/* JS marks the actual shared visual wrapper used by the current WooCommerce
 * Blocks build. Strip every possible framing primitive from that wrapper,
 * including pseudo-elements, so only the two individual gateway cards remain. */
body.woocommerce-checkout .wc-block-checkout__payment-method .ecms-payment-options-shell {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .ecms-payment-options-shell::before,
body.woocommerce-checkout .wc-block-checkout__payment-method .ecms-payment-options-shell::after {
  display: none !important;
  content: none !important;
}

/* Also neutralize WooCommerce wrapper variants even before the JS class is
 * applied, while leaving each accordion-option card untouched. */
body.woocommerce-checkout .wc-block-checkout__payment-method fieldset.wc-block-components-radio-control,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control--highlight-checked,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control__options,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-options {
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Eliminate the curved red tab by ensuring selected styling exists only on the
 * outer card, never again on the nested clickable row or its pseudo-elements. */
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) {
  border: 1px solid rgba(215, 25, 32, .62) !important;
  border-left: 4px solid var(--ecms-accent, #d71920) !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) > .wc-block-components-radio-control__option,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) > .wc-block-components-radio-control__option::before,
body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:has(input:checked) > .wc-block-components-radio-control__option::after {
  border-left: 0 !important;
  box-shadow: none !important;
}

/* PayPal row: reserve the same right-side logo zone seen on ATH Móvil, then
 * pin the logo to that slot independent of WooCommerce label markup. */
body.woocommerce-checkout .ecms-payment-option--paypal .ecms-payment-option__header {
  position: relative !important;
  padding-right: 10rem !important;
}

body.woocommerce-checkout .ecms-payment-option__paypal-logo {
  position: absolute !important;
  top: 50%;
  right: 1.25rem;
  display: block !important;
  width: 116px !important;
  height: 30px !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: right center !important;
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 600px) {
  body.woocommerce-checkout .ecms-payment-option--paypal .ecms-payment-option__header {
    padding-right: 8.5rem !important;
  }

  body.woocommerce-checkout .ecms-payment-option__paypal-logo {
    right: .9rem;
    width: 96px !important;
    height: 25px !important;
  }
}


/* ================================================================
   CHECKOUT — PayPal / ATH Móvil logo geometry lock
   ================================================================ */

/* Fallback geometry before runtime measurement. JS then copies the actual ATH
 * logo width, height and right inset onto PayPal so both right edges, left icon
 * edges and overall footprint line up. */
body.woocommerce-checkout .ecms-payment-option__paypal-logo {
  right: .4rem !important;
  width: 144px !important;
  height: 35px !important;
}

body.woocommerce-checkout .ecms-payment-option--paypal .ecms-payment-option__header {
  padding-right: 10.6rem !important;
}

@media (max-width: 600px) {
  body.woocommerce-checkout .ecms-payment-option__paypal-logo {
    right: .4rem !important;
    width: 124px !important;
    height: 30px !important;
  }

  body.woocommerce-checkout .ecms-payment-option--paypal .ecms-payment-option__header {
    padding-right: 9.25rem !important;
  }
}


/* ================================================================
   CHECKOUT BLOCK — separate PayPal Standard Card option
   ================================================================ */

/* The payment shell is now explicitly ordered:
 * PayPal → Tarjeta de crédito → ATH Móvil. */
body.woocommerce-checkout .wc-block-checkout__payment-method .ecms-payment-options-shell {
  display: flex !important;
  flex-direction: column !important;
}

/* Keep the custom card row visually identical to the native payment cards. */
body.woocommerce-checkout .ecms-payment-option--card {
  position: relative;
  overflow: hidden !important;
  border: 1px solid var(--ecms-commerce-border, #dfe3e5) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
}

/* WooCommerce draws the subtle gray top separator on the later payment rows
 * with the option's native ::after pseudo-element. Standard Card is the first
 * row, so WooCommerce hides that separator by default. Re-enable only that
 * native separator so Card, PayPal and ATH Móvil have the same top treatment. */
body.woocommerce-checkout .wc-block-checkout__payment-method .ecms-payment-option--card::after {
  display: block !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option.ecms-payment-option--card:has(input:checked) {
  border-color: rgba(215, 25, 32, .62) !important;
  border-left: 4px solid var(--ecms-accent, #d71920) !important;
  background: #f4f5f6 !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option.ecms-payment-option--card:has(input:checked) .ecms-payment-option__header {
  /* Match the live rendered selected PayPal header exactly. Production QA
   * resolves the PayPal row to rgb(253,242,242) / #fdf2f2 after its stacked
   * translucent selected-state layers are composited over white. Keep this
   * opaque because the card body underneath is gray. */
  background: #fdf2f2 !important;
}

body.woocommerce-checkout .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option.ecms-payment-option--card:has(input:checked) .wc-block-components-radio-control-accordion-content {
  background: #f4f5f6 !important;
}

body.woocommerce-checkout .ecms-payment-option--card .wc-block-components-payment-method-icons {
  display: inline-flex !important;
  align-items: center !important;
  gap: .42rem !important;
  margin-left: auto !important;
}

body.woocommerce-checkout .ecms-payment-option--card .wc-block-components-payment-method-icon {
  display: block !important;
  width: auto !important;
  height: 22px !important;
  max-width: 52px !important;
  object-fit: contain !important;
}

body.woocommerce-checkout .ecms-paypal-card-content {
  padding: .15rem 0 .2rem;
}

body.woocommerce-checkout .ecms-paypal-card-content__copy {
  margin: 0 0 .75rem;
  color: #555e66;
  font-size: .9rem;
  line-height: 1.5;
}

body.woocommerce-checkout .ecms-paypal-card-content__loading {
  margin: 0 0 .55rem;
  color: #687179;
  font-size: .84rem;
}

body.woocommerce-checkout .ecms-paypal-card-content__error {
  margin: 0 0 .75rem;
  padding: .65rem .8rem;
  border-left: 3px solid var(--ecms-accent, #d71920);
  border-radius: 8px;
  background: #fff4f4;
  color: #8f151b;
  font-size: .84rem;
  line-height: 1.4;
}

body.woocommerce-checkout .ecms-paypal-card-button {
  width: 100%;
  min-height: 46px;
}

/* The PayPal-hosted card button initiates/approves the card transaction and
 * then submits WooCommerce automatically. Hide the generic Woo place-order
 * button only while this method is selected so there is one clear CTA. */
body.woocommerce-checkout.ecms-paypal-card-active .wc-block-components-checkout-place-order-button {
  display: none !important;
}

@media (max-width: 600px) {
  body.woocommerce-checkout .ecms-payment-option--card .wc-block-components-payment-method-icon {
    height: 19px !important;
    max-width: 46px !important;
  }
}


/* PayPal Standard Card trigger.
 * The native Basic Card element remains the PayPal-owned target used to open
 * the hosted form. During the automatic start it is visually suppressed; once
 * the hosted form is open the intermediate gray trigger is removed from view.
 * If automatic start fails, the native trigger is restored as a retry fallback.
 */
body.woocommerce-checkout .ecms-paypal-card-native-button-shell {
  display: block;
  width: min(78%, 42rem);
  margin: 0 auto;
}

body.woocommerce-checkout .ecms-paypal-card-native-button-shell > paypal-basic-card-container,
body.woocommerce-checkout .ecms-paypal-card-native-button-shell > paypal-basic-card-container > paypal-basic-card-button {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
  border-radius: 12px;
  cursor: pointer;
}

body.woocommerce-checkout paypal-basic-card-button.ecms-paypal-card-native-button--auto-starting {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.woocommerce-checkout paypal-basic-card-button.ecms-paypal-card-native-button--hidden {
  display: none !important;
}

/* PayPal's hosted card form is cross-origin, so merchant code cannot remove
 * its internal "Cancel and go back" button directly. Production measurement
 * places that 30px-high button entirely within the first 31px of the iframe,
 * while the email field begins 43px down. Clip only the first 32px of the
 * hosted iframe: the X is removed from the rendered/hit-tested area, the email
 * field is untouched, and the iframe keeps its original box height so the
 * approved vertical gap remains unchanged at every viewport width. */
body.woocommerce-checkout
  .ecms-payment-option--card
  paypal-sdk-iframe[title="paypal_card_form"] {
  -webkit-clip-path: inset(32px 0 0 0);
  clip-path: inset(32px 0 0 0);
}

@media (max-width: 600px) {
  body.woocommerce-checkout .ecms-paypal-card-native-button-shell {
    width: min(90%, 22rem);
  }
}

