/* Scoped storefront discovery and decision support. Focused checkout is excluded. */
.he-theme .he-cro-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.he-theme .he-cro-category-grid > li { min-width: 0; }
.he-theme .he-cro-category-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--he-line);
  border-radius: 14px;
  background: #fff;
}
.he-theme .he-cro-category-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: contain;
  background: var(--he-soft);
}
.he-theme .he-cro-category-card > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  color: var(--he-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.he-theme .he-cro-category-card .ph { flex: 0 0 auto; font-size: 19px; }
.he-theme .he-cro-category-card:hover { border-color: var(--he-red); }
.he-theme .he-cro-category-card:hover > span { color: var(--he-red-hover); }
.he-theme .he-cro-highlights .he-section-heading p {
  margin: 8px 0 0;
  color: var(--he-muted);
  font-size: 14px;
  line-height: 1.6;
}
.he-theme .he-cro-archive-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  clear: both;
  margin: 0 0 22px;
}
.he-theme .he-cro-archive-nav .he-pill { padding-inline: 16px; font-size: 13px; }
.he-theme .he-product-details h3,
body.he-theme.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  overflow-wrap: anywhere;
}
body.he-theme.single-product .he-cro-fit-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 5px;
  color: var(--he-red);
  font-size: 14px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}
body.he-theme.single-product .he-cro-order-help {
  margin: -8px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--he-line);
  border-radius: 12px;
  color: #4f5357;
  background: var(--he-soft);
  font-size: 14px;
  line-height: 1.7;
}
body.he-theme.single-product .he-cro-order-help p { margin: 0; }
body.he-theme.single-product .he-cro-order-help p + p { margin-top: 7px; }
body.he-theme.single-product .he-cro-order-help strong { color: var(--he-ink); }
body.he-theme.single-product .he-cro-order-help a {
  color: var(--he-red-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Reuse the existing preferences button in footer flow. Its dialog and consent
   logic stay untouched; it must not cover the fixed product purchase actions. */
body.he-theme:not(.he-checkout-focus) #homsef-cookie-reopen {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: fit-content;
  max-width: calc(100% - var(--he-sidebar-width) - 64px);
  min-height: 44px;
  margin: 0 32px 32px calc(var(--he-sidebar-width) + 32px);
  padding: 8px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #55595f;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Use the space already reserved after the product footer, then reserve the
   same space after this normal-flow control so fixed actions cannot cover it. */
body.he-theme.single-product #homsef-cookie-reopen {
  margin-top: calc(-120px - env(safe-area-inset-bottom));
  margin-bottom: calc(140px + env(safe-area-inset-bottom));
}
@media (min-width: 1440px) {
  body.he-theme:not(.he-checkout-focus) #homsef-cookie-reopen {
    margin-left: calc(var(--he-sidebar-width) + max(36px, (100vw - var(--he-sidebar-width) - 1560px) / 2));
  }
}
@media (min-width: 768px) and (max-width: 1100px) {
  body.he-theme:not(.he-checkout-focus) #homsef-cookie-reopen {
    margin-inline: calc(var(--he-sidebar-width) + 24px) 24px;
  }
}
@media (min-width: 768px) {
  body.he-theme.home .he-pills { flex-wrap: wrap; }
}
@media (max-width: 767px) {
  .he-theme .he-cro-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .he-theme .he-cro-category-card > span { min-height: 64px; padding: 10px 11px; font-size: 13px; }
  .he-theme .he-cro-category-card .ph { font-size: 17px; }
  .he-theme .he-cro-archive-nav { gap: 8px; margin-bottom: 18px; }
  .he-theme .he-cro-archive-nav .he-pill { padding: 9px 13px; font-size: 12px; }
  body.he-theme:not(.he-checkout-focus) #homsef-cookie-reopen {
    max-width: calc(100% - 32px);
    margin: calc(-72px - env(safe-area-inset-bottom)) 16px calc(92px + env(safe-area-inset-bottom));
  }
  body.he-theme.single-product #homsef-cookie-reopen {
    margin-top: calc(-170px - env(safe-area-inset-bottom));
    margin-bottom: calc(190px + env(safe-area-inset-bottom));
  }
  body.he-theme.home .he-page-heading {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 16px;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  body.he-theme.home .he-page-heading h1 { font-size: 27px; }
  body.he-theme.home .he-page-heading p { display: block; margin-top: 8px; font-size: 13px; }
}

/* Readable supplementary product buying details; native description and imagery stay above. */
body.he-theme.single-product .he-product-buying-guide { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--he-line); overflow-wrap: anywhere; }
body.he-theme.single-product .he-product-buying-guide h3 { margin: 26px 0 10px; color: var(--he-ink); font-size: 19px; line-height: 1.4; }
body.he-theme.single-product .he-product-buying-guide h4 { margin: 18px 0 6px; color: var(--he-ink); font-size: 16px; line-height: 1.5; }
body.he-theme.single-product .he-product-buying-guide p { margin: 0 0 14px; }
body.he-theme.single-product .he-product-buying-guide .he-pdp-fit-table { table-layout: fixed; }
body.he-theme.single-product .he-product-buying-guide .he-pdp-fit-table th { width: 35%; color: var(--he-ink); font-weight: 650; }

/* Diwali edit: existing Homsef identity and product photograph, no unapproved discount claims. */
.he-theme .he-diwali-hero { isolation: isolate; }
.he-theme .he-diwali-hero .he-hero-copy { max-width: 390px; padding-top: 30px; }
.he-theme .he-diwali-eyebrow { display: inline-block; margin-bottom: 14px; font-size: 11px; font-weight: 750; line-height: 1.4; }
.he-theme .he-diwali-hero h2 { margin-bottom: 14px; font-size: clamp(29px, 2.5vw, 38px); line-height: 1.12; text-wrap: balance; }
.he-theme .he-diwali-hero p { font-size: 14px; line-height: 1.6; text-wrap: pretty; }
.he-theme .he-diwali-diya { position: absolute; z-index: 1; top: 24px; right: 22px; width: 39px; height: 47px; color: #fff; pointer-events: none; }
.he-theme .he-diwali-hero .he-button { font-size: 12px; min-height: 44px; }
@media (max-width: 767px) {
  .he-theme .he-diwali-hero { min-height: 340px; background-position: right bottom; }
  .he-theme .he-diwali-hero .he-hero-copy { max-width: 90%; padding: 22px 18px; }
  .he-theme .he-diwali-eyebrow { margin-bottom: 12px; font-size: 10px; }
  .he-theme .he-diwali-hero h2 { font-size: clamp(27px, 7.2vw, 32px); margin-bottom: 12px; }
  .he-theme .he-diwali-hero p { font-size: 12px; margin-bottom: 16px; }
  .he-theme .he-diwali-diya { top: 19px; right: 17px; width: 28px; height: 34px; }
}

/* The sidebar becomes a drawer on tablets; footer controls follow content. */
@media (min-width: 768px) and (max-width: 1024px) {
  body.he-theme:not(.he-checkout-focus) #homsef-cookie-reopen { max-width: calc(100% - 48px); margin-left: 24px; margin-right: 24px; }
}

@media (min-width: 768px) and (max-width: 1024px) { body.he-theme.home .he-pills { flex-wrap: nowrap; } }
