/* v4.2.1 — mobile add-to-cart visibility fix
   Problem: on mobile, listing cards could visually cut off the add-to-cart
   row or push it outside the visible card area.
*/

@media (max-width: 767.98px) {
  body.vlg-theme ul.products,
  body.vlg-theme .vlg-products-grid,
  body.vlg-theme .vlg-shop-products ul.products {
    align-items: stretch !important;
    gap: 12px !important;
  }

  body.vlg-theme ul.products li.product.vlg-product-card,
  body.vlg-theme .vlg-products-grid li.product.vlg-product-card,
  body.vlg-theme .vlg-shop-products ul.products li.product.vlg-product-card,
  body.vlg-theme .vlg-product-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding-bottom: 10px !important;
  }

  body.vlg-theme .vlg-product-card .vlg-product-link,
  body.vlg-theme ul.products li.product.vlg-product-card .vlg-product-link {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-content,
  body.vlg-theme ul.products li.product.vlg-product-card .vlg-card-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
    min-height: 0 !important;
    padding-bottom: 4px !important;
  }

  body.vlg-theme .vlg-product-card .woocommerce-loop-product__title,
  body.vlg-theme .vlg-product-card h2 {
    min-height: 2.7em !important;
    max-height: 2.7em !important;
    margin-bottom: 2px !important;
  }

  body.vlg-theme .vlg-product-card .price,
  body.vlg-theme .vlg-product-card .vlg-card-price {
    margin-top: auto !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-actions,
  body.vlg-theme ul.products li.product.vlg-product-card .vlg-card-actions,
  body.vlg-theme .vlg-products-grid li.product.vlg-product-card .vlg-card-actions {
    display: block !important;
    position: static !important;
    margin-top: 10px !important;
    padding: 0 10px 0 !important;
    min-height: 0 !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible !important;
    z-index: 3 !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-actions .button,
  body.vlg-theme .vlg-product-card .vlg-card-actions .vlg-card-cart,
  body.vlg-theme .vlg-product-card .vlg-card-actions .added_to_cart {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 42px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-radius: 14px !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-actions .button::before,
  body.vlg-theme .vlg-product-card .vlg-card-actions .button::after,
  body.vlg-theme .vlg-product-card .vlg-card-actions .vlg-card-cart::before,
  body.vlg-theme .vlg-product-card .vlg-card-actions .vlg-card-cart::after {
    content: none !important;
    display: none !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-actions .button,
  body.vlg-theme .vlg-product-card .vlg-card-actions .vlg-card-cart {
    padding: 0 12px !important;
  }
}

@media (max-width: 390px) {
  body.vlg-theme ul.products,
  body.vlg-theme .vlg-products-grid,
  body.vlg-theme .vlg-shop-products ul.products {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  body.vlg-theme .vlg-product-card .woocommerce-loop-product__title,
  body.vlg-theme .vlg-product-card h2 {
    min-height: 3.0em !important;
    max-height: 3.0em !important;
    font-size: 15px !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-actions .button,
  body.vlg-theme .vlg-product-card .vlg-card-actions .vlg-card-cart {
    min-height: 40px !important;
    font-size: 11px !important;
  }
}
