/* ==========================================================================
   Global Polish — Visual QA fixes
   Requirements: 9.1, 9.2, 9.5, 9.6
   ========================================================================== */

/* --------------------------------------------------------------------------
   Text overflow / clipping prevention (Req 9.1)
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6,
p, li, td, th, a, span, label {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Prevent text from overflowing fixed-width containers */
.woocommerce-loop-product__title,
.woocommerce div.product .product_title,
.entry-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Image aspect ratio and broken placeholder handling (Req 9.2)
   -------------------------------------------------------------------------- */

img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* Hide broken images — show nothing instead of the browser's broken icon */
img[src=""],
img:not([src]) {
  visibility: hidden;
}

/* WooCommerce product images — consistent aspect ratio */
.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  background-color: var(--lv-gray);
}

/* PDP image — contain to avoid cropping */
.woocommerce div.product div.images img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  width: 100%;
  background-color: var(--lv-gray);
}

/* --------------------------------------------------------------------------
   Remove default WooCommerce placeholder styling (Req 9.5)
   -------------------------------------------------------------------------- */

/* Hide WooCommerce placeholder images */
.woocommerce .wc-placeholder,
.woocommerce .wp-post-image[src*="woocommerce-placeholder"],
.woocommerce img.wc-placeholder {
  opacity: 0.3;
  background-color: var(--lv-gray);
}

/* Hide "Hello World" or sample post content if it leaks through */
.hentry .entry-title a[href*="hello-world"],
article#post-1 {
  display: none;
}

/* Clean up any default WooCommerce "no products found" styling */
.woocommerce-info {
  background-color: var(--lv-gray);
  border-top-color: var(--lv-teal);
  color: var(--lv-navy);
}

/* Ensure WooCommerce notices match brand */
.woocommerce-message {
  border-top-color: var(--lv-teal);
}

.woocommerce-error {
  border-top-color: #e74c3c;
}

/* --------------------------------------------------------------------------
   Suppress Astra parent theme header (we use our own lv-site-header)
   Prevents double headers and inconsistent header heights across pages
   -------------------------------------------------------------------------- */

.ast-header-stacked,
.ast-above-header-wrap,
.ast-main-header-wrap,
.ast-below-header-wrap,
#ast-desktop-header,
.ast-mobile-header-wrap,
header.site-header:not(.lv-site-header) {
    display: none !important;
}

/* Ensure our header is always consistent */
.lv-site-header {
    height: 100px !important;
    min-height: 100px !important;
}

.lv-header-inner {
    height: 100px !important;
}
