/* ---------------------------------------------------------------
   Tropic Skincare page — an information page, nothing to buy.
   Loaded only on tropic.php (via $PAGE_CSS in header.php) and built
   from the same tokens, cards and chips as the rest of the site.
   --------------------------------------------------------------- */

/* hero: the ambassador copy on the left, how to get products on the right */
.tr-hero-grid{
  display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  gap:clamp(1.5rem,4vw,4rem);align-items:center;
}
/* hero picture: the same cut-out treatment as the homepage hero
   (.hero-figure / .hero-visual in style.css), level with the copy and
   bleeding only slightly past its column */
.tr-hero-figure{margin-top:0;align-self:center}
.tr-hero-figure .hero-visual{width:112%;margin-left:-6%;margin-right:-6%}
.tr-hero-copy .page-lede + .page-lede{margin-top:.9rem}

.tr-how{
  background:var(--white);border:1px solid var(--line-soft);border-radius:14px;
  padding:1.25rem 1.35rem 1.35rem;
  box-shadow:0 14px 34px rgba(38,32,42,.06);
}
.tr-how-title{
  margin:0 0 .5rem;font-family:'Sacramento',cursive;font-size:1.7rem;line-height:1.1;
  color:var(--plum);
}
.tr-how-list{list-style:none;margin:0;padding:0}
.tr-how-list li{
  display:flex;align-items:baseline;gap:.8rem;
  padding:.6rem 0;font-size:.93rem;color:var(--ink-2);line-height:1.5;
}
.tr-how-list li + li{border-top:1px solid var(--line-soft)}
.tr-how-list span{
  flex:0 0 auto;width:1.5rem;height:1.5rem;border-radius:50%;
  display:grid;place-items:center;transform:translateY(-.1rem);
  background:var(--plum-tint);color:var(--plum);font-size:.75rem;font-weight:600;
}
.tr-how-note{margin:.4rem 0 1.1rem;font-size:.82rem;color:var(--mute)}
.tr-how-actions{display:flex;flex-wrap:wrap;gap:.5rem}
.tr-how-actions .btn{flex:1 1 auto}
.tr-how-actions .ico{width:17px;height:17px}

/* filters */
.tr-bar{margin-bottom:clamp(1.5rem,3vw,2.25rem)}
.tr-filters{margin-bottom:0}

/* the range */
.tr-grid{
  list-style:none;margin:0;padding:0;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:clamp(.9rem,1.8vw,1.35rem);
}
.tr-card{
  display:flex;flex-direction:column;min-width:0;
  background:var(--white);border:1px solid var(--line-soft);border-radius:14px;
  overflow:hidden;
  transition:box-shadow .3s var(--ease),border-color .3s var(--ease);
}
.tr-card:hover{box-shadow:0 14px 32px rgba(38,32,42,.08);border-color:var(--line)}

.tr-media{position:relative;aspect-ratio:1/1;overflow:hidden;background:var(--porcelain)}
.tr-media img{
  width:100%;height:100%;object-fit:cover;display:block;
  transition:transform .6s var(--ease);
}
.tr-card:hover .tr-media img{transform:scale(1.04)}
.tr-media-empty{
  position:absolute;inset:0;display:grid;place-items:center;
  font-family:'Sacramento',cursive;font-size:3rem;color:var(--mute);
}

