/* Jarvis Commerce 4.6.1 — mobile product purchase flow + footer hardening */

/* Keep the purchase controls calm and readable on all narrow screens. */
@media (max-width: 760px) {
  body.single-product .rch-assurances {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 14px 0 16px !important;
    padding: 0 !important;
    border: 0 !important;
  }
  body.single-product .rch-assurances > div {
    display: grid !important;
    grid-template-columns: 38px minmax(0,1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 11px !important;
    row-gap: 1px !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #e7edf2 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(6,64,137,.045) !important;
    text-align: left !important;
  }
  body.single-product .rch-assurances svg {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 21px !important;
    height: 21px !important;
    margin: 0 auto !important;
  }
  body.single-product .rch-assurances strong {
    grid-column: 2 !important;
    margin: 0 !important;
    color: #064089 !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    letter-spacing: .025em !important;
    text-align: left !important;
    text-transform: uppercase !important;
  }
  body.single-product .rch-assurances span {
    grid-column: 2 !important;
    margin: 0 !important;
    color: #7d8d9b !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    text-align: left !important;
  }

  /* The Machine Brief is part of the buying flow, directly above quantity/cart. */
  body.single-product form.cart .rch-machine-brief {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    order: -20 !important;
  }
  body.single-product form.cart .rch-machine-brief summary {
    min-height: 54px !important;
    padding: 12px 13px !important;
  }

  /* Simple products: compact quantity + one-line purchase CTA. */
  body.single-product .product-type-simple form.cart {
    display: grid !important;
    grid-template-columns: 68px minmax(0,1fr) !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 14px 0 8px !important;
    padding: 10px !important;
    border: 1px solid #edf1f4 !important;
    border-radius: 17px !important;
    background: #fff !important;
    box-shadow: 0 8px 26px rgba(6,64,137,.05) !important;
  }
  body.single-product .product-type-simple form.cart > .quantity {
    grid-column: 1 !important;
    width: 68px !important;
    min-width: 68px !important;
    margin: 0 !important;
  }
  body.single-product .product-type-simple form.cart > .quantity .qty {
    width: 68px !important;
    min-width: 68px !important;
    height: 54px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 1px solid #e6ecf1 !important;
    border-radius: 13px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    color: #20394f !important;
    font-size: 16px !important;
    text-align: center !important;
  }
  body.single-product .product-type-simple form.cart > .single_add_to_cart_button {
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: 13px !important;
    background: #064089 !important;
    background-image: none !important;
    box-shadow: 0 8px 20px rgba(6,64,137,.16) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 54px !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: nowrap !important;
  }
  body.single-product .product-type-simple form.cart > .single_add_to_cart_button:hover,
  body.single-product .product-type-simple form.cart > .single_add_to_cart_button:focus {
    background: #07519f !important;
    transform: translateY(-1px);
  }
  body.single-product .product-type-simple form.cart .rch-whatsapp {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
  }

  /* Variable/grouped products still receive the cleaner CTA without forcing their table layout. */
  body.single-product form.cart .single_add_to_cart_button {
    border-radius: 13px !important;
    background: #064089 !important;
    background-image: none !important;
    color: #fff !important;
    font-weight: 750 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
  }

  /* Old duplicate Machine Brief tab should never appear in the lower tab rail. */
  body.single-product .woocommerce-tabs ul.tabs li.jcm-machine-brief-obsolete,
  body.single-product .woocommerce-tabs .jcm-machine-brief-obsolete-panel {
    display: none !important;
  }

  /* Make the fallback footer impossible to collapse/hide on mobile. */
  body .jcm-footer-host.is-global {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 4 !important;
    clear: both !important;
    width: 100% !important;
    height: auto !important;
    min-height: 1px !important;
    overflow: visible !important;
  }
  body .jcm-footer-host.is-global .rcft {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  body .jcm-footer-host.is-global .rcft-main {
    display: grid !important;
  }
}

@media (max-width: 430px) {
  body.single-product .product-type-simple form.cart {
    grid-template-columns: 62px minmax(0,1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }
  body.single-product .product-type-simple form.cart > .quantity,
  body.single-product .product-type-simple form.cart > .quantity .qty {
    width: 62px !important;
    min-width: 62px !important;
  }
  body.single-product .product-type-simple form.cart > .single_add_to_cart_button {
    padding: 0 12px !important;
    font-size: 13px !important;
  }
}
