/* v3.7.0 — shop/product/footer layout repair + ValgusBundle support
   Focus: screenshots showed shop helper blocks taking too much vertical space,
   product image gallery leaving a very large empty area and footer feeling too tall.
*/

/* Keep WooCommerce archive content centered and use available width sanely. */
body.vlg-theme.woocommerce-shop .vlg-shop-page,
body.vlg-theme.tax-product_cat .vlg-shop-page,
body.vlg-theme.post-type-archive-product .vlg-shop-page,
body.vlg-theme.search .vlg-search-products-page {
  width: min(100% - 32px, 1480px) !important;
  max-width: 1480px !important;
  margin-inline: auto !important;
}

body.vlg-theme .vlg-shop-layout,
body.vlg-theme .vlg-products-layout,
body.vlg-theme .vlg-shop-content-wrap {
  align-items: start !important;
}

body.vlg-theme .vlg-shop-sidebar {
  max-width: 270px !important;
}

body.vlg-theme .vlg-shop-products,
body.vlg-theme .vlg-products-wrap,
body.vlg-theme ul.products {
  min-width: 0 !important;
}

/* Shop helper blocks: never behave like huge hero sections inside shop/listing. */
body.vlg-theme.woocommerce-shop .vlg-shop-preloop,
body.vlg-theme.tax-product_cat .vlg-shop-preloop,
body.vlg-theme.post-type-archive-product .vlg-shop-preloop,
body.vlg-theme.search .vlg-shop-preloop {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto 22px !important;
  display: grid !important;
  gap: 14px !important;
}

body.vlg-theme.woocommerce-shop .vlg-shop-preloop .vlg-kompass,
body.vlg-theme.tax-product_cat .vlg-shop-preloop .vlg-kompass,
body.vlg-theme.post-type-archive-product .vlg-shop-preloop .vlg-kompass,
body.vlg-theme.search .vlg-shop-preloop .vlg-kompass {
  margin: 0 !important;
  padding: 16px !important;
  border-radius: 22px !important;
  box-shadow: 0 14px 34px rgba(7,18,36,.12) !important;
}

body.vlg-theme.woocommerce-shop .vlg-shop-preloop .vlg-kompass h2,
body.vlg-theme.tax-product_cat .vlg-shop-preloop .vlg-kompass h2,
body.vlg-theme.post-type-archive-product .vlg-shop-preloop .vlg-kompass h2,
body.vlg-theme.search .vlg-shop-preloop .vlg-kompass h2 {
  font-size: clamp(22px, 2.2vw, 32px) !important;
}

body.vlg-theme.woocommerce-shop .vlg-shop-preloop .vlg-kompass__grid,
body.vlg-theme.tax-product_cat .vlg-shop-preloop .vlg-kompass__grid,
body.vlg-theme.post-type-archive-product .vlg-shop-preloop .vlg-kompass__grid,
body.vlg-theme.search .vlg-shop-preloop .vlg-kompass__grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr)) !important;
  gap: 10px !important;
  margin: 12px 0 !important;
}

body.vlg-theme.woocommerce-shop .vlg-shop-preloop .vlg-buyer-assistant,
body.vlg-theme.tax-product_cat .vlg-shop-preloop .vlg-buyer-assistant,
body.vlg-theme.post-type-archive-product .vlg-shop-preloop .vlg-buyer-assistant,
body.vlg-theme.search .vlg-shop-preloop .vlg-buyer-assistant {
  margin: 0 !important;
  max-width: none !important;
}

