/* Beauty Responsive & Interaction Polish v0.23
   Preview-only refinement shared by every Beauty QA surface.
   No launch-brand permission, Product Lock mutation, or production media. */

html[data-beauty-responsive-polish="v0.23"] {
  scroll-padding-top: calc(var(--pp-header-bottom, 72px) + 18px);
}

body.beauty-ui-qa-preview {
  --beauty-focus: var(--store-accent-strong, #71384B);
  --beauty-paper: var(--store-bg, #F7F1EC);
  --beauty-surface: var(--store-surface, #FFFDF9);
  --beauty-soft: var(--store-surface-soft, #EEE4DC);
  --beauty-ink: var(--store-ink, #241D1D);
  --beauty-muted: var(--store-muted, #746964);
  --beauty-line: var(--store-line, #D9CCC3);
}

/* Keyboard access: visible, consistent, and deliberately not browser-blue. */
.beauty-skip-link {
  position: fixed;
  z-index: 20000;
  top: 10px;
  left: 10px;
  transform: translateY(calc(-100% - 18px));
  padding: 11px 15px;
  border: 1px solid var(--beauty-ink);
  border-radius: 0;
  background: var(--beauty-surface);
  color: var(--beauty-ink);
  font: 700 .68rem/1.1 var(--store-body-font, "DM Sans", sans-serif);
  letter-spacing: .09em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 140ms ease;
}
.beauty-skip-link:focus { transform: translateY(0); }

body.beauty-ui-qa-preview :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--beauty-focus) !important;
  outline-offset: 3px !important;
}
body.beauty-ui-qa-preview :where(input, select, textarea):focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--beauty-focus) 12%, transparent) !important;
}

/* Header polish shared by Home, Catalog, PDP, Bag and secondary surfaces. */
body.beauty-ui-qa-preview .site-header .icon-btn {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}
body.beauty-ui-qa-preview .site-header .main-nav a,
body.beauty-ui-qa-preview .site-header .header-actions a,
body.beauty-ui-qa-preview .site-header .header-actions button {
  -webkit-tap-highlight-color: transparent;
}

/* Protect sticky/filter interactions from accidental horizontal bleed. */
body.beauty-ui-qa-preview {
  overflow-x: clip;
}
body.beauty-ui-qa-preview img,
body.beauty-ui-qa-preview video,
body.beauty-ui-qa-preview svg { max-width: 100%; }

/* Bring tiny QA/metadata copy up to a readable floor without turning it into content. */
body.beauty-ui-qa-preview .store-home-qa-banner,
body.beauty-ui-qa-preview .beauty-commerce-qa-banner,
body.beauty-ui-qa-preview .beauty-secondary-qa-banner,
body.beauty-ui-qa-preview.beauty-pdp-qa-preview > div:first-child {
  line-height: 1.35 !important;
}

@media (max-width: 900px) {
  body.beauty-ui-qa-preview:is(.pp-mobile-nav-open, .pp-mobile-search-open) {
    overflow: hidden;
  }

  /* beauty-editorial-sheet: replace the inherited PepPaws rounded popover with a quiet Beauty menu sheet. */
  body.beauty-ui-qa-preview .site-header .main-nav {
    top: var(--pp-header-bottom, 64px);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--pp-header-bottom, 64px));
    gap: 0;
    padding: 12px 20px 24px;
    border: 0;
    border-top: 1px solid var(--beauty-line);
    border-bottom: 1px solid var(--beauty-line);
    border-radius: 0;
    background: color-mix(in srgb, var(--beauty-surface) 98%, transparent);
    box-shadow: 0 26px 42px rgba(36, 29, 29, .10);
    transform: translateY(-6px);
    transform-origin: top center;
  }
  body.beauty-ui-qa-preview .site-header .main-nav.is-open {
    transform: translateY(0);
  }
  body.beauty-ui-qa-preview .site-header .main-nav a {
    min-height: 52px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--beauty-line) 78%, transparent);
    border-radius: 0;
    background: transparent !important;
    color: var(--beauty-ink);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
  }
  body.beauty-ui-qa-preview .site-header .main-nav a::after { display: none; }
  body.beauty-ui-qa-preview .site-header .main-nav a:hover,
  body.beauty-ui-qa-preview .site-header .main-nav a:focus-visible,
  body.beauty-ui-qa-preview .site-header .main-nav a.is-active {
    background: transparent !important;
    color: var(--beauty-focus);
  }
  body.beauty-ui-qa-preview .site-header .main-nav a.is-active::before {
    content: "";
    width: 22px;
    height: 1px;
    margin-right: 9px;
    background: currentColor;
  }

  body.beauty-ui-qa-preview .site-header .header-search,
  body.beauty-ui-qa-preview .site-header .header-search.is-mobile-open {
    margin: 0;
    padding: 8px 12px;
    border: solid var(--beauty-line);
    border-width: 1px 0 0;
    border-radius: 0;
    background: var(--beauty-surface);
    box-shadow: none;
  }
  body.beauty-ui-qa-preview .site-header .header-search input {
    min-height: 44px;
    font-size: 16px;
  }

  /* Sticky catalog controls need a touch target and visual separation from browser chrome. */
  body.beauty-catalog-qa-preview .shopify-catalog-mobile-actions > button,
  body.beauty-catalog-qa-preview .shopify-catalog-filter-panel button,
  body.beauty-catalog-qa-preview .shopify-catalog-filter-panel select,
  body.beauty-catalog-qa-preview .shopify-catalog-filter-panel input {
    min-height: 44px;
  }

  /* Secondary-page sticky nav: keep it readable and accessible while horizontally scrollable. */
  body.beauty-secondary-qa-preview .beauty-policy-nav {
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }
  body.beauty-secondary-qa-preview .beauty-policy-nav::-webkit-scrollbar { display: none; }
  body.beauty-secondary-qa-preview .beauty-policy-nav a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  body.beauty-ui-qa-preview .site-header .header-inner {
    width: calc(100% - 20px);
  }
  body.beauty-ui-qa-preview .site-header .brand {
    max-width: min(48vw, 190px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Avoid extra-small commercial copy on phone screens. */
  body.beauty-catalog-qa-preview .catalog-card__eyebrow,
  body.beauty-catalog-qa-preview .catalog-card__price-note,
  body.beauty-cart-qa-preview .cart-head__trust small,
  body.beauty-cart-qa-preview .cart-product__availability {
    font-size: .58rem;
  }
  body.beauty-catalog-qa-preview .catalog-card h3 { font-size: .82rem; }
  body.beauty-cart-qa-preview .cart-product__info h2 { font-size: .82rem; }

  /* Keep editorial titles dramatic without forcing awkward 2–3 character lines. */
  body.store-product-template-beauty .product-detail--beauty .product-info h1,
  body.beauty-cart-qa-preview .cart-head h1,
  body.beauty-secondary-qa-preview .beauty-secondary-title {
    text-wrap: balance;
  }
}

@media (max-width: 360px) {
  body.store-home-shell .store-home-hero h1 { font-size: 3.15rem; }
  body.store-home-shell .store-home-section h2,
  body.store-home-shell .store-home-editorial h2,
  body.store-home-shell .store-home-routine h2 { font-size: 2.62rem; }
  body.store-product-template-beauty .product-detail--beauty .product-info h1 { font-size: 2.55rem; }
  body.beauty-catalog-qa-preview .shopify-catalog-hero h1 { font-size: 2.82rem; }
  body.beauty-cart-qa-preview .cart-head h1 { font-size: 3rem; }
  body.beauty-secondary-qa-preview .beauty-secondary-title { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-beauty-responsive-polish="v0.23"] { scroll-behavior: auto; }
  body.beauty-ui-qa-preview *,
  body.beauty-ui-qa-preview *::before,
  body.beauty-ui-qa-preview *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
