/**
 * FootArmy Product UX - Layout FINAL
 * Owns the WoodMart/Elementor product page shell, gallery, buy-box, lower content and product cards.
 * SportsCore option visuals live in fa-product-ux-sportscore.css.
 * Header and SportsCore sticky Add To Cart are intentionally untouched.
 */

/**
 * FootArmy Product UX FINAL
 * Scope: ONLY the new semantic product layout.
 *
 * Important:
 * - Does NOT style the site header.
 * - Does NOT style or resize SportsCore's sticky add-to-cart bar.
 * - Does NOT change SportsCore business logic.
 * - Does NOT use generated Elementor element IDs.
 */

body.single-product .fa-pdp-shell,
body.single-product .fa-pdp-section {
  --fa-ink: #101828;
  --fa-ink-2: #233044;
  --fa-muted: #667085;
  --fa-muted-2: #8a94a3;
  --fa-line: #e2e7ee;
  --fa-line-soft: #edf0f4;
  --fa-surface: #ffffff;
  --fa-soft: #f7f9fc;
  --fa-soft-2: #f1f5f9;
  --fa-navy: #10284a;
  --fa-navy-2: #17395f;
  --fa-blue: #175cd3;
  --fa-green: #78b82a;
  --fa-green-dark: #5f9d19;
  --fa-success-soft: #f4f9ec;
  --fa-radius-xs: 9px;
  --fa-radius-sm: 12px;
  --fa-radius-md: 16px;
  --fa-radius-lg: 22px;
  --fa-radius-xl: 26px;
  --fa-shadow-soft: 0 14px 40px rgba(16, 40, 74, .055);
  --fa-shadow-card: 0 8px 24px rgba(16, 40, 74, .045);
  color: var(--fa-ink);
}

/* ---------- PAGE / TOP SHELL ---------- */

body.single-product .fa-pdp-shell {
  overflow: visible;
  background:
    radial-gradient(circle at 18% 0%, rgba(23,92,211,.035), transparent 25%),
    radial-gradient(circle at 88% 15%, rgba(120,184,42,.025), transparent 23%),
    #f7f8fa !important;
}

body.single-product .fa-pdp-crumb-row {
  min-height: 30px;
}

body.single-product .fa-pdp-breadcrumbs,
body.single-product .fa-pdp-breadcrumbs a {
  color: #7d8796;
  font-size: 12.5px;
  line-height: 1.4;
}

body.single-product .fa-pdp-breadcrumbs a {
  text-decoration: none;
  transition: color .16s ease;
}

body.single-product .fa-pdp-breadcrumbs a:hover {
  color: var(--fa-navy);
}

body.single-product .fa-pdp-hero {
  align-items: flex-start !important;
  overflow: visible;
}

body.single-product .fa-pdp-gallery,
body.single-product .fa-pdp-buybox {
  min-width: 0;
}

/* ---------- GALLERY ---------- */

body.single-product .fa-pdp-gallery {
  overflow: hidden;
  border-color: rgba(213,220,229,.92) !important;
  box-shadow: var(--fa-shadow-soft);
}

body.single-product .fa-pdp-gallery-widget,
body.single-product .fa-pdp-gallery-widget > .elementor-widget-container,
body.single-product .fa-pdp-gallery-widget .woocommerce-product-gallery,
body.single-product .fa-pdp-gallery-widget .wd-carousel-container {
  width: 100% !important;
  max-width: none !important;
}

body.single-product .fa-pdp-gallery-widget .woocommerce-product-gallery {
  margin: 0 !important;
}