/* Product cards: prevent too-narrow columns and vertical text. */
body.vlg-theme ul.products li.product,
body.vlg-theme .vlg-product-card,
body.vlg-theme .vlg-card {
  min-width: 0 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

body.vlg-theme ul.products li.product h2,
body.vlg-theme ul.products li.product h3,
body.vlg-theme .vlg-product-card-title,
body.vlg-theme .woocommerce-loop-product__title {
  writing-mode: horizontal-tb !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
}

/* Single product: reduce the huge white gallery space from the screenshot. */
body.vlg-theme.single-product .woocommerce-product-gallery,
body.vlg-theme.single-product .vlg-product-gallery,
body.vlg-theme.single-product .vlg-product-media {
  min-height: 0 !important;
  max-height: 720px !important;
}

body.vlg-theme.single-product .woocommerce-product-gallery__wrapper,
body.vlg-theme.single-product .woocommerce-product-gallery__image,
body.vlg-theme.single-product .vlg-product-gallery-main {
  min-height: 0 !important;
  max-height: 560px !important;
}

body.vlg-theme.single-product .woocommerce-product-gallery__image img,
body.vlg-theme.single-product .vlg-product-gallery img,
body.vlg-theme.single-product .vlg-product-media img {
  max-height: 520px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  margin-inline: auto !important;
}

body.vlg-theme.single-product .flex-control-thumbs,
body.vlg-theme.single-product .vlg-product-thumbs {
  margin-top: 14px !important;
}

/* Footer: more compact, better balanced payment logos. */
body.vlg-theme .vlg-site-footer,
body.vlg-theme footer.site-footer {
  padding-top: 44px !important;
  padding-bottom: 28px !important;
}

body.vlg-theme .vlg-footer-inner,
body.vlg-theme .vlg-footer-grid {
  gap: 28px !important;
  align-items: start !important;
}

body.vlg-theme .vlg-footer-payments,
body.vlg-theme .vlg-payment-logos {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 9px !important;
  max-width: 360px !important;
}

body.vlg-theme .vlg-footer-payments img,
body.vlg-theme .vlg-payment-logos img {
  max-height: 30px !important;
  width: auto !important;
}

/* ValgusBundle public block. */
.vlg-bundle {
  margin: 24px 0;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid #dbe6f3;
  background: linear-gradient(180deg,#ffffff,#f8fbff);
  box-shadow: 0 16px 42px rgba(15,23,42,.08);
}
.vlg-bundle__head {display:flex; gap:14px; align-items:flex-start; margin-bottom:16px;}
.vlg-bundle__icon {display:grid; place-items:center; width:48px; height:48px; border-radius:18px; background:#fff4df; font-size:24px;}
.vlg-bundle__head h2 {margin:0; color:#071224; font-size:clamp(24px,3vw,36px); line-height:1.05;}
.vlg-bundle__head p {margin:6px 0 0; color:#64748b; font-weight:700;}
.vlg-bundle__grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px;}
.vlg-bundle__card {display:grid; gap:8px; padding:16px; border:1px solid #dbe6f3; border-radius:20px; background:#fff; text-decoration:none; color:#071224; box-shadow:0 10px 26px rgba(15,23,42,.05);}
.vlg-bundle__card strong {font-size:18px; line-height:1.15;}
.vlg-bundle__card span {color:#64748b; font-weight:700;}
.vlg-bundle__card em {display:inline-flex; width:max-content; margin-top:4px; color:#f18700; font-style:normal; font-weight:950;}
.vlg-bundle__card:hover {border-color:#ffb34d; transform:translateY(-1px);}

@media (max-width: 991.98px) {
  body.vlg-theme .vlg-shop-layout,
  body.vlg-theme .vlg-products-layout {
    grid-template-columns: 1fr !important;
  }
  body.vlg-theme .vlg-shop-sidebar {
    max-width: none !important;
  }
  body.vlg-theme .vlg-shop-preloop .vlg-kompass__grid,
  body.vlg-theme.woocommerce-shop .vlg-shop-preloop .vlg-kompass__grid,
  body.vlg-theme.tax-product_cat .vlg-shop-preloop .vlg-kompass__grid,
  body.vlg-theme.post-type-archive-product .vlg-shop-preloop .vlg-kompass__grid,
  body.vlg-theme.search .vlg-shop-preloop .vlg-kompass__grid {
    grid-template-columns: 1fr !important;
  }
  .vlg-bundle__grid {grid-template-columns:1fr !important;}
}

@media (max-width: 767.98px) {
  body.vlg-theme.woocommerce-shop .vlg-shop-page,
  body.vlg-theme.tax-product_cat .vlg-shop-page,
  body.vlg-theme.post-type-archive-product .vlg-shop-page,
  body.vlg-theme.search .vlg-search-products-page {
    width: min(100% - 20px, 100%) !important;
  }
  body.vlg-theme .vlg-shop-preloop .vlg-kompass,
  body.vlg-theme .vlg-shop-preloop .vlg-buyer-assistant {
    display: none !important; /* On phones: keep product list first, no oversized helpers. */
  }
  body.vlg-theme ul.products,
  body.vlg-theme .products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  body.vlg-theme.single-product .woocommerce-product-gallery__image img,
  body.vlg-theme.single-product .vlg-product-gallery img,
  body.vlg-theme.single-product .vlg-product-media img {
    max-height: 360px !important;
  }
  body.vlg-theme .vlg-site-footer,
  body.vlg-theme footer.site-footer {
    padding-top: 30px !important;
  }
}
