/* ============================================================
   P Cosmetics — consolidated sticky header
   Three rows: promo bar / main (logo · search · tools) / nav.
   Self-contained: the landing page does not load brands.css, so
   this file must not depend on it. Tokens are namespaced --pch-*.
   ============================================================ */
:root {
  --pch-ink:      #1d1a16;
  --pch-cream:    #faf7f1;
  --pch-line:     rgba(29, 26, 22, .12);
  --pch-muted:    #6f6553;
  /* #e63950 measured only 3.88:1 on the cream header — darkened to clear
     WCAG AA (4.51:1 on cream, 4.82:1 on white). Same hue. */
  --pch-accent:   #df1c36;
  --pch-blue:     #0878a7;
  --pch-promo-h:  36px;
  --pch-main-h:   96px;   /* holds the 80px mark with breathing room */
  --pch-nav-h:    48px;
  --pch-font:     "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

.pch, .pch * { box-sizing: border-box; }
.pch {
  position: sticky; top: 0; z-index: 200;
  font-family: var(--pch-font);
  background: var(--pch-cream);
  border-bottom: 1px solid var(--pch-line);
  max-width: 100vw;
}
.pch__in { max-width: 1440px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ---------- brand tinting ----------
   Brand pages carry data-brand on <body> and brand-tokens.css supplies the two
   values below. Only the surface and the accent change: the rows, heights,
   type and structure are identical everywhere, so this reads as the same
   header wearing the brand's colour rather than a different header.
   Pages without data-brand (home, shop, cart) keep the cream default.
   --pch-muted is darkened once here because #6f6553 drops to 3.85:1 on the
   Vebix plate, the deepest of the seven surfaces. */
body[data-brand] .pch {
  --pch-cream:  var(--pch-brand-surface, #faf7f1);
  --pch-accent: var(--pch-brand-deep, #df1c36);
  --pch-blue:   var(--pch-brand-deep, #0878a7);
  --pch-muted:  #635a4a;
  --pch-line:   rgba(29, 26, 22, .16);
}

/* ---------- row 1: promo ---------- */
.pch__promo {
  height: var(--pch-promo-h); background: var(--pch-ink); color: #f3efe6;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.pch__promo p {
  margin: 0; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
}
.pch__promo b { color: #f0c078; font-weight: 600; }

/* ---------- row 2: main ---------- */
.pch__main {
  height: var(--pch-main-h); display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem);
}
.pch__brand { flex: none; display: flex; align-items: center; }
/* The mark is 900x529 (1.70:1). The old 140x40 box was 3.5:1, so `contain`
   letterboxed it to 68x40 and half the box was empty. Box now matches the
   artwork's aspect, so the height IS the rendered height: 80px is 2x the
   68x40 that used to render. */
.pch__brand img { width: 136px; height: 80px; object-fit: contain; display: block; }

.pch__search { flex: 1 1 auto; min-width: 0; position: relative; }
.pch__search form { display: flex; align-items: center; }
.pch__search input {
  width: 100%; height: 42px; padding: 0 2.6rem 0 2.4rem;
  border: 1px solid var(--pch-line); border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6553' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat .8rem center / 16px;
  font-family: inherit; font-size: .86rem; color: var(--pch-ink);
}
.pch__search input::placeholder { color: #97907f; }
.pch__search input:focus { outline: 2px solid var(--pch-blue); outline-offset: 1px; border-color: transparent; }
.pch__clear {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; color: var(--pch-muted);
  font-size: 1.1rem; line-height: 1; padding: .25rem .4rem; display: none;
}
.pch__search.is-filled .pch__clear { display: block; }

/* live results */
.pch__results {
  position: absolute; left: 0; right: 0; top: calc(100% + .5rem);
  background: #fff; border: 1px solid var(--pch-line); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(29,26,22,.18);
  max-height: 62vh; overflow-y: auto; padding: .4rem; margin: 0; list-style: none;
  display: none; z-index: 5;
}
.pch__results.is-open { display: block; }
.pch__results li { margin: 0; }
.pch__results a {
  display: flex; gap: .75rem; align-items: center; padding: .5rem .6rem;
  border-radius: 10px; text-decoration: none; color: var(--pch-ink);
}
.pch__results a:hover, .pch__results a:focus-visible,
.pch__results .is-active > a { background: #f4f0e8; outline: none; }
.pch__results img { width: 38px; height: 38px; object-fit: contain; flex: none;
  background: #f6f3ec; border-radius: 8px; }
.pch__rtitle { font-size: .84rem; line-height: 1.3; }
.pch__rmeta  { font-size: .68rem; color: var(--pch-muted); }
.pch__rprice { margin-left: auto; font-size: .78rem; color: var(--pch-blue); white-space: nowrap; }
.pch__nores  { padding: 1rem; color: var(--pch-muted); font-size: .85rem; text-align: center; }

/* ---------- row 2: tools ---------- */
.pch__tools { flex: none; display: flex; align-items: center; gap: .35rem; }
.pch__lang {
  display: flex; align-items: center; border: 1px solid var(--pch-line);
  border-radius: 999px; overflow: hidden; margin-right: .35rem;
}
.pch__lang button {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  font-size: .64rem; letter-spacing: .1em; padding: .38rem .55rem; color: var(--pch-muted);
}
.pch__lang button[aria-pressed="true"] { background: var(--pch-ink); color: #fff; }
.pch__icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  color: var(--pch-ink); border-radius: 50%; text-decoration: none;
  transition: background .2s;
}
.pch__icon:hover { background: rgba(29,26,22,.07); }
.pch__icon:focus-visible { outline: 2px solid var(--pch-blue); outline-offset: 2px; }
.pch__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pch__badge {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: var(--pch-accent); color: #fff;
  font-size: .6rem; line-height: 17px; text-align: center; font-weight: 600;
}
.pch__badge[data-count="0"] { display: none; }

/* ---------- row 3: nav ---------- */
.pch__navrow { border-top: 1px solid var(--pch-line); }
.pch__nav { height: var(--pch-nav-h); display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.4rem);
  margin: 0; padding: 0; list-style: none; }
.pch__nav > li { position: static; display: flex; align-items: center; height: 100%; }
/* top-level nav items only — the old `.pch__nav a` selector also hit every link
   inside the mega panel and made the whole menu uppercase + letter-spaced */
.pch__nav > li > a, .pch__nav > li > button {
  font-family: inherit; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--pch-ink); background: none; border: 0; cursor: pointer; text-decoration: none;
  padding: .55rem 0; display: inline-flex; align-items: center; gap: .35rem;
  border-bottom: 2px solid transparent;
}
.pch__nav > li > a:hover, .pch__nav > li > button:hover,
.pch__nav > li > [aria-expanded="true"] { border-bottom-color: var(--pch-ink); }
.pch__nav .is-accent { color: var(--pch-accent); font-weight: 600; }
.pch__nav a:focus-visible, .pch__nav button:focus-visible { outline: 2px solid var(--pch-blue); outline-offset: 2px; }
.pch__caret { width: 9px; height: 9px; stroke: currentColor; stroke-width: 2; fill: none; transition: transform .2s; }
.pch__nav [aria-expanded="true"] .pch__caret { transform: rotate(180deg); }

/* ---------- mega panel ---------- */
.pch__mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-top: 1px solid var(--pch-line);
  box-shadow: 0 24px 48px rgba(29,26,22,.18);
  display: none; z-index: 210;
}
.pch__mega.is-open { display: block; }
.pch__megain {
  max-width: 1440px; margin: 0 auto; padding: 1.7rem clamp(1rem,3vw,2rem) 2rem;
  display: grid; grid-template-columns: 1.05fr 1.25fr 1.75fr 1.75fr 1.05fr; gap: 2rem;
}
.pch__mcol { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.pch__mh {
  font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--pch-muted); margin-bottom: .5rem;
}
.pch__mcol a { font-size: .86rem; line-height: 1.4; color: #3a342b; text-decoration: none; padding: .22rem 0; }
.pch__mcol a:hover { color: var(--pch-accent); }
.pch__mall { margin-top: .5rem; font-size: .64rem; letter-spacing: .16em;
  text-transform: uppercase; color: #8a6d3b; }
/* brand rows: lockup + name, brand colour on hover */
.pch__mbrand { display: flex; align-items: center; gap: .65rem; }
.pch__mbrand img { height: 17px; width: 54px; object-fit: contain; object-position: left center; flex: none; }
.pch__mbrand:hover { color: var(--c, var(--pch-accent)); }
/* category rows: round photo thumb + name */
.pch__mcat { display: flex; align-items: center; gap: .65rem; }
.pch__mcat img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none;
  box-shadow: 0 0 0 1px var(--pch-line); transition: transform .25s; }
.pch__mcat:hover img { transform: scale(1.08); }
/* product tiles: 2x2 */
.pch__mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pch__mprod { display: flex; flex-direction: column; gap: .35rem; padding: 0; }
.pch__mprod img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; background: #efe9e0; display: block;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s; }
.pch__mprod:hover img { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(29,26,22,.14); }
.pch__mprod b { font-weight: 500; font-size: .76rem; line-height: 1.3; color: var(--pch-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pch__mprod i { font-style: normal; font-size: .66rem; letter-spacing: .12em; color: #8a6d3b; }
/* promo tile under the bundle links */
.pch__mpromo { margin-top: auto; padding: .85rem 1rem; border-radius: 14px; background: var(--pch-cream);
  border: 1px solid var(--pch-line); font-size: .74rem; line-height: 1.5; color: var(--pch-ink); }
.pch__mpromo b { color: var(--pch-accent); }
.pch__mpromo:hover { color: var(--pch-ink); border-color: var(--pch-accent); }

/* ---------- brand-owned header (brand hubs + product pages) ----------
   Reference: a brand site, not a marketplace. Row 1 is a solid strip in the
   brand's deep colour carrying the delivery promise and the utilities; row 2
   is white with the brand's logo and the brand's own nav. The tinted surface
   from the shared header is replaced by white here, matching the reference. */
.pch--brand { --pch-cream: #ffffff; background: #ffffff; }
/* Brand pages behave like a standalone brand site (the P&G model): no
   marketplace promo in the strip, and the hero fills the first screen. The
   stacked header height is published here so the skins can subtract it. */
body[data-brand] { --pch-stack: 137px; }
.pch--brand .pch__promo p { display: none; }
.pch__strip { justify-content: flex-end; }
.pch--brand .pch__promo {
  height: auto; min-height: 40px; background: var(--pch-brand-deep, var(--pch-ink)); color: #fff;
  display: block; text-align: start;
}
.pch__strip {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px;
}
.pch--brand .pch__promo p { margin: 0; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; }
/* brand pages are standalone brand sites, so the strip carries one way back
   to the P Cosmetics home; on narrow screens the label shortens to the name */
.pch__back {
  display: inline-flex; align-items: center; gap: .45rem; margin-right: auto;
  font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  color: #fff; text-decoration: none; padding: .42rem .85rem .42rem .6rem;
  border: 1px solid rgba(255,255,255,.45); border-radius: 999px;
  transition: background .25s, color .25s, border-color .25s;
}
.pch__back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pch__back:hover, .pch__back:focus-visible { background: #fff; color: var(--pch-brand-deep, var(--pch-ink)); border-color: #fff; outline: none; }
@media (max-width: 560px) { .pch__back-long { display: none; } .pch__back { padding: .4rem .7rem .4rem .5rem; letter-spacing: .14em; } }
.pch--brand .pch__promo b { color: #fff; font-weight: 700; }
.pch--brand .pch__promo .pch__tools { gap: .15rem; }
.pch--brand .pch__promo .pch__icon { width: 34px; height: 34px; color: #fff; }
.pch--brand .pch__promo .pch__icon:hover { background: rgba(255,255,255,.16); }
.pch--brand .pch__promo .pch__icon:focus-visible { outline-color: #fff; }
.pch--brand .pch__promo .pch__icon svg { width: 18px; height: 18px; }
.pch--brand .pch__promo .pch__lang { border-color: rgba(255,255,255,.5); }
.pch--brand .pch__promo .pch__lang button { color: rgba(255,255,255,.85); }
.pch--brand .pch__promo .pch__lang button[aria-pressed="true"] { background: #fff; color: var(--pch-brand-deep, var(--pch-ink)); }
.pch--brand .pch__badge { background: #fff; color: var(--pch-brand-deep, var(--pch-ink)); }
/* search is an icon on every width here, not an inline bar */
.pch--brand .pch__searchbtn { display: inline-flex; }

.pch--brand .pch__main { position: relative; justify-content: space-between; gap: 1.5rem; }
/* 180x100 files: height sets the rendered size, width follows the artwork */
.pch--brand .pch__brand img { width: auto; height: 54px; }

.pch--brand .pch__navrow { display: block; border: 0; flex: 1 1 auto; min-width: 0; }
.pch--brand .pch__nav { height: auto; justify-content: center; gap: clamp(1.2rem, 3vw, 3rem); }
.pch--brand .pch__nav a {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .55rem 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
.pch--brand .pch__nav a:hover,
.pch--brand .pch__nav a:focus-visible { border-bottom-color: var(--pch-brand-deep, var(--pch-ink)); }

/* the search box drops down as an overlay at every width (the mobile pattern) */
.pch--brand .pch__search {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 260;
  background: #fff; padding: .9rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--pch-line); box-shadow: 0 14px 30px rgba(29,26,22,.10);
  display: none;
}
.pch--brand .pch__search.is-open { display: block; }
.pch--brand .pch__search .pch__results { position: static; margin-top: .5rem; box-shadow: none; max-height: calc(100vh - 9rem); }

@media (max-width: 767px) {
  body[data-brand] { --pch-stack: 125px; }
  .pch--brand .pch__brand img { height: 46px; }
  .pch--brand .pch__navrow {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-top: 1px solid var(--pch-line); padding: 0 1rem;
    box-shadow: 0 14px 30px rgba(29,26,22,.10);
  }
  .pch--brand .pch__navrow.is-open { display: block; }
  .pch--brand .pch__nav { flex-direction: column; align-items: stretch; gap: 0; padding: .4rem 0 .8rem; }
  .pch--brand .pch__nav li { border-bottom: 1px solid var(--pch-line); }
  .pch--brand .pch__nav a { width: 100%; padding: .85rem 0; border-bottom: 0; }
  .pch--brand .pch__search { position: absolute; }
}

/* ---------- mobile ---------- */
.pch__burger, .pch__searchbtn { display: none; }
@media (max-width: 767px) {
  :root { --pch-main-h: 84px; }
  /* same 2x step: 58x34 rendered -> 68 tall. Box width is unchanged (118->116),
     so the icon row keeps the horizontal space it had. */
  .pch__brand img { width: 116px; height: 68px; }
  .pch__search { position: fixed; inset: 0 0 auto 0; background: var(--pch-cream);
    padding: .7rem .9rem; border-bottom: 1px solid var(--pch-line);
    display: none; z-index: 260; }
  .pch__search.is-open { display: block; }
  .pch__search .pch__results { position: static; margin-top: .5rem; box-shadow: none;
    max-height: calc(100vh - 8rem); }
  .pch__searchbtn, .pch__burger { display: inline-flex; }
  .pch__lang { margin-right: .1rem; }
  .pch__lang button { padding: .34rem .42rem; font-size: .58rem; }
  .pch__navrow { display: none; }
  .pch__navrow.is-open { display: block; }
  .pch__nav { height: auto; flex-direction: column; align-items: stretch; gap: 0; padding: .4rem 0 1rem; }
  .pch__nav > li { border-bottom: 1px solid var(--pch-line); display: block; height: auto; }
  .pch__nav > li > a, .pch__nav > li > button { width: 100%; padding: .85rem 0; justify-content: space-between; }
  .pch__mega { position: static; box-shadow: none; }
  .pch__megain { grid-template-columns: 1fr; gap: 1.2rem; padding: 1rem 0 1.4rem; }
  .pch__mcol--feat { display: none; }   /* product tiles are desktop-only; the phone menu stays a short list */
  .pch__mpromo { margin-top: .6rem; }
  .pch__wishtext { display: none; }
}
@media (max-width: 400px) { .pch__lang { display: none; } }

/* RTL — set by the AR/EN toggle on <html dir> */
[dir="rtl"] .pch__search input { padding: 0 2.4rem 0 2.6rem; background-position: right .8rem center; }
[dir="rtl"] .pch__clear { right: auto; left: .5rem; }
[dir="rtl"] .pch__rprice { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pch__badge { right: auto; left: 3px; }

@media (prefers-reduced-motion: reduce) { .pch * { transition: none !important; } }

/* visually-hidden label (kept for screen readers) */
.pch__sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