body.single-product .fa-pdp-gallery-widget .woocommerce-product-gallery__wrapper,
body.single-product .fa-pdp-gallery-widget .wd-carousel-wrap {
  background: linear-gradient(180deg, #fff, #fcfdff);
  border-radius: 18px;
}

body.single-product .fa-pdp-gallery-widget img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

body.single-product .fa-pdp-gallery-widget .wd-carousel-thumb {
  border-radius: 12px !important;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color .16s ease, transform .16s ease, opacity .16s ease;
}

body.single-product .fa-pdp-gallery-widget .wd-carousel-thumb:hover {
  transform: translateY(-1px);
}

body.single-product .fa-pdp-gallery-widget .wd-carousel-thumb.wd-active,
body.single-product .fa-pdp-gallery-widget .wd-carousel-thumb.active-thumb {
  border-color: var(--fa-navy) !important;
}

/* ---------- BUY BOX ---------- */

body.single-product .fa-pdp-buybox {
  border-color: rgba(213,220,229,.96) !important;
  box-shadow: 0 18px 42px rgba(16,40,74,.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(253,254,255,1)) !important;
}

body.single-product .fa-pdp-product-head {
  position: relative;
  padding-bottom: 17px !important;
  margin-bottom: 2px;
}

body.single-product .fa-pdp-product-head::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e6eaf0 12%, #e6eaf0 88%, transparent);
}

body.single-product .fa-pdp-title .product_title {
  margin: 0 !important;
  color: #0e1728;
  line-height: 1.15 !important;
  letter-spacing: -.025em;
  text-align: center;
}

body.single-product .fa-pdp-price .price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 !important;
  line-height: 1.1;
}

body.single-product .fa-pdp-price .price ins {
  order: -1;
  text-decoration: none;
  color: var(--fa-green);
  font-weight: 900;
}

body.single-product .fa-pdp-price .price del {
  opacity: .35;
  font-size: .66em;
  font-weight: 650;
  color: #7d8794;
  text-decoration-thickness: 1.5px;
}

body.single-product .fa-pdp-short .woocommerce-product-details__short-description {
  color: #687487;
  font-size: 12.5px;
}

body.single-product .fa-pdp-short .woocommerce-product-details__short-description p {
  margin-bottom: 7px;
}

body.single-product .fa-pdp-short .woocommerce-product-details__short-description p:last-child {
  margin-bottom: 0;
}

/* ---------- LOWER PAGE SECTIONS ---------- */

body.single-product .fa-pdp-section {
  overflow: hidden;
}

body.single-product .fa-pdp-fbt,
body.single-product .fa-pdp-details,
body.single-product .fa-pdp-related,
body.single-product .fa-pdp-recent {
  box-shadow: 0 10px 28px rgba(16,40,74,.035);
}

body.single-product .fa-pdp-fbt-widget .wd-fbt {
  margin: 0 !important;
}

body.single-product .fa-pdp-tabs-widget .wc-tabs-wrapper,
body.single-product .fa-pdp-tabs-widget .woocommerce-tabs {
  margin: 0 !important;
}

body.single-product .fa-pdp-tabs-widget .wd-accordion-item {
  border-color: #e7ebf0 !important;
}

