/**
 * DIVSA mobile WooCommerce adapter.
 * Scope contract: BOTH the body class and the mobile media query are required.
 * Nothing in this file may target generic .products/.button selectors outside
 * body.tap-woo-mobile. This prevents homepage/Elementor bleed.
 */
@media (max-width: 767px) {
  body.tap-woo-mobile .woocommerce,
  body.tap-woo-mobile.woocommerce-page main,
  body.tap-woo-mobile.woocommerce-page .site-main {
    color: var(--tap-wc-ink);
  }

  body.tap-woo-mobile .woocommerce ul.products,
  body.tap-woo-mobile.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(var(--tap-wc-cols, 2), minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin: 0 !important;
  }

  body.tap-woo-mobile .woocommerce ul.products::before,
  body.tap-woo-mobile .woocommerce ul.products::after { display: none !important; }

  body.tap-woo-mobile .woocommerce ul.products li.product,
  body.tap-woo-mobile.woocommerce-page ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 0 12px !important;
    overflow: hidden;
    background: var(--tap-wc-card, #fff);
    border: 1px solid var(--tap-wc-line, #ece6f2);
    border-radius: var(--tap-wc-radius, 16px);
    box-shadow: 0 4px 16px rgba(30,10,46,.08);
  }

  body.tap-woo-mobile .woocommerce ul.products li.product a img,
  body.tap-woo-mobile.woocommerce-page ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: var(--tap-wc-ratio, 1/1) !important;
    object-fit: cover !important;
    object-position: center !important;
    margin: 0 0 10px !important;
    display: block;
  }

  body.tap-woo-mobile .woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.tap-woo-mobile.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    color: var(--tap-wc-ink);
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 10px !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  body.tap-woo-mobile .woocommerce ul.products li.product .price,
  body.tap-woo-mobile.woocommerce-page ul.products li.product .price {
    color: var(--tap-wc-primary);
    font-weight: 800;
    padding: 0 10px;
    margin: 7px 0 0;
  }

  body.tap-woo-mobile .woocommerce a.button,
  body.tap-woo-mobile .woocommerce button.button,
  body.tap-woo-mobile .woocommerce input.button,
  body.tap-woo-mobile .woocommerce #respond input#submit {
    min-height: 44px;
    border-radius: 999px !important;
    background: var(--tap-wc-primary) !important;
    color: var(--tap-wc-cta, #fff) !important;
    border: 0 !important;
    font-weight: 700 !important;
    box-shadow: none !important;
  }

  body.tap-woo-mobile .woocommerce ul.products li.product .button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 10px 10px 0 !important;
    padding: 8px 10px !important;
    min-height: 40px;
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  body.tap-woo-mobile .woocommerce .quantity .qty,
  body.tap-woo-mobile .woocommerce form .form-row input.input-text,
  body.tap-woo-mobile .woocommerce form .form-row textarea,
  body.tap-woo-mobile .woocommerce form .form-row select,
  body.tap-woo-mobile .woocommerce .select2-container .select2-selection {
    min-height: 44px;
    border: 1px solid var(--tap-wc-line) !important;
    border-radius: 12px !important;
    background: var(--tap-wc-card) !important;
    color: var(--tap-wc-ink) !important;
    box-sizing: border-box;
  }

  body.tap-woo-mobile .woocommerce-cart-form,
  body.tap-woo-mobile .cart_totals,
  body.tap-woo-mobile .woocommerce-checkout-review-order,
  body.tap-woo-mobile .woocommerce-billing-fields,
  body.tap-woo-mobile .woocommerce-shipping-fields,
  body.tap-woo-mobile .woocommerce-account .woocommerce-MyAccount-navigation,
  body.tap-woo-mobile .woocommerce-account .woocommerce-MyAccount-content {
    background: var(--tap-wc-card, #fff);
    border: 1px solid var(--tap-wc-line, #ece6f2);
    border-radius: var(--tap-wc-radius, 16px);
    padding: 14px;
    box-sizing: border-box;
  }

  body.tap-woo-mobile .woocommerce-checkout .col2-set,
  body.tap-woo-mobile .woocommerce-checkout .col2-set .col-1,
  body.tap-woo-mobile .woocommerce-checkout .col2-set .col-2,
  body.tap-woo-mobile .woocommerce-account .woocommerce-MyAccount-navigation,
  body.tap-woo-mobile .woocommerce-account .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
  }

  body.tap-woo-mobile .woocommerce-account .woocommerce-MyAccount-content { margin-top: 12px; }

  body.tap-woo-mobile .woocommerce table.shop_table {
    border-color: var(--tap-wc-line) !important;
    border-radius: 12px !important;
    overflow: hidden;
  }

  body.tap-woo-mobile .woocommerce-message,
  body.tap-woo-mobile .woocommerce-info,
  body.tap-woo-mobile .woocommerce-error {
    border-radius: 12px;
    background: var(--tap-wc-card);
    color: var(--tap-wc-ink);
    border-color: var(--tap-wc-line);
  }

  body.tap-woo-mobile .woocommerce .woocommerce-breadcrumb,
  body.tap-woo-mobile .woocommerce-result-count,
  body.tap-woo-mobile .woocommerce .product_meta { color: var(--tap-wc-muted); }
}
