/* Front-end responsive refinements; the finalized >= 1440px layout is untouched. */

/* Explicit product typography adjustment at every viewport. */
.single-product .product-thermal strong {
  font-size: 12px;
}

/* User-requested product contact addition; all existing component rules stay unchanged. */
.single-product .product-purchase__contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.single-product .product-purchase__contacts a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: 10px 8px;
  border: 1px solid #000;
  border-radius: 2px;
  background: #000;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.single-product .product-purchase__contacts a:hover {
  background: #292929;
}

.single-product .product-purchase__contacts a:active {
  background: #444;
}

.single-product .product-purchase__contacts a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

@media (min-width: 901px) and (max-width: 1439px) {
  .home-rebuild .home-rebuild__hero-copy :is(h1, h2) {
    font-size: clamp(64px, 6vw, 86px);
  }

  .home-rebuild .home-rebuild__hero-copy {
    top: clamp(92px, 10vw, 146px);
  }
}

@media (max-width: 1024px) {
  .site-footer .site-footer__grid {
    gap: clamp(52px, 8vw, 82px);
  }

  .affiliate-page .affiliate-benefit,
  .delivery-page .delivery-card,
  .member-mall-page .member-mall-task,
  .member-mall-page .member-mall-product,
  .member-mall-page .member-mall-reward {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  /* Keep the existing mobile navigation and enlarge only its touch targets. */
  .site-header .site-header__promo-arrow,
  .site-header .menu-toggle,
  .site-header .site-header__cart,
  .site-header .site-header__search button {
    min-width: 44px;
    min-height: 44px;
  }

  .site-header .site-header__cart {
    width: 44px;
    height: 44px;
  }

  .site-header .site-header__cart img {
    width: 32px;
    height: 32px;
    margin: 6px;
  }

  .site-header .site-header__main {
    gap: 8px;
  }

  .site-header .site-header__search {
    order: 2;
    flex: 0 1 120px;
    margin-left: 0;
  }

  .site-header .site-header__cart {
    order: 2;
    flex: 0 0 44px;
  }

  .site-header .menu-toggle {
    display: inline-flex;
    order: 1;
    flex: 0 0 44px;
  }

  .home-rebuild .home-rebuild__hero-copy :is(h1, h2) {
    font-size: clamp(36px, 6.25vw, 56px);
  }

  /* Remove legacy fixed whitespace while preserving both horizontal product rails. */
  .home-rebuild .home-rebuild__arrivals {
    min-height: 0;
    padding-top: clamp(64px, 9vw, 82px);
    padding-bottom: clamp(72px, 10vw, 92px);
  }

  .home-rebuild .home-arrivals-header {
    min-height: 126px;
  }

  .single-product .product-mobile-bar {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .single-product .shd-offer-launcher {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 481px) and (max-width: 900px) {
  /* A full-width square dominates a tablet screen; cap only its gallery wrapper. */
  .single-product .product-page__gallery {
    width: min(72vw, 620px);
    margin-inline: auto;
  }

  .single-product .product-page__purchase {
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .home-rebuild .home-rebuild__arrival-card,
  .home-rebuild .home-best__card {
    flex-basis: min(58vw, 430px);
  }
}

@media (max-width: 768px) {
  /* These layouts become cramped just above their former 760px cut-off. */
  body .contact-page .contact-page__inner {
    width: calc(100% - 36px);
    padding-bottom: 52px;
  }

  body .contact-page .contact-page__top,
  body .contact-page .contact-page__faq {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
  }

  body .contact-page .contact-page__top::before {
    display: none;
  }

  body .contact-page .contact-page__form-panel {
    padding-right: 0;
  }

  body .contact-page .contact-page__details {
    border-top: 1px solid #d1d1d1;
    padding: 27px 0 48px;
  }

  body .member-mall-page .member-mall-page__inner {
    width: calc(100% - 24px);
  }

  body .member-mall-page .member-mall-layout,
  body .member-mall-page .member-mall-spin-card,
  body .member-mall-page .member-mall-task-grid,
  body .member-mall-page .member-mall-product-grid,
  body .member-mall-page .member-mall-reward-grid,
  body .member-mall-page .member-mall-referral {
    grid-template-columns: minmax(0, 1fr);
  }

  body .member-mall-page .member-mall-sidebar {
    order: -1;
  }

  body .member-mall-page .member-mall-spin-card {
    gap: 22px;
  }

  body .member-mall-page .member-mall-product {
    min-height: 235px;
  }

  body.checkout-route .checkout-shell {
    display: flex;
    width: 100%;
    flex-direction: column;
  }

  body.checkout-route .checkout-summary {
    order: -1;
    padding: 20px 18px 16px;
    border: 0;
    border-bottom: 1px solid #ddd;
  }

  body.checkout-route .checkout-main {
    padding: 27px 18px 45px;
  }

  body.checkout-route .checkout-summary__items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  body.checkout-route .checkout-summary__item {
    margin-bottom: 0;
  }

  body.checkout-route .checkout-summary__totals {
    max-width: 360px;
    margin-left: auto;
  }

  body .shd-customizer .shd-customizer__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body .shd-customizer .shd-customizer__preview {
    position: static;
  }

}

@media (max-width: 480px) {
  .site-header .site-header__main {
    width: calc(100% - 20px);
  }

  .site-header .site-header__search {
    width: clamp(104px, 31vw, 120px);
  }

  .site-header .site-logo img {
    width: clamp(78px, 23vw, 88px);
  }

  .home-rebuild .home-rebuild__hero {
    height: clamp(480px, 126vw, 570px);
  }

  .home-rebuild .home-rebuild__hero-copy {
    right: 0;
  }

  .home-rebuild .home-rebuild__hero-copy p {
    width: 100%;
    max-width: calc(100vw - 44px);
    font-size: clamp(15px, 4.2vw, 18px);
    overflow-wrap: anywhere;
  }

  .shop-archive .shop-catalog__header h2 {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .shop-colors--customize .shop-colors__banner-copy {
    right: 18px;
  }

  .shd-offer-launcher .shd-offer-launcher__open {
    min-height: 44px;
    padding: 10px 16px;
  }

  .home-rebuild .home-rebuild__arrival-card,
  .home-rebuild .home-best__card {
    flex-basis: 82vw;
  }

  /* Keep long hero titles readable and monotonic from 480px down to 320px. */
  body :is(
    .about-hero__copy h1,
    .affiliate-hero h1,
    .contact-page__hero-copy h1,
    .faq-page__hero-copy h1,
    .sd-hero h1,
    .member-mall-banner__copy h1,
    .single-post .blog-article__hero h2
  ) {
    max-width: 100%;
    font-size: clamp(32px, 7.5vw, 36px);
    overflow-wrap: normal;
  }

  .single-product .product-page__gallery {
    width: 100%;
  }

  .single-product .product-purchase__actions {
    grid-template-columns: minmax(88px, 28%) minmax(0, 1fr);
  }

  .single-product .product-recommendation {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  .single-product .product-recommendation > img {
    width: 58px;
    height: 58px;
  }

  body.checkout-route .checkout-express__buttons,
  body.checkout-route .checkout-grid,
  body.checkout-route .checkout-grid--three {
    grid-template-columns: minmax(0, 1fr);
  }

  body.checkout-route .checkout-grid--three .checkout-field:last-child {
    grid-column: auto;
  }

  .reviews-write-modal,
  .member-mall-modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  .reviews-write-modal {
    padding: 22px 16px;
  }
}

@media (max-width: 375px) {
  .site-header .site-header__main {
    gap: 4px;
  }

  .site-header .site-header__search {
    width: 102px;
  }

  .site-header .site-header__search input {
    padding-inline: 8px;
  }

  .site-header .site-logo img {
    width: 78px;
  }

  .site-footer .site-footer__columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px 14px;
  }

  .single-product .product-mobile-bar {
    gap: 8px;
    padding-inline: 10px;
  }

  .single-product .product-mobile-bar strong {
    font-size: 14px;
  }

  body.checkout-route .checkout-summary__items {
    display: block;
  }

  body.checkout-route .checkout-summary__item {
    margin-bottom: 13px;
  }
}

.site-mobile-footer {
  display: none;
}

.site-nav__mobile-links {
  display: none;
}

.site-header__search-toggle,
.site-mobile-menu {
  display: none;
}

@media (max-width: 767px) {
  .site-header--mobile-controls .site-header__search-toggle {
    position: relative;
    display: grid;
    place-items: center;
    order: 1;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
  }

  .site-header__search-toggle img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0);
  }

  .site-header__search-toggle > span {
    position: relative;
    width: 16px;
    height: 16px;
    margin: -4px 4px 0 0;
    border: 1.5px solid currentColor;
    border-radius: 50%;
  }

  .site-header__search-toggle > span::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 8px;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
  }

  .site-header--mobile-controls .menu-toggle {
    order: 3;
    justify-content: center;
    align-items: center;
    font-size: 24px;
  }

  .site-header--mobile-controls .site-header__search {
    display: none;
  }

  .site-header--mobile-controls .site-header__search.is-open {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    z-index: 41;
    display: flex;
    width: auto;
    height: 48px;
    margin: 0;
    background: #fff;
    box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
  }

  .site-header--mobile-controls .site-header__search input {
    font-size: 16px;
  }

  body.site-mobile-menu-open {
    overflow: hidden;
  }

  .site-mobile-menu[open] {
    position: fixed;
    inset: var(--mobile-menu-top, 0px) 0 0 auto;
    display: flex;
    flex-direction: column;
    width: min(100%, 420px);
    max-width: 100%;
    height: calc(100dvh - var(--mobile-menu-top, 0px));
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    color: #111;
    overflow: hidden;
    animation: site-mobile-menu-enter 220ms ease-out;
  }

  .site-mobile-menu::backdrop {
    background: rgb(0 0 0 / 35%);
  }

  .site-mobile-menu__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    padding: 0 18px;
  }

  .site-mobile-menu__logo img {
    display: block;
    width: 88px;
    height: auto;
  }

  .site-mobile-menu [data-nav-close] {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: 32px/1 sans-serif;
    cursor: pointer;
  }

  .site-header__search-toggle:hover,
  .site-mobile-menu [data-nav-close]:hover {
    background: #f5f5f5;
  }

  .site-header__search-toggle:active,
  .site-mobile-menu [data-nav-close]:active {
    background: #eee;
  }

  .site-header__search-toggle:focus-visible,
  .site-mobile-menu :is(a, button):focus-visible {
    outline: 2px solid var(--sidagar-pink);
    outline-offset: -3px;
  }

  .site-mobile-menu #primaryNav {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-height: none;
    padding: 0 18px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-mobile-menu #primaryNav > ul {
    align-items: stretch;
    gap: 0;
    padding: 0 0 20px;
  }

  .site-mobile-menu #primaryNav > ul > li {
    justify-content: space-between;
  }

  .site-mobile-menu #primaryNav > ul > li > a {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-height: 48px;
    padding-block: 10px;
    font-size: 16px;
    font-weight: 400;
  }

  .site-mobile-menu #primaryNav .shd-shop-toggle {
    width: 44px;
    height: 44px;
  }

  .site-mobile-menu #primaryNav .shd-shop-mega {
    max-height: none;
    overflow: visible;
    padding: 16px 0;
  }

  .site-mobile-menu .site-nav__mobile-group {
    text-align: left;
  }

  .site-mobile-menu #primaryNav .site-nav__mobile-links a {
    justify-content: flex-start;
    padding-inline: 0;
  }

  @keyframes site-mobile-menu-enter {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }

  @media (prefers-reduced-motion: reduce) {
    .site-mobile-menu[open] { animation: none; }
  }

  /* Keep long menus reachable above the existing fixed purchase/footer controls. */
  #primaryNav {
    max-height: calc(100vh - 300px);
    max-height: min(65svh, calc(100svh - 300px - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
  }

  .site-nav__mobile-links {
    display: block;
    padding-bottom: 16px;
  }

  .site-nav__mobile-group {
    padding-top: 16px;
    border-top: 1px solid #eee;
    text-align: center;
  }

  .site-nav__mobile-group h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
  }

  .site-nav .site-nav__mobile-group ul {
    display: block;
    margin: 0;
    padding: 8px 0 16px;
  }

  .site-nav .site-nav__mobile-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .site-nav__mobile-links a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
  }

  /* Only image-led page banners; product purchase areas and section images stay intact. */
  body :is(.home-rebuild__hero, .shop-colors__banner, .about-hero, .affiliate-hero, .contact-page__hero, .faq-page__hero, .blog-page__hero, .single-post .blog-article__hero, .sd-hero, .member-mall-banner, .archive-banner, .account-dashboard-hero) {
    height: 230px;
    min-height: 230px;
  }

  body :is(.about-hero__copy, .affiliate-hero__copy, .contact-page__hero-copy, .faq-page__hero-copy, .blog-page__hero-copy, .single-post .blog-article__hero-inner, .sd-hero__copy, .member-mall-banner__copy, .shop-colors__banner-copy) {
    right: 18px;
    bottom: 20px;
    left: 18px;
    width: auto;
    padding: 0;
  }

  body :is(.about-hero, .affiliate-hero, .contact-page__hero, .faq-page__hero, .blog-page__hero, .single-post .blog-article__hero, .sd-hero, .member-mall-banner, .shop-colors__banner) :is(h1, h2) {
    max-width: 100%;
    margin-bottom: 8px;
    font-size: clamp(24px, 6.5vw, 32px);
    line-height: 1.08;
  }

  body :is(.about-hero__copy, .affiliate-hero__copy, .contact-page__hero-copy, .faq-page__hero-copy, .blog-page__hero-copy, .blog-article__hero-inner, .sd-hero__copy, .member-mall-banner__copy) > p:first-child {
    margin-bottom: 8px;
  }

  .home-rebuild .home-rebuild__hero-copy {
    top: 16px;
    right: 0;
  }

  .home-rebuild .home-rebuild__hero-copy :is(h1, h2) {
    margin-bottom: 8px;
    font-size: clamp(24px, 6.5vw, 36px);
  }

  .home-rebuild .home-rebuild__hero-copy p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.3;
  }

  .home-rebuild .home-rebuild__hero-copy .home-button {
    min-height: 44px;
    padding: 10px 14px;
    line-height: 1.2;
  }

  .home-rebuild .home-rebuild__hero-dots {
    bottom: 8px;
  }

  body .account-dashboard-hero > div {
    min-height: 0;
    padding: 18px;
  }

  body .account-dashboard-hero h2 {
    font-size: 24px;
    line-height: 1.1;
  }

  body .account-dashboard-hero p {
    margin-bottom: 16px;
    font-size: 14px;
  }

  .site-footer {
    display: none;
  }

  .site-mobile-footer {
    --mobile-footer-gold: #b78d4b;
    display: block;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .site-mobile-footer__nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    box-sizing: border-box;
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    border-top: 1px solid #eee;
    background: #fff;
  }

  .site-mobile-footer__nav a {
    display: flex;
    min-width: 0;
    min-height: 63px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #111;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
  }

  .site-mobile-footer__nav a:hover,
  .site-mobile-footer__nav a:active,
  .site-mobile-footer__nav a:focus-visible {
    color: var(--mobile-footer-gold);
  }

  .site-mobile-footer__nav a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
  }

  .site-mobile-footer .xhl-icon {
    color: #d62070;
    font-family: "XHL IcoMoon";
    font-size: 20px;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
  }

  /* Keep the existing purchase controls and offer launcher above the new bar. */
  .single-product .product-mobile-bar {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 10px;
  }

  .single-product .site-mobile-footer {
    height: calc(127px + env(safe-area-inset-bottom, 0px));
  }

  body .shd-offer-launcher {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .single-product .shd-offer-launcher {
    bottom: calc(143px + env(safe-area-inset-bottom, 0px));
  }
}
