/* =========================================================
   WordPress / Elementor / WooCommerce compatibility layer
   Keeps the current visual design while using reproducible layouts.
========================================================= */

/* Application hero: remove decorative diagrams and retain a clean content column. */
.ref-app-hero-grid.ref-app-hero-grid--simple {
  grid-template-columns: minmax(0, 760px) !important;
  justify-content: start;
}
.ref-fence-line,
.ref-ground-profile,
.ref-solar-pattern,
.ref-tree-rings {
  display: none !important;
}

/* Product gallery: WooCommerce-style main image with image-only thumbnails. */
.pd-gallery-thumbs {
  display: flex !important;
  flex-wrap: wrap;
  grid-template-columns: none !important;
  gap: 10px !important;
  margin-top: 14px !important;
}
.pd-gallery-thumbs button {
  display: grid !important;
  place-items: center;
  width: 76px !important;
  height: 76px !important;
  min-height: 0 !important;
  padding: 7px !important;
  border: 1px solid #d8dcde !important;
  background: #fff !important;
  color: #111 !important;
  text-align: center !important;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.pd-gallery-thumbs button:hover,
.pd-gallery-thumbs button:focus-visible {
  border-color: #9ca2a5 !important;
  box-shadow: 0 0 0 2px rgba(239,91,19,.12);
  outline: none;
}
.pd-gallery-thumbs button.is-active {
  border-color: var(--orange) !important;
  box-shadow: inset 0 0 0 1px var(--orange);
}
.pd-gallery-thumbs img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}
.pd-gallery-thumbs span { display: none !important; }

/* Standard media blocks replace CSS-only illustrations. */
.ref-standard-app-media,
.ref-standard-product-media {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d9dddf;
  background: #e8eaeb;
}
.ref-standard-app-media {
  align-self: stretch;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.ref-standard-app-media img {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  object-fit: cover;
  object-position: center;
}
.ref-standard-app-media figcaption {
  padding: 13px 16px;
  border-top: 1px solid #d9dddf;
  background: #fff;
  color: #666d71;
  font-size: 10px;
  line-height: 1.55;
}
.ref-standard-app-media--dark {
  border-color: rgba(255,255,255,.14);
  background: #171819;
}
.ref-standard-app-media--dark figcaption {
  border-top-color: rgba(255,255,255,.14);
  background: #171819;
  color: #adb2b5;
}
.ref-fence-kit-media.ref-standard-product-media {
  min-height: 0 !important;
  aspect-ratio: 4 / 3;
  padding: 34px;
  display: grid;
  place-items: center;
}
.ref-fence-kit-media.ref-standard-product-media img {
  display: block;
  width: 72%;
  max-width: 380px;
  max-height: 86%;
  object-fit: contain;
}
.ref-fence-kit-media.ref-standard-product-media span { display: none !important; }

/* Keep practical two-column sections balanced without fixed decorative geometry. */
.ref-solar-control-grid,
.ref-hole-profile-grid,
.ref-fence-kit {
  align-items: stretch !important;
}
.ref-control-copy,
.ref-hole-profile-grid > div:last-child,
.ref-fence-kit-copy {
  align-self: center;
}

/* Elementor/WooCommerce-friendly responsive behaviour. */
@media (max-width: 980px) {
  .ref-app-hero-grid.ref-app-hero-grid--simple {
    grid-template-columns: 1fr !important;
  }
  .ref-standard-app-media {
    min-height: 360px;
  }
}
@media (max-width: 700px) {
  .pd-gallery-thumbs {
    gap: 8px !important;
  }
  .pd-gallery-thumbs button {
    width: 66px !important;
    height: 66px !important;
    padding: 6px !important;
  }
  .ref-standard-app-media {
    min-height: 280px;
  }
  .ref-fence-kit-media.ref-standard-product-media {
    aspect-ratio: 1 / 1;
    padding: 24px;
  }
}

/* Product detail gallery containment: prevent the main image or thumbnails from escaping their columns. */
.pd-product-grid,
.pd-product-grid > *,
.pd-gallery,
.pd-gallery-main,
.pd-gallery-thumbs {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.pd-gallery {
  width: 100%;
  overflow: hidden;
}
.pd-gallery-main {
  position: relative;
  width: 100%;
  overflow: hidden !important;
  contain: layout paint;
}
.pd-gallery-main img,
.pd-gallery-main picture,
.pd-gallery-main picture img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: min(520px, 100%) !important;
  margin: 0 auto;
  object-fit: contain !important;
  object-position: center !important;
}
.pd-gallery-thumbs {
  width: 100%;
  overflow: hidden;
}
.pd-gallery-thumbs button {
  flex: 0 0 76px;
  max-width: 76px;
  overflow: hidden;
  box-sizing: border-box;
}
.pd-gallery-thumbs img {
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .pd-gallery-main img,
  .pd-gallery-main picture,
  .pd-gallery-main picture img {
    max-width: 100% !important;
    max-height: min(320px, 100%) !important;
  }
  .pd-gallery-thumbs button {
    flex-basis: 66px;
    max-width: 66px;
  }
}

/* Product gallery proportion refinement: keep the tall auger product image visually compact. */
.pd-gallery-main {
  min-height: 520px !important;
  height: 520px;
  padding: 38px 42px !important;
}
.pd-gallery-main img,
.pd-gallery-main picture,
.pd-gallery-main picture img {
  max-height: 440px !important;
}

@media (max-width: 1100px) {
  .pd-gallery-main {
    min-height: 460px !important;
    height: 460px;
    padding: 32px !important;
  }
  .pd-gallery-main img,
  .pd-gallery-main picture,
  .pd-gallery-main picture img {
    max-height: 390px !important;
  }
}

@media (max-width: 700px) {
  .pd-gallery-main {
    min-height: 360px !important;
    height: 360px;
    padding: 24px 18px !important;
  }
  .pd-gallery-main img,
  .pd-gallery-main picture,
  .pd-gallery-main picture img {
    max-height: 310px !important;
  }
}

/* Navigation CTA refinement: compact, high-contrast and stable in desktop/mobile headers. */
.site-header .nav-cta {
  min-height: 46px !important;
  padding: 0 20px !important;
  border: 1px solid var(--orange) !important;
  border-radius: 0 !important;
  color: #fff !important;
  background: var(--orange) !important;
  box-shadow: 0 7px 18px rgba(239, 91, 19, 0.18);
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: .075em !important;
  white-space: nowrap;
  transform: none !important;
}
.site-header .nav-cta:hover,
.site-header .nav-cta:focus-visible,
.site-header .nav-cta.active {
  color: #fff !important;
  background: var(--orange-dark) !important;
  border-color: var(--orange-dark) !important;
  box-shadow: 0 9px 22px rgba(207, 67, 5, 0.23);
  transform: none !important;
}
.site-header .nav-cta:focus-visible {
  outline: 2px solid rgba(239, 91, 19, .34);
  outline-offset: 3px;
}

@media (max-width: 1180px) and (min-width: 981px) {
  .site-header .nav-cta {
    min-height: 44px !important;
    padding-inline: 16px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 980px) {
  .site-header .nav-cta {
    width: 100%;
    min-height: 48px !important;
    margin-top: 14px !important;
    padding-inline: 20px !important;
    justify-content: center;
    font-size: 11px !important;
  }
}
