/* v5.1.26 — footer de-boxing, archive/single gallery fit, EU modal fit */

/* ---------- Footer: less boxed, more elegant ---------- */
body.vlg-theme .vlg-footer.vlg-footer--premium.vlg-footer--refined {
  padding-top: 18px !important;
}

body.vlg-theme .vlg-footer-trustbar {
  margin-bottom: 18px !important;
}

body.vlg-theme .vlg-footer-brand-card,
body.vlg-theme .vlg-footer-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 10px 0 12px !important;
}

body.vlg-theme .vlg-footer-brand-card::before,
body.vlg-theme .vlg-footer-panel::before {
  display: none !important;
}

body.vlg-theme .vlg-footer-brand-head {
  margin-bottom: 12px !important;
}

body.vlg-theme .vlg-footer-about {
  max-width: 46ch !important;
  margin-bottom: 18px !important;
}

body.vlg-theme .vlg-footer-brand-meta {
  gap: 12px !important;
}

body.vlg-theme .vlg-footer-mini-card {
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: none !important;
}

body.vlg-theme .vlg-footer-panel h3 {
  margin-bottom: 14px !important;
}

body.vlg-theme .vlg-footer-menu {
  gap: 10px !important;
}

body.vlg-theme .vlg-footer-menu li {
  padding: 0 !important;
}

body.vlg-theme .vlg-footer-contact-row {
  padding: 10px 0 !important;
  gap: 12px !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

body.vlg-theme .vlg-footer-contact-row:last-child {
  border-bottom: 0 !important;
}

body.vlg-theme .vlg-footer-contact-icon {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,180,79,.18) !important;
  box-shadow: none !important;
}

body.vlg-theme .vlg-footer-payments-wrap {
  margin-top: 10px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
}

body.vlg-theme .vlg-footer-bottom.vlg-footer-bottom--premium {
  gap: 12px 20px !important;
}

/* ---------- Mobile product cards (archive/listing) ---------- */
@media (max-width: 782px) {
  body.vlg-theme .vlg-product-card .vlg-card-image-wrap,
  body.vlg-theme ul.products li.product.vlg-product-card .vlg-card-image-wrap {
    margin: 8px 8px 0 !important;
    padding: 10px !important;
    aspect-ratio: 1 / 0.86 !important;
    min-height: 190px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-image-wrap > a,
  body.vlg-theme ul.products li.product.vlg-product-card .vlg-card-image-wrap > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.vlg-theme .vlg-product-card .wp-post-image,
  body.vlg-theme .vlg-product-card img:first-of-type,
  body.vlg-theme ul.products li.product.vlg-product-card .wp-post-image,
  body.vlg-theme ul.products li.product.vlg-product-card img:first-of-type {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  body.vlg-theme .vlg-product-card .vlg-card-content {
    padding-top: 8px !important;
  }

  /* Single product hero image: remove oversized empty grey area */
  html body.vlg-theme.single-product .vlg-product-gallery-card {
    padding: 8px !important;
    min-height: 0 !important;
  }

  html body.vlg-theme.single-product .vlg-product-gallery-media,
  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,
  html body.vlg-theme.single-product .woocommerce-product-gallery__image a {
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html body.vlg-theme.single-product .flex-viewport {
    min-height: 220px !important;
    aspect-ratio: 1 / 0.92 !important;
    overflow: hidden !important;
  }

  html body.vlg-theme.single-product .woocommerce-product-gallery__wrapper {
    width: 100% !important;
  }

  html body.vlg-theme.single-product .woocommerce-product-gallery__image {
    width: 100% !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: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: min(50vh, 330px) !important;
    object-fit: contain !important;
    object-position: center center !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }

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

  /* EU energy modal must fit fully on phone */
  .valgusallikad-energiasildid-modal {
    padding: 8px !important;
    align-items: center !important;
  }

  .valgusallikad-energiasildid-modal-dialog {
    width: min(94vw, 360px) !important;
    max-width: 94vw !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 8px 8px 12px !important;
    gap: 8px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    justify-items: center !important;
    align-content: start !important;
  }

  .valgusallikad-energiasildid-modal-title {
    padding-right: 48px !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
  }

  .valgusallikad-energiasildid-modal-close {
    top: 8px !important;
    right: 8px !important;
    width: 36px !important;
    height: 36px !important;
  }

  .valgusallikad-energiasildid-modal-image {
    width: auto !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 190px) !important;
    margin: 0 auto !important;
  }

  .valgusallikad-energiasildid-modal-filter {
    width: 100% !important;
    min-height: 50px !important;
    padding: 12px 14px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    border-radius: 999px !important;
  }

  .fs-euel-modal {
    padding: 8px !important;
    align-items: center !important;
  }

  .fs-euel-modal-dialog {
    width: min(94vw, 360px) !important;
    max-width: 94vw !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 8px 8px 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .fs-euel-modal-title {
    margin-right: 48px !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
  }

  .fs-euel-modal-close {
    top: 8px !important;
    right: 8px !important;
    width: 36px !important;
    height: 36px !important;
  }

  .fs-euel-modal-image {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 190px) !important;
    margin: 0 auto !important;
  }

  .fs-euel-modal-filter {
    width: 100% !important;
    min-height: 50px !important;
    padding: 12px 14px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    border-radius: 999px !important;
    white-space: normal !important;
  }
}

@media (max-width: 390px) {
  body.vlg-theme .vlg-product-card .vlg-card-image-wrap,
  body.vlg-theme ul.products li.product.vlg-product-card .vlg-card-image-wrap {
    min-height: 176px !important;
    aspect-ratio: 1 / 0.88 !important;
  }

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

  .valgusallikad-energiasildid-modal-image,
  .fs-euel-modal-image {
    max-height: calc(100dvh - 184px) !important;
  }

  .valgusallikad-energiasildid-modal-filter,
  .fs-euel-modal-filter {
    font-size: 11.5px !important;
  }
}
