/* ══ CosClub tenant theme layer ═══════════════════════════════════════════════
   Loaded last by ui_head() (see _ui.php) and deliberately NOT part of the
   template package, so everything here survives a template redeploy. Put
   store-specific overrides in this file, never in storefront.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sale price clipped off the edge of the product card ──────────────────
   While a sale campaign is live the card prints TWO figures in one column:

     <span class="member-val"><span class="was-price">$14.99</span>$11.99</span>

   .was-price is inline, so the pair sits on a single line. .member-val runs
   at 20px in the heading font and a four-up card leaves each .p-col roughly
   65px of content box, so the second figure — the price the shopper actually
   pays — was pushed past the card edge and clipped by
   .product-card{overflow:hidden}. Medicube Dual Toner Pad 2.0 rendered as a
   struck-through $14.99 with the real $11.99 nowhere on screen.

   Stacking the pre-sale figure ABOVE the live one keeps a column exactly one
   price wide, sale or no sale, so it cannot overflow however narrow the card
   gets. min-width:0 is the belt and braces: a flex item otherwise refuses to
   shrink below its own content, which is what turned a too-wide column into
   an overflow rather than a wrap.

   Applies to every grid that uses this markup — Shop All (shop/index.php)
   and the homepage / category grids (cc_card in _cats.php).
   ───────────────────────────────────────────────────────────────────────── */
.pricing-block{min-width:0;}
.p-col{min-width:0;}
.retail-val,
.member-val,
.single-price{display:block;min-width:0;overflow-wrap:break-word;}

.was-price{
  display:block;
  margin:0 0 1px;
  font-size:11px;
  line-height:1.25;
  letter-spacing:0;
}

/* Phones drop the grid to two-up, which produces the narrowest cards on the
   site. Trim the live figure and the column gutters to match. */
@media(max-width:700px){
  .member-val,
  .single-price{font-size:17px;}
  .p-col.member{padding-left:8px;}
  .p-col.retail{padding-right:8px;}
}

/* ── Registered entity and address in the footer ──────────────────────────
   ui_legal_identity() now prints the trading statement and postal address
   above the copyright line. The site previously showed neither, on any page.
   Give the entity line its own row and a slightly quieter weight than the
   copyright so the bar still reads as one small block rather than two
   competing lines.
   ───────────────────────────────────────────────────────────────────────── */
.footer-legal{
  display:block;
  margin-bottom:5px;
  opacity:.85;
}
@media(max-width:560px){
  .footer-bottom{line-height:1.7;}
}

/* ══ NAVIGATION ══════════════════════════════════════════════════════════════
   Markup lives in ui_head() / ui_nav_shop_menu() in _ui.php. The styling sits
   here rather than in storefront.css only because this file survives a
   template redeploy; if the template is ever redeployed the nav markup
   reverts and these rules become harmless dead CSS, which is the gentler
   failure of the two.

   ── WHAT THIS REPLACED ─────────────────────────────────────────────────────
   Four links: Shop All, New In, Categories, Membership. Two of them were
   homepage anchors rather than destinations — /#new and /#categories — so
   "Categories" from any other page threw you to the homepage and scrolled you
   to a row of circles. It read as lackluster because it was a bookmark, not a
   menu. Meanwhile the real category pages (/category/skincare and friends),
   the product-type taxonomy, and the whole /brands directory were unreachable
   from the header.

   Worse, storefront.css hid .nav-links entirely below 640px and nothing
   replaced it, so on a phone the header was a logo and three icons: no browse
   path at all, on the device most of this store's traffic arrives from.

   ── THE BREAKPOINT ─────────────────────────────────────────────────────────
   860px, not the 640px storefront.css used. Four links plus a dropdown plus
   four icons plus the Join pill stops fitting well before 640. Below it the
   same markup becomes an off-canvas drawer — one DOM, two presentations, so
   there is no second copy of the menu to keep in step.

   This file loads after storefront.css, so the display:flex below wins over
   that file's `@media(max-width:640px){.nav-links{display:none}}` on equal
   specificity by order alone. Do not "fix" that by adding !important.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Skip link — first focusable thing on the page, visible only when focused.
   Part of closing F26: the nav icons were unreachable by keyboard and there
   was no way past the header at all. */
.skip-link{
  position:absolute;left:-9999px;top:0;z-index:500;
  background:var(--club-900);color:#fff;
  padding:11px 20px;border-radius:0 0 10px 0;
  font-family:var(--body-font);font-weight:700;font-size:14px;
}
.skip-link:focus{left:0;}

/* The search and bag controls are real <button>s now, not a <span> and a
   <div> with onclick. Strip the button chrome so they look exactly as before
   while being focusable, activatable by Enter/Space and announced properly. */
button.nav-ico{
  background:none;border:none;padding:0;margin:0;
  font:inherit;color:var(--club-900);cursor:pointer;
  display:inline-flex;align-items:center;
}

.nav-burger{
  display:none;
  background:none;border:none;padding:6px;margin:0;
  color:var(--club-900);cursor:pointer;
  align-items:center;justify-content:center;
}
.nav-close{display:none;}

/* ── the Shop dropdown ─────────────────────────────────────────────────── */
.nav-links{align-items:center;}
.nav-item{position:relative;display:flex;align-items:center;}

