/* CWS Premium Shop UI - mobile single-product refinement
 * v1.6.0
 * Scope: single product pages, phones only.
 * Archive/shop CSS and JavaScript are intentionally untouched.
 */
@media (max-width: 767px) {
  /* ---------------------------------------------------------
   * Product image: remove the desktop 400px gallery height on
   * phones so the image stays prominent without a large blank card.
   * --------------------------------------------------------- */
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-d280724 {
    --padding-top: 0px;
    --padding-bottom: 4px;
    --padding-left: 10px;
    --padding-right: 10px;
    --gap: 0px 0px;
    align-items: flex-start !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-ac608c6 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.single-product.cws-premium-product-ui .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.single-product.cws-premium-product-ui .woocommerce-product-gallery .flex-viewport,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__wrapper,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image > a {
    height: min(300px, calc(100vw - 32px)) !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: min(300px, calc(100vw - 32px)) !important;
    margin: 0 auto !important;
    padding: 10px 12px !important;
    object-fit: contain !important;
  }

  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__trigger {
    top: 8px !important;
    right: 8px !important;
  }

  body.single-product.cws-premium-product-ui .woocommerce-product-gallery .swiper-pagination1:empty,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery .product-video-360:empty {
    display: none !important;
  }

  /* Keep a compact, deliberate gap between gallery and product info. */
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-5359c02 {
    --gap: 8px 8px;
    --row-gap: 8px;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-e163d92 {
    --padding-top: 8px;
    --padding-bottom: 12px;
    --padding-left: 10px;
    --padding-right: 10px;
    --gap: 14px 14px;
    --row-gap: 14px;
    align-items: stretch !important;
  }

  /* ---------------------------------------------------------
   * Downloads / Get a Quote: preserve the existing two-column
   * idea but align both columns cleanly at the bottom.
   * --------------------------------------------------------- */
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-8439bd5 {
    --e-con-grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
    --e-con-grid-template-rows: auto;
    --gap: 12px 12px;
    --row-gap: 12px;
    --column-gap: 12px;
    align-items: end !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-a768d3c {
    --gap: 4px 4px;
    --row-gap: 4px;
    min-width: 0 !important;
    justify-content: flex-start !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-c35fb85 {
    --justify-content: flex-end;
    justify-content: flex-end !important;
    align-items: flex-end !important;
    min-width: 0 !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-f1327dd {
    width: 100% !important;
    max-width: 132px !important;
    margin: 0 !important;
    align-self: flex-end !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-f1327dd .elementor-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* ---------------------------------------------------------
   * Model selector + Add To Cart: Elementor sets this widget to
   * 60% on mobile and the site's global variation CSS keeps the
   * form flexed. Make this action group full width and stack it.
   * --------------------------------------------------------- */
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-b8a0ac5 {
    width: 100% !important;
    max-width: 100% !important;
    --gap: 8px 8px;
    --row-gap: 8px;
    align-items: stretch !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 {
    width: 100% !important;
    max-width: 100% !important;
    --container-widget-width: 100% !important;
    --container-widget-flex-grow: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .elementor-add-to-cart,
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 form.variations_form.cart,
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .single_variation_wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 form.variations_form.cart {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 table.variations {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 table.variations td.value,
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 table.variations td.value select {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 table.variations td.value select {
    min-height: 44px !important;
    margin: 0 !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .woocommerce-variation-add-to-cart,
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .woocommerce-variation-add-to-cart-enabled {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    gap: 8px !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .single_add_to_cart_button,
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 form.cart .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 11px 14px !important;
    text-align: center !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .single_variation,
  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-3443432 .woocommerce-variation-price {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 360px) {
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery .flex-viewport,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__wrapper,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image > a,
  body.single-product.cws-premium-product-ui .woocommerce-product-gallery__image img {
    height: calc(100vw - 28px) !important;
  }

  body.single-product.cws-premium-product-ui .elementor-location-single .elementor-element-8439bd5 {
    --e-con-grid-template-columns: minmax(0, 1fr) 108px;
    --column-gap: 10px;
  }
}
