/**
 * AYESH Design System — Phase 1 / v1.0.31
 * Theme-wide foundational polish with guarded selectors.
 * Keeps the reference-style Featured Categories cards, single-line product titles,
 * white/crimson loop Add to Cart controls, compact hero, and custom application forms.
 */

/* Shared reading hierarchy (avoids changing bespoke carousel/product headings). */
html body:not(.wp-admin) {
  color: var(--ayesh-color-text) !important;
  font-family: var(--ayesh-font-body) !important;
  font-size: var(--ayesh-text-base) !important;
  line-height: var(--ayesh-line-base) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html body:not(.wp-admin) :is(button, input, select, textarea) {
  font-family: var(--ayesh-font-body) !important;
}
html body:not(.wp-admin) :is(h1, h2, h3):not(.ayesh-featured-categories__title):not(.woocommerce-loop-product__title):not(#hb-home-heading) {
  font-family: var(--ayesh-font-heading) !important;
  font-weight: var(--ayesh-weight-medium) !important;
  line-height: var(--ayesh-line-tight) !important;
  letter-spacing: -0.015em !important;
}
html body:not(.wp-admin) h1:not(#hb-home-heading) { font-size: var(--ayesh-text-h1) !important; }
html body:not(.wp-admin) h2:not(.ayesh-featured-categories__title):not(.woocommerce-loop-product__title) { font-size: var(--ayesh-text-h2) !important; }
html body:not(.wp-admin) h3:not(.woocommerce-loop-product__title) { font-size: var(--ayesh-text-h3) !important; }
html body:not(.wp-admin) :is(h4,h5,h6):not(.woocommerce-loop-product__title) {
  font-family: var(--ayesh-font-body) !important;
  font-size: var(--ayesh-text-base) !important;
  font-weight: var(--ayesh-weight-medium) !important;
  line-height: 1.45 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
/* Footer headings and compact category carousel are established exceptions. */
html body:not(.wp-admin) .hb-footer :is(h2,h3,h4) {
  font-size: var(--ayesh-text-xs) !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}
html body:not(.wp-admin) :lang(bn) { letter-spacing: normal !important; }
html body:not(.wp-admin) :is(.hb-content,.hb-policy-page,.entry-content,.hb-blog-article__content) :is(p,li) {
  color: var(--ayesh-color-text-muted);
  font-size: var(--ayesh-text-base) !important;
  line-height: var(--ayesh-line-relaxed) !important;
}
html body:not(.wp-admin) :is(.hb-content,.hb-policy-page,.entry-content,.hb-blog-article__content) :is(h2,h3) {
  margin-block: var(--ayesh-space-6) var(--ayesh-space-3);
}
html body:not(.wp-admin) ::selection { background: var(--ayesh-color-selection); color: var(--ayesh-color-secondary); }

/* Consistent interactions with visible keyboard focus, retaining existing shapes. */
html body:not(.wp-admin) :is(a,button,summary,input,textarea,select,[role="button"]):focus-visible {
  outline: var(--ayesh-focus-outline) !important;
  outline-offset: 3px;
}
html body:not(.wp-admin) :is(input[type="checkbox"],input[type="radio"]) { accent-color: var(--ayesh-color-primary); }
html body:not(.wp-admin) a:not(.button):not(.hb-button):hover { color: var(--ayesh-color-primary); }
html body:not(.wp-admin) :is(.hb-button,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.woocommerce #respond input#submit,.hbma-btn,.hb-b2b-btn,.hb-careers-btn,.hb-login-submit) {
  font-family: var(--ayesh-font-body) !important;
  font-weight: var(--ayesh-weight-medium) !important;
  transition: background-color var(--ayesh-motion-fast) ease, border-color var(--ayesh-motion-fast) ease, color var(--ayesh-motion-fast) ease;
}
/* Match shared CTA touch target while respecting compact hero and card sizes. */
html body:not(.wp-admin) :is(.hb-button,.hb-b2b-btn,.hb-careers-btn,.hb-login-submit) {
  min-height: var(--ayesh-button-height);
}

/* WooCommerce: consistent card surface without changing product/price behavior. */
html body:not(.wp-admin) :is(.woocommerce ul.products li.product,.hb-products > .product) {
  border-color: var(--ayesh-color-border);
  background-color: var(--ayesh-color-surface);
}
html body:not(.wp-admin) :is(.woocommerce ul.products li.product,.hb-products > .product) :is(.woocommerce-loop-product__title,.price) {
  font-family: var(--ayesh-font-price) !important;
}
html body:not(.wp-admin) :is(.woocommerce,.woocommerce-page) :is(.woocommerce-breadcrumb,.woocommerce-result-count,.woocommerce-ordering) {
  color: var(--ayesh-color-text-muted);
  font-size: var(--ayesh-text-sm);
}
html body:not(.wp-admin) .woocommerce :is(.woocommerce-message,.woocommerce-info,.woocommerce-error) {
  border-top-color: var(--ayesh-color-primary);
}
html body:not(.wp-admin) .woocommerce :is(.woocommerce-message,.woocommerce-info,.woocommerce-error)::before {
  color: var(--ayesh-color-primary);
}
html body:not(.wp-admin) .woocommerce :is(.cart_totals,.woocommerce-checkout-review-order,.woocommerce-MyAccount-content) {
  color: var(--ayesh-color-text);
}

/* Unified field focus/borders, not applied to search icon and quantity +/- controls. */
html body:not(.wp-admin) :is(.woocommerce,.woocommerce-page,.hb-content,.hb-b2b,.hbma-shell,.hb-careers,.hb-policy-page)
  :is(input.input-text, input[type="email"], input[type="tel"], input[type="text"], input[type="password"], select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  border-color: var(--ayesh-color-border-strong);
  color: var(--ayesh-color-text);
  background-color: var(--ayesh-color-surface);
}
html body:not(.wp-admin) :is(.woocommerce,.woocommerce-page,.hb-content,.hb-b2b,.hbma-shell,.hb-careers,.hb-policy-page)
  :is(input.input-text, input[type="email"], input[type="tel"], input[type="text"], input[type="password"], select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus-visible {
  border-color: var(--ayesh-color-primary) !important;
  box-shadow: 0 0 0 3px rgb(201 21 36 / 12%);
}


@layer ayesh-priority-product-loop {
/* Honor v1.0.15 product-loop CTA decision even against earlier deeply nested
 * v1.37 inherited WooCommerce selectors. No checkout/single-product change.
 * Isolated named cascade layer outranks legacy unlayered !important declarations
 * from the inherited palette, whose :is() group has ID-level specificity. */
html body:not(.wp-admin) .woocommerce ul.products li.product.product.product.product > :is(a.button,a.add_to_cart_button,a.ajax_add_to_cart,a.added_to_cart),
html body:not(.wp-admin) .hb-products > .product.product.product.product > :is(a.button,a.add_to_cart_button,a.ajax_add_to_cart,a.added_to_cart) {
  background-color: var(--ayesh-color-white) !important;
  background-image: none !important;
  border-color: var(--ayesh-color-primary) !important;
  color: var(--ayesh-color-primary) !important;
  -webkit-text-fill-color: var(--ayesh-color-primary) !important;
}
html body:not(.wp-admin) .woocommerce ul.products li.product.product.product.product > :is(a.button,a.add_to_cart_button,a.ajax_add_to_cart,a.added_to_cart):is(:hover,:focus-visible),
html body:not(.wp-admin) .hb-products > .product.product.product.product > :is(a.button,a.add_to_cart_button,a.ajax_add_to_cart,a.added_to_cart):is(:hover,:focus-visible) {
  background-color: var(--ayesh-color-primary) !important;
  border-color: var(--ayesh-color-primary) !important;
  color: var(--ayesh-color-white) !important;
  -webkit-text-fill-color: var(--ayesh-color-white) !important;
}
html body:not(.wp-admin) .woocommerce ul.products li.product.product.product.product > :is(a.button,a.add_to_cart_button,a.ajax_add_to_cart,a.added_to_cart):active,
html body:not(.wp-admin) .hb-products > .product.product.product.product > :is(a.button,a.add_to_cart_button,a.ajax_add_to_cart,a.added_to_cart):active {
  background-color: var(--ayesh-color-primary-active) !important;
  border-color: var(--ayesh-color-primary-active) !important;
  color: var(--ayesh-color-white) !important;
  -webkit-text-fill-color: var(--ayesh-color-white) !important;
}

}

/* Neutral surfaces and borders on informational pages. */
html body:not(.wp-admin) :is(.hb-contact-card,.hb-policy-note,.hb-faq-item,.hbma-card) {
  border-color: var(--ayesh-color-border);
}
html body:not(.wp-admin) .hb-policy-note { background: var(--ayesh-color-surface-soft); border-left-color: var(--ayesh-color-primary); }
html body:not(.wp-admin) .hb-footer { border-top-color: var(--ayesh-color-border); }

@media (max-width: 760px) {
  html body:not(.wp-admin) :is(.hb-content,.hb-policy-page,.entry-content,.hb-blog-article__content) :is(p,li) {
    font-size: var(--ayesh-text-base) !important;
  }
  html body:not(.wp-admin) :is(.hb-content,.hb-policy-page,.entry-content,.hb-blog-article__content) :is(h2,h3) {
    margin-block: var(--ayesh-space-5) var(--ayesh-space-2);
  }
}
@media (prefers-reduced-motion: reduce) {
  html body:not(.wp-admin) :is(.hb-button,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.hbma-btn,.hb-b2b-btn,.hb-careers-btn,.hb-login-submit) {
    transition: none !important;
  }
}
