/* HANWEN / Product detail only. Normal collections, blog pages and cart are untouched. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

theme-product-detail[data-section-type="main-product"] .hw-product-two-column {
  display: grid !important;
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  grid-template-areas:
    "media buy"
    "longform buy";
  align-items: start;
  gap: 32px clamp(26px, 3.2vw, 56px);
}
theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__media-group {
  grid-area: media;
  min-width: 0;
  width: 100% !important;
  max-width: 100%;
  flex: none !important;
  position: relative !important;
  top: auto !important;
}
theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__info {
  grid-area: buy;
  min-width: 0;
  width: 100% !important;
  max-width: 100%;
  flex: none !important;
  align-self: start;
  position: sticky !important;
  top: 86px !important;
  z-index: 2;
  max-height: calc(100vh - 105px);
  max-height: calc(100dvh - 105px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: clamp(14px, 1.75vw, 26px);
  border: 1px solid rgba(77, 61, 48, .12);
  border-radius: 12px;
  background: rgba(var(--color-background, var(--color-page-background)));
  scrollbar-width: thin;
}
theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__info::-webkit-scrollbar { width: 5px; }
theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__info::-webkit-scrollbar-thumb { background: rgba(76,59,46,.24); border-radius: 6px; }
theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .hw-product-longform {
  grid-area: longform;
  min-width: 0;
  max-width: 100%;
}
.hw-product-short-summary {
  color: rgba(var(--color-text), .66);
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
  overflow-wrap: anywhere;
}
.hw-product-longform {
  scroll-margin-top: 110px;
  border-top: 1px solid rgba(76,59,46,.12);
  padding-top: 0;
}
.hw-product-anchor-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 36px);
  padding: 0 2px;
  border-bottom: 1px solid rgba(76,59,46,.13);
  min-height: 55px;
  margin-bottom: 24px;
}
.hw-product-anchor-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  color: rgba(var(--color-text), .65);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.hw-product-anchor-nav a:hover,.hw-product-anchor-nav .hw-product-anchor-nav__active {
  color: rgba(var(--color-text));
  border-bottom-color: #49382c;
}
.hw-product-longform__heading {display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:20px;}
.hw-product-longform__heading h2 {margin:0;font-size:clamp(21px,2.1vw,28px);font-weight:500;line-height:1.4;}
.hw-product-longform__heading span {font-size:12px;color:rgba(var(--color-text), .55);white-space:nowrap;}
.hw-product-longform__body,.hw-product-longform__body > * { min-width: 0; max-width:100%; }
.hw-product-longform__body .product-description {width: 100% !important; padding: 0 !important; text-align: left; }
.hw-product-longform__body .product-description img,
.hw-product-longform__body .product-description video,
.hw-product-longform__body .product-description iframe {max-width:100%;height:auto;}
.hw-product-longform__body .product-description table { display:block; max-width:100%; overflow-x:auto; border-collapse:collapse; }
.hw-product-longform__body .product-description p {line-height:1.85;}
.hw-product-longform__body .product-description img {display:block;max-width:100%;margin:14px auto;}
.hw-product-mobile-buybar {display:none;}

@media (max-width: 959px) {
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px;
    align-items: stretch;
  }
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__media-group,
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__info,
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .hw-product-longform {
    width: 100% !important;
    min-width: 0;
    max-height:none;
    overflow:visible;
  }
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__media-group {order:0;}
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__info {
    order:1;
    position:static !important;
    top:auto !important;
    padding:0 0 16px;
    border:0;
    border-radius:0;
    background:transparent;
  }
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .hw-product-longform {
    order:2;
    margin-top:4px;
  }
  .hw-product-anchor-nav {min-height:50px;gap:24px;}
  .hw-product-anchor-nav a {min-height:48px;font-size:14px;}
  .hw-product-longform__heading span {font-size:11px;}
  .hw-product-mobile-buybar.is-visible {
    display:flex;
    align-items:center;
    gap:9px;
    position:fixed;
    left:0; right:0;
    bottom:0;
    z-index:60;
    padding:11px 14px calc(11px + env(safe-area-inset-bottom, 0px));
    border-top:1px solid rgba(72,56,45,.14);
    background:rgb(var(--color-background,var(--color-page-background)));
    box-shadow:0 -5px 24px rgba(0,0,0,.08);
  }
  .hw-product-mobile-buybar.is-visible button,.hw-product-mobile-buybar.is-visible a {
    display:flex;flex:1;min-height:43px;justify-content:center;align-items:center;
    padding:9px;font-size:14px;font-weight:600;text-align:center;text-decoration:none;
    border-radius:5px;box-sizing:border-box;
  }
  .hw-product-mobile-buybar__add {border:1px solid #352a22;background:#352a22;color:white;cursor:pointer;}
  .hw-product-mobile-buybar__contact {border:1px solid #352a22;color:#352a22;background:#fff;}
  .hw-product-mobile-buybar__add:disabled {opacity:.48;cursor:not-allowed;}
  body:has(.hw-product-mobile-buybar.is-visible) {padding-bottom:calc(68px + env(safe-area-inset-bottom, 0px));}
}
@media (min-width: 960px) and (max-height: 640px) {
  theme-product-detail[data-section-type="main-product"] .hw-product-two-column > .product-detail__info {top:18px !important;max-height:calc(100dvh - 36px);}
}