.nav-trigger{
  background:none;border:none;padding:0;margin:0;
  font:inherit;font-weight:600;font-size:15px;
  color:var(--club-500);cursor:pointer;
  display:inline-flex;align-items:center;gap:6px;
  transition:color .18s;
}
.nav-trigger:hover,
.nav-item.is-open .nav-trigger{color:var(--club-900);}
.nav-trigger svg{transition:transform .2s;}
.nav-item.is-open .nav-trigger svg{transform:rotate(180deg);}

/* Click to open, not hover. A hover menu is unusable by touch and by keyboard,
   and this one has to serve both from the same markup. */
.nav-menu{
  display:none;
  position:absolute;top:calc(100% + 18px);left:50%;transform:translateX(-50%);
  background:#fff;border:1px solid var(--line);border-radius:16px;
  box-shadow:0 18px 44px rgba(26,26,26,.14);
  padding:22px 26px 24px;z-index:210;
  min-width:min(660px,78vw);
}
.nav-item.is-open .nav-menu{display:block;}

/* Shop All — a real button, not a label.
   This shipped first as a small uppercase link reading "All products" with a
   hairline underline, sitting above the category columns. It was the right
   destination in the right place and nobody could see it: at 12px, uppercase
   and letter-spaced, it read as a section heading for the columns beneath it
   rather than as the one control that takes you to the whole catalogue. Given
   the brand's primary button treatment and the words the rest of the site
   already uses for that destination, it now reads as what it is. */
.nav-menu-all{
  display:inline-flex;align-items:center;gap:8px;
  background:var(--cos-300);color:var(--club-900);
  font-family:var(--body-font);
  font-size:13.5px;font-weight:800;letter-spacing:.01em;
  padding:11px 22px;border-radius:var(--radius-pill);
  margin-bottom:20px;
  transition:background .18s,transform .1s;
}
.nav-menu-all:hover{background:var(--cos-400);}
.nav-menu-all:active{transform:scale(.98);}

.nav-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:22px 26px;}
.nav-col-h{
  display:block;
  font-family:var(--heading-font);font-size:14px;font-weight:700;
  color:var(--club-900);margin-bottom:8px;
}
.nav-col-h:hover{color:var(--cos-700);}
.nav-col a:not(.nav-col-h){
  display:block;font-size:13px;line-height:1.95;color:var(--club-500);
}
.nav-col a:not(.nav-col-h):hover{color:var(--club-900);}

/* ── off-canvas drawer ─────────────────────────────────────────────────── */
.nav-scrim{
  position:fixed;inset:0;background:rgba(26,26,26,.42);
  z-index:390;opacity:0;pointer-events:none;transition:opacity .25s;
}

@media(max-width:860px){
  .nav-burger{display:inline-flex;}

  .nav-links{
    display:flex;
    position:fixed;top:0;right:0;bottom:0;left:auto;
    width:min(86vw,360px);
    flex-direction:column;align-items:stretch;gap:0;
    background:#fff;
    padding:74px 24px 40px;
    overflow-y:auto;-webkit-overflow-scrolling:touch;
    transform:translateX(100%);
    transition:transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow:-10px 0 40px rgba(26,26,26,.16);
    z-index:400;
  }
  body.nav-open .nav-links{transform:translateX(0);}
  body.nav-open{overflow:hidden;}
  body.nav-open .nav-scrim{opacity:1;pointer-events:auto;}

  .nav-close{
    display:flex;align-items:center;justify-content:center;
    position:absolute;top:18px;right:18px;
    width:38px;height:38px;border-radius:50%;
    border:1px solid var(--line);background:#fff;
    font:inherit;font-size:15px;color:var(--club-900);cursor:pointer;
  }

  .nav-links > a,
  .nav-item{border-bottom:1px solid var(--line);}
  .nav-links > a{
    padding:16px 2px;font-size:16px;font-weight:700;color:var(--club-900);
    min-height:44px;display:flex;align-items:center;
  }

  .nav-item{flex-direction:column;align-items:stretch;}
  .nav-trigger{
    width:100%;justify-content:space-between;
    padding:16px 2px;min-height:44px;
    font-size:16px;font-weight:700;color:var(--club-900);
  }

  /* Static inside the drawer: no popover, no shadow, just an indented list.
     JS opens it with the drawer so the categories are never a second tap. */
  .nav-menu{
    position:static;transform:none;
    border:none;box-shadow:none;border-radius:0;
    padding:0 0 16px;min-width:0;
  }
  /* Full width in the drawer, where it is the primary action of the panel. */
  .nav-menu-all{
    display:flex;justify-content:center;width:100%;
    margin:4px 0 18px;padding:14px 20px;font-size:14.5px;
    min-height:48px;
  }
  .nav-cols{grid-template-columns:1fr;gap:16px;}
  .nav-col a:not(.nav-col-h){line-height:2.1;font-size:14px;padding:2px 0;}
}

@media(min-width:861px){
  .nav-scrim{display:none;}
}

@media(prefers-reduced-motion:reduce){
  .nav-links{transition:none;}
  .nav-scrim{transition:none;}
  .nav-trigger svg{transition:none;}
  .nav-menu-all:active{transform:none;}
}
