/* v5.1.25 — Mobile gallery and energy modal fit */
@media (max-width: 782px) {
  html body.vlg-theme.single-product .vlg-single-product-page {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  html body.vlg-theme.single-product .vlg-product-gallery-card {
    padding: 6px !important;
    border-radius: 20px !important;
    margin-bottom: 10px !important;
    min-height: 0 !important;
  }

  html body.vlg-theme.single-product .vlg-product-gallery-media {
    gap: 8px !important;
  }

  html body.vlg-theme.single-product .woocommerce-product-gallery,
  html body.vlg-theme.single-product .flex-viewport,
  html body.vlg-theme.single-product .woocommerce-product-gallery__wrapper,
  html body.vlg-theme.single-product .woocommerce-product-gallery__image {
    border-radius: 18px !important;
    min-height: 0 !important;
  }

  html body.vlg-theme.single-product .woocommerce-product-gallery__image a {
    min-height: 0 !important;
    padding: 0 !important;
  }

  html body.vlg-theme.single-product .woocommerce-product-gallery__image img,
  html body.vlg-theme.single-product .woocommerce-product-gallery img.wp-post-image,
  html body.vlg-theme.single-product .vlg-product-gallery-card img {
    width: auto !important;
    max-width: 100% !important;
    max-height: min(54vh, 360px) !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }

  html body.vlg-theme.single-product .flex-control-thumbs {
    gap: 6px !important;
    margin-top: 8px !important;
    padding: 0 0 4px !important;
  }

  html body.vlg-theme.single-product .flex-control-thumbs li {
    flex-basis: 58px !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 12px !important;
  }

  html body.vlg-theme.single-product .flex-control-thumbs img {
    padding: 5px !important;
  }

  html body.vlg-theme.single-product .vlg-single-image-energy {
    right: 8px !important;
    bottom: 8px !important;
    transform: scale(.88) !important;
    transform-origin: right bottom !important;
  }

  html body.vlg-theme.single-product .vlg-product-summary-card,
  html body.vlg-theme.single-product div.product .summary {
    padding: 14px !important;
  }

  html body.vlg-theme.single-product .vlg-pill {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }

  html body.vlg-theme.single-product .product_title,
  html body.vlg-theme.single-product div.product .product_title {
    font-size: clamp(18px, 5.2vw, 26px) !important;
    line-height: 1.14 !important;
    letter-spacing: -.03em !important;
  }

  html body.vlg-theme.single-product .vlg-product-price,
  html body.vlg-theme.single-product div.product p.price,
  html body.vlg-theme.single-product div.product span.price {
    font-size: clamp(17px, 4.7vw, 24px) !important;
    line-height: 1.15 !important;
  }

  /* Core energy label modal (Energiasildid module) */
  .valgusallikad-energiasildid-modal {
    padding: 10px !important;
  }

  .valgusallikad-energiasildid-modal-dialog {
    width: min(96vw, 420px) !important;
    max-width: 96vw !important;
    padding: 12px 12px 14px !important;
    border-radius: 20px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    gap: 10px !important;
    overflow-x: hidden !important;
  }

  .valgusallikad-energiasildid-modal-title {
    width: 100% !important;
    margin: 0 !important;
    padding-right: 50px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  .valgusallikad-energiasildid-modal-close {
    top: 10px !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  .valgusallikad-energiasildid-modal-image {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 58vh !important;
    margin: 0 auto !important;
    border-radius: 10px !important;
  }

  .valgusallikad-energiasildid-modal-filter {
    width: 100% !important;
    min-height: 54px !important;
    margin-top: 2px !important;
    padding: 14px 16px !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: normal !important;
    justify-content: center !important;
  }

  /* Legacy energy label modal compatibility */
  .fs-euel-modal {
    padding: 10px !important;
  }

  .fs-euel-modal-dialog {
    width: min(96vw, 420px) !important;
    max-width: 96vw !important;
    padding: 12px 12px 14px !important;
    border-radius: 20px !important;
  }

  .fs-euel-modal-title {
    margin: 0 50px 8px 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
  }

  .fs-euel-modal-close {
    top: 10px !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
  }

  .fs-euel-modal-image {
    max-height: 58vh !important;
    margin: 0 auto !important;
  }

  .fs-euel-modal-filter {
    width: 100% !important;
    margin-top: 10px !important;
    padding: 14px 16px !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: normal !important;
  }
}

@media (max-width: 390px) {
  html body.vlg-theme.single-product .product_title,
  html body.vlg-theme.single-product div.product .product_title {
    font-size: clamp(17px, 5vw, 23px) !important;
  }

  .valgusallikad-energiasildid-modal-dialog,
  .fs-euel-modal-dialog {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    padding: 10px 10px 12px !important;
  }

  .valgusallikad-energiasildid-modal-filter,
  .fs-euel-modal-filter {
    font-size: 12px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
