/* Integration-ready proposal — deployment/render QA pending.
 * Native WooCommerce product/shop styling, activated only where both existing
 * AJH header/footer IDs are rendered. All class selectors below are existing
 * WooCommerce/Solace system classes; no classes, markup, content or settings are added.
 * Colors/fonts follow editable Elementor globals. Verify against the deployed
 * Solace markup and responsive catalog/product views before enabling.
 */

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) {
  --ajh-commerce-surface: var(--e-global-color-ajh-ivory, #FFF8F2);
  --ajh-commerce-ink: var(--e-global-color-ajh-espresso, #392A24);
  --ajh-commerce-muted: var(--e-global-color-ajh-brown, #745845);
  --ajh-commerce-line: var(--e-global-color-ajh-taupe, #C2A893);
  --ajh-commerce-accent: var(--e-global-color-ajh-peach, #F6DDC7);
  --ajh-commerce-body: var(--e-global-typography-ajh-body-font-family, "DM Sans"), sans-serif;
  --ajh-commerce-display: var(--e-global-typography-ajh-section-font-family, "Cormorant Garamond"), serif;
  background-color: var(--ajh-commerce-surface);
  color: var(--ajh-commerce-ink);
}

/* Solace's confirmed page shell can otherwise retain its gray theme surface. */
body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) > .wrapper {
  background-color: var(--ajh-commerce-surface);
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) {
  background-color: var(--ajh-commerce-surface);
  color: var(--ajh-commerce-ink);
  font-family: var(--ajh-commerce-body);
  font-size: var(--e-global-typography-ajh-body-font-size, 1rem);
  line-height: var(--e-global-typography-ajh-body-line-height, 1.7);
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(h1.product_title, h1.woocommerce-products-header__title) {
  max-inline-size: 24ch;
  margin-block: 0 1.5rem;
  color: var(--ajh-commerce-ink);
  font-family: var(--ajh-commerce-display);
  font-size: clamp(2.5rem, 4vw, var(--e-global-typography-ajh-section-font-size, 3.75rem));
  font-weight: var(--e-global-typography-ajh-section-font-weight, 400);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-transform: none;
  overflow-wrap: anywhere;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(h2, h3) {
  color: var(--ajh-commerce-ink);
  font-family: var(--ajh-commerce-display);
  font-size: clamp(1.75rem, 2.5vw, var(--e-global-typography-ajh-card-font-size, 2.5rem));
  font-weight: var(--e-global-typography-ajh-card-font-weight, 400);
  line-height: 1.2;
  text-transform: none;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) a {
  color: var(--ajh-commerce-ink);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.0625rem;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) a:hover {
  color: var(--ajh-commerce-muted);
}

/* Text actions get real touch targets; image/product-card anchors retain layout. */
body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) a:where(:not(:has(img)):not(.woocommerce-LoopProduct-link):not(.woocommerce-loop-product__link)) {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  min-inline-size: 2.75rem;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :focus-visible {
  outline: 0.1875rem solid var(--ajh-commerce-ink);
  outline-offset: 0.25rem;
  box-shadow: 0 0 0 0.4375rem var(--ajh-commerce-surface);
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(button, [role="button"], input[type="submit"], input[type="button"], select, input[type="number"], input[type="search"]) {
  min-block-size: 2.75rem;
  min-inline-size: 2.75rem;
  max-inline-size: 100%;
  box-sizing: border-box;
  font-family: var(--ajh-commerce-body);
  font-size: 1rem;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(a.button, button.button, button[type="submit"], input[type="submit"], a.added_to_cart) {
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border: 0.0625rem solid var(--ajh-commerce-ink);
  border-radius: 0;
  background: var(--ajh-commerce-ink);
  color: var(--ajh-commerce-surface);
  font-weight: var(--e-global-typography-ajh-label-font-weight, 500);
  line-height: 1.4;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(a.button, button.button, button[type="submit"], input[type="submit"], a.added_to_cart):hover {
  background: var(--ajh-commerce-muted);
  border-color: var(--ajh-commerce-muted);
  color: var(--ajh-commerce-surface);
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(button, input):disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(select, input[type="number"], input[type="search"]) {
  border: 0.0625rem solid var(--ajh-commerce-line);
  border-radius: 0;
  background-color: var(--ajh-commerce-surface);
  color: var(--ajh-commerce-ink);
  padding: 0.65rem 0.8rem;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .woocommerce-breadcrumb {
  margin-block-end: 1.5rem;
  color: var(--ajh-commerce-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(.price, .price ins) {
  color: var(--ajh-commerce-ink);
  font-family: var(--ajh-commerce-body);
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 500;
  text-decoration: none;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .summary > .price {
  margin-block: 0 1.5rem;
  font-size: 1.5rem;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(.woocommerce-product-details__short-description, .product_meta, .stock) {
  color: var(--ajh-commerce-ink);
  font-family: var(--ajh-commerce-body);
  overflow-wrap: anywhere;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .product_meta {
  margin-block-start: 1.75rem;
  padding-block-start: 1rem;
  border-block-start: 0.0625rem solid var(--ajh-commerce-line);
  font-size: 0.875rem;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .stock.out-of-stock {
  color: var(--ajh-commerce-muted);
  font-weight: 600;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .woocommerce-product-gallery img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  border-radius: 0;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3rem 1.5rem;
  margin: 2rem 0 3rem;
  padding: 0;
  list-style: none;
}

/* WooCommerce's float-clearing pseudo-elements must not become grid items. */
body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products::before,
body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products::after {
  display: none;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products li.product {
  float: none;
  clear: none;
  inline-size: auto;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  color: var(--ajh-commerce-ink);
  background: transparent;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products .woocommerce-loop-product__title {
  display: block;
  margin-block: 1rem 0.75rem;
  font-size: clamp(1.6rem, 2.1vw, var(--e-global-typography-ajh-card-font-size, 2.1rem));
  overflow-wrap: anywhere;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .woocommerce-tabs ul.tabs li {
  border-color: var(--ajh-commerce-line);
  border-radius: 0;
  background: transparent;
}

body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .woocommerce-tabs ul.tabs li.active {
  background: var(--ajh-commerce-accent);
}

@media (max-width: 64rem) {
  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 47.9375rem) {
  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) :is(h1.product_title, h1.woocommerce-products-header__title) {
    font-size: clamp(2.25rem, 8.5vw, var(--e-global-typography-ajh-section-font-size, 3rem));
    margin-block-end: 1.25rem;
  }

  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) div.product :is(.woocommerce-product-gallery, .summary) {
    float: none;
    inline-size: 100%;
    min-inline-size: 0;
    margin-inline: 0;
  }

  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) .woocommerce-product-gallery {
    margin-block-end: 2rem;
  }

  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) ul.products {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container),
  body.woocommerce:has(#ajh-draft-header):has(#ajh-draft-footer) :is(main, #content, .shop-container) * {
    scroll-behavior: auto;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