body.single-product .fa-pdp-tabs-widget .wd-accordion-title {
  min-height: 58px;
  padding-block: 15px !important;
  color: #202b3b !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

body.single-product .fa-pdp-tabs-widget .wd-accordion-content {
  color: #596579;
  line-height: 1.75;
  font-size: 13px;
}

body.single-product .fa-pdp-related-widget ul.products {
  margin-bottom: 0 !important;
}

body.single-product .fa-pdp-related-widget .product-grid-item,
body.single-product .fa-pdp-recent-widget .wd-product {
  min-width: 0;
}

body.single-product .fa-pdp-related-widget .product-wrapper,
body.single-product .fa-pdp-recent-widget .product-wrapper {
  border: 1px solid #e5e9ef;
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(16,40,74,.025);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

body.single-product .fa-pdp-related-widget .product-wrapper:hover,
body.single-product .fa-pdp-recent-widget .product-wrapper:hover {
  transform: translateY(-2px);
  border-color: #d5dde7;
  box-shadow: 0 10px 24px rgba(16,40,74,.055);
}

/* ---------- DESKTOP ---------- */

@media (min-width: 1025px){
body.single-product .fa-pdp-gallery {
    position: sticky;
    top: 92px;
    align-self: flex-start;
  }

  body.single-product .fa-pdp-buybox {
    align-self: flex-start;
  }
}

/* ---------- TABLET ---------- */

@media (min-width: 768px) and (max-width: 1024px){
body.single-product .fa-pdp-title .product_title {
    font-size: 25px !important;
    line-height: 1.17 !important;
  }
}

/* ---------- MOBILE ---------- */

@media (max-width: 767px){
body.single-product .fa-pdp-shell {
    margin-inline: 0 !important;
  }

  body.single-product .fa-pdp-hero {
    display: flex !important;
    flex-direction: column !important;
  }

  body.single-product .fa-pdp-gallery,
  body.single-product .fa-pdp-buybox {
    width: 100% !important;
    position: relative;
    top: auto;
  }

  body.single-product .fa-pdp-gallery {
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(16,40,74,.045);
  }

body.single-product .fa-pdp-gallery-widget .woocommerce-product-gallery__image a {
    display: block !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
}

body.single-product .fa-pdp-gallery-widget .woocommerce-product-gallery__image img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto !important;
}

  body.single-product .fa-pdp-buybox {
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(16,40,74,.045);
  }

  body.single-product .fa-pdp-breadcrumbs,
  body.single-product .fa-pdp-breadcrumbs a {
    font-size: 10.5px;
  }

  body.single-product .fa-pdp-product-head {
    padding-bottom: 14px !important;
  }

  body.single-product .fa-pdp-title .product_title {
    font-size: 23px !important;
    line-height: 1.16 !important;
  }

  body.single-product .fa-pdp-short .woocommerce-product-details__short-description {
    font-size: 11.5px;
    line-height: 1.58;
  }

  body.single-product .fa-pdp-tabs-widget .wd-accordion-title {
    min-height: 54px;
    padding-block: 13px !important;
    font-size: 13px !important;
  }

  body.single-product .fa-pdp-tabs-widget .wd-accordion-content {
    font-size: 12px;
    line-height: 1.7;
  }

  body.single-product .fa-pdp-related-widget ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.single-product .fa-pdp-related-widget .product-title,
  body.single-product .fa-pdp-recent-widget .product-title {
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 390px){
  body.single-product .fa-pdp-title .product_title {
    font-size: 20px !important;
  }
}

/* Do not animate users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce){
body.single-product .fa-pdp-shell *,
  body.single-product .fa-pdp-section * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* =========================================================
   EMPTY DYNAMIC SECTIONS - FINAL FIX
   Hide dynamic WoodMart/Elementor wrappers on the real frontend
   only when they contain no real commerce content.
   Elementor editor placeholders remain visible for editing.
   ========================================================= */

body.single-product:not(.elementor-editor-active) .fa-pdp-section:empty {
  display: none !important;
}

/* Frequently Bought Together */
body.single-product:not(.elementor-editor-active) .fa-pdp-fbt:not(
  :has(
    .wd-fbt-product,
    .wd-fbt-products,
    .product,
    li.product,
    form,
    button,
    a[href] img,
    input[type="checkbox"]
  )
) {
  display: none !important;
}

/* Recently viewed */
body.single-product:not(.elementor-editor-active) .fa-pdp-recent:not(
  :has(
    .wd-product,
    .product-grid-item,
    li.product,
    .product-wrapper,
    a[href] img
  )
) {
  display: none !important;
}

body.single-product .fa-pdp-fbt:has(.wd-fbt-products:empty),
body.single-product .fa-pdp-fbt:not(:has(.wd-fbt-product, .product, li.product)) {
    display: none !important;
}

/* Related products */
body.single-product:not(.elementor-editor-active) .fa-pdp-related:not(
  :has(
    .wd-product,
    .product-grid-item,
    li.product,
    .product-wrapper,
    a[href] img
  )
) {
  display: none !important;
}