.tr-info{display:flex;flex-direction:column;gap:.25rem;flex:1;padding:1rem 1.1rem 1.1rem}
.tr-cat{margin:0;font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;color:var(--mute)}
.tr-name{margin:0;font-size:1rem;font-weight:500;line-height:1.35;letter-spacing:-.01em;color:var(--ink)}
.tr-sum{
  margin:.15rem 0 0;font-size:.86rem;line-height:1.5;color:var(--ink-2);
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.tr-meta{
  display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  margin:auto 0 0;padding-top:.8rem;
}
.tr-price{font-size:1.05rem;font-weight:500;color:var(--ink);font-variant-numeric:tabular-nums}
.tr-size{font-size:.8rem;color:var(--mute);text-align:right}

.tr-empty{
  margin:0;padding:2rem 1.25rem;text-align:center;color:var(--ink-2);
  background:var(--white);border:1px solid var(--line-soft);border-radius:14px;
}

/* the whole card opens its popup; the button in the name is what
   keyboard and screen-reader users reach */
.tr-card{position:relative;cursor:pointer}
.tr-open{
  padding:0;border:0;background:none;font:inherit;color:inherit;text-align:left;
  letter-spacing:inherit;cursor:pointer;
}
.tr-open::after{content:"";position:absolute;inset:0;z-index:1;border-radius:14px}
.tr-open:focus-visible{outline:none}
.tr-open:focus-visible::after{outline:2px solid var(--plum);outline-offset:2px}
.tr-view{
  position:absolute;left:.7rem;right:.7rem;bottom:.7rem;z-index:2;
  padding:.6rem 1rem;border-radius:100px;
  background:var(--white);color:var(--ink);
  font-size:.86rem;font-weight:600;letter-spacing:.01em;text-align:center;
  cursor:pointer;
  opacity:0;transform:translateY(6px);
  transition:opacity .22s var(--ease),transform .22s var(--ease),background .2s var(--ease),color .2s var(--ease);
}
.tr-card:hover .tr-view,
.tr-card:focus-within .tr-view{opacity:1;transform:translateY(0)}
.tr-view:hover{background:var(--plum);color:var(--porcelain)}
/* no hover on touch — keep it visible instead of hidden forever */
@media (hover:none){
  .tr-view{opacity:1;transform:none;background:var(--plum);color:var(--porcelain)}
}

/* ---- the product popup (built on the site's .modal) ---- */
/* The popup is exactly as tall as its square photo; the photo fills the
   left side top to bottom and only the details on the right scroll. */
.modal.tr-modal{
  --trm-h:min(540px,86vh);
  width:min(960px,100%);height:var(--trm-h);max-height:none;overflow:hidden;
}
.tr-x{top:1rem;right:1rem;z-index:3;background:var(--porcelain)}
.tr-modal-body{
  display:grid;grid-template-columns:var(--trm-h) minmax(0,1fr);
  height:100%;min-height:0;
}
.tr-modal-media{position:relative;height:100%;background:var(--shell);overflow:hidden}
.tr-modal-media img,
.tr-modal-media .tr-media-empty{
  position:absolute;inset:0;display:grid;width:100%;height:100%;object-fit:cover;
}
.tr-modal-info{
  height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:clamp(1.5rem,3.5vw,2.4rem) clamp(1.25rem,3.5vw,2.4rem) clamp(1.5rem,3vw,2rem);
}
.tr-modal-name{
  margin:.2rem 3rem .5rem 0;font-family:var(--display);font-weight:400;
  font-size:clamp(1.45rem,2.6vw,1.95rem);line-height:1.2;letter-spacing:-.025em;
}
.tr-modal-price{
  display:flex;align-items:baseline;gap:.75rem;margin:0 0 1.1rem;
  font-size:1.2rem;font-weight:600;font-variant-numeric:tabular-nums;
}
.tr-modal-price .tr-size{font-size:.85rem;font-weight:400}

.tr-modal-desc{font-size:.93rem;line-height:1.6;color:var(--ink-2)}
.tr-modal-desc p{margin:0 0 .85rem}
.tr-modal-desc h3{margin:1.1rem 0 .4rem;font-size:.98rem;font-weight:600;color:var(--ink)}
.tr-checks{list-style:none;margin:0 0 1.1rem;padding:0;display:grid;gap:.55rem}
.tr-checks li{position:relative;padding-left:1.75rem;color:var(--ink)}
.tr-checks li::before{
  content:"";position:absolute;left:.1rem;top:.42em;width:.8rem;height:.45rem;
  border-left:1.6px solid var(--plum);border-bottom:1.6px solid var(--plum);
  transform:rotate(-45deg);
}
.tr-kv strong{color:var(--ink);font-weight:600}
.tr-kv strong::after{content:": "}
.tr-note{font-size:.8rem;color:var(--mute);font-style:italic}

#trmTicks{margin-bottom:1.25rem}
.tr-modal-sum{margin:0 0 1.25rem;font-size:.93rem;line-height:1.6;color:var(--ink-2)}

/* option buttons: size, shade, "Cleanser & Headband"… */
.tr-opts{
  display:grid;gap:1rem;margin:0 0 .25rem;
  padding:1rem 1.1rem;background:var(--shell);border-radius:10px;
}
.tr-opt-name{margin:0 0 .55rem;font-size:.86rem;font-weight:500;color:var(--ink)}
.tr-opt-row{display:flex;flex-wrap:wrap;gap:.45rem}
.tr-opt{
  padding:.5rem 1.05rem;border:1px solid var(--line);border-radius:100px;
  background:var(--white);color:var(--ink-2);font:inherit;font-size:.86rem;line-height:1.3;
  cursor:pointer;transition:border-color .2s var(--ease),color .2s var(--ease),box-shadow .2s var(--ease);
}
.tr-opt:hover{border-color:var(--ink);color:var(--ink)}
.tr-opt.is-on{border-color:var(--plum);color:var(--ink);box-shadow:inset 0 0 0 1px var(--plum);font-weight:500}
.tr-opt:focus-visible{outline:2px solid var(--plum);outline-offset:2px}
.tr-modal-media img{transition:opacity .2s var(--ease)}

.tr-modal-cta{
  margin-top:1.4rem;padding-top:1.2rem;border-top:1px solid var(--line);
}
.tr-modal-cta p{margin:0 0 .8rem;font-size:.88rem;color:var(--mute)}
.tr-order{width:100%}
.tr-order svg{width:16px;height:16px;flex:0 0 auto}
.tr-modal-cta .tr-order-note{margin:.6rem 0 0;font-size:.8rem;text-align:center}

/* narrower screens: a square photo would leave the details no room, so the
   popup stacks instead — photo on top, and the whole thing scrolls */
@media (max-width:900px){
  .modal.tr-modal{height:auto;max-height:92vh}
  .tr-modal-body{display:block;height:auto;max-height:92vh;overflow-y:auto;overscroll-behavior:contain}
  .tr-modal-media{height:auto;aspect-ratio:4/3;max-height:42vh;width:100%}
  .tr-modal-info{height:auto;overflow:visible}
}

/* closing band */
/* closing card — the same dark card as the homepage's "Every treatment"
   banner, sitting on the light page so it never runs into the footer */
.tr-cta{padding-top:0}
.tr-cta-card{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
  gap:1.5rem 3rem;
  padding:clamp(1.75rem,4vw,3rem) clamp(1.5rem,4vw,3.25rem);
  position:relative;isolation:isolate;overflow:hidden;
  border-radius:18px;color:#F3F0F2;
  /* soft light: a plum glow from the right, a faint warm one bottom-left */
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(203,158,187,.30) 0%, rgba(203,158,187,0) 60%),
    radial-gradient(45% 90% at 0% 100%, rgba(227,204,200,.14) 0%, rgba(227,204,200,0) 65%),
    linear-gradient(135deg,#1C1621 0%,#110E16 55%,#18121C 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07), 0 24px 50px -28px rgba(38,32,42,.55);
}
/* a thin highlight along the top edge */
.tr-cta-card::before{
  content:"";position:absolute;left:8%;right:8%;top:0;height:1px;z-index:-1;
  background:linear-gradient(90deg,transparent,rgba(243,240,242,.35),transparent);
}
[data-theme="dark"] .tr-cta-card{border:1px solid var(--line)}
.tr-cta-copy{max-width:44ch}
.tr-cta-eyebrow{
  margin:0 0 .5rem;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;
  color:#CB9EBB;
}
.tr-cta-title{
  margin:0;font-family:var(--display);font-weight:400;
  font-size:clamp(1.35rem,2.4vw,1.8rem);line-height:1.25;letter-spacing:-.02em;color:#F3F0F2;
}
.tr-cta-actions{display:flex;flex-wrap:wrap;gap:.6rem}
.tr-cta-actions .ico{width:17px;height:17px}
.tr-cta .tr-cta-main{background:#F3F0F2;color:#26202A}
.tr-cta .tr-cta-main:hover{background:#6E4F63;color:#F3F0F2}
.tr-cta .btn-on-dark{border-color:rgba(243,240,242,.32);color:#F3F0F2}
.tr-cta .btn-on-dark:hover{background:#F3F0F2;color:#26202A;border-color:#F3F0F2}
@media (max-width:560px){
  .tr-cta-actions{width:100%}
  .tr-cta-actions .btn{flex:1 1 auto}
}

@media (max-width:1000px){
  .tr-hero-grid{grid-template-columns:1fr;align-items:start}
  /* stacked: the picture sits under the copy, centred, never wider than the screen */
  .tr-hero-figure{width:100%;max-width:520px;margin-inline:auto}
  .tr-hero-figure .hero-visual{width:100%;margin-inline:0}
}
@media (max-width:560px){
  .tr-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
  .tr-info{padding:.8rem .8rem .9rem}
  .tr-name{font-size:.9rem}
  .tr-sum{display:none}
  .tr-view{left:.45rem;right:.45rem;bottom:.45rem;padding:.4rem .5rem;font-size:.76rem}
  .tr-meta{flex-direction:column;align-items:flex-start;gap:.1rem;padding-top:.5rem}
  .tr-size{text-align:left}
  .tr-bar{overflow-x:auto;margin-inline:calc(var(--gut) * -1);padding-inline:var(--gut);scrollbar-width:none}
  .tr-bar::-webkit-scrollbar{display:none}
  .tr-filters{flex-wrap:nowrap}
  .tr-filters .chip{flex:0 0 auto;white-space:nowrap}
}
@media (prefers-reduced-motion:reduce){
  .tr-card,.tr-media img,.tr-view,.tr-opt{transition:none}
  .tr-card:hover .tr-media img{transform:none}
}
