/* SIGMAN - Styling Studio.
   One framed, high-attention module that merges "Complete The Sigma Look" and
   the fragrance/apparel pairing ("Best Fragrance For This Look" / "Style This
   Fragrance") into a single block with two tabs.

   Palette: brand navy #09244f frame, SILVER hairlines/accents, BRAND RED on
   the tab switches and the primary CTA. The look engine in
   sgm-complete-the-look.css is reused verbatim - its --sgm-gold token is
   re-pointed at silver here, so every card/badge/ledger accent follows without
   touching that file. */

.sgm-studio {
  --sgm-navy: #09244f;
  --sgm-navy-top: #0e3470;
  --sgm-silver: #c9ced6;
  --sgm-silver-soft: rgb(201 206 214 / 0.16);
  --sgm-red: #e11900;
  --sgm-ease: cubic-bezier(.22, 1, .36, 1);
  /* the look engine styles its accents from --sgm-gold: re-point it at silver */
  --sgm-gold: var(--sgm-silver);
  --sgm-gold-soft: var(--sgm-silver-soft);
  padding-block: var(--sgm-st-pt, 32px) var(--sgm-st-pb, 40px);
}
.sgm-studio__wrap {
  max-width: var(--page-width, 1200px);
  margin-inline: auto;
  padding-inline: var(--page-margin, 20px);
}

/* ---------- The frame: one visual container for both tabs ---------- */
.sgm-studio__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(201 206 214 / 0.38);
  border-radius: var(--style-border-radius-card, 12px);
  background: var(--color-background);
  padding: clamp(22px, 4vw, 42px) clamp(14px, 3vw, 32px) clamp(22px, 4vw, 34px);
  box-shadow: 0 30px 60px -42px rgb(3 12 30 / 0.6);
}

/* Navy editorial frame. Re-maps the theme colour variables locally so every
   reused .sgm-ctl / .sgm-look-card rule sits on navy automatically. */
.sgm-studio--dark .sgm-studio__frame {
  --color-background: var(--sgm-navy);
  --color-foreground: #f2f5fa;
  --color-background-rgb: 9 36 79;
  --color-foreground-rgb: 242 245 250;
  color: #f2f5fa;
  background:
    radial-gradient(125% 95% at 50% 0%, var(--sgm-navy-top) 0%, var(--sgm-navy) 62%);
  border-color: rgb(201 206 214 / 0.4);
  box-shadow: 0 34px 74px -44px rgb(3 12 30 / 0.9);
}

/* Silver hairline sweeping across the top when the module scrolls into view.
   PERF: animates transform, not background-position - the latter repaints on
   the main thread every frame, a transform is composited. Runs 3 times rather
   than infinitely; an endless loop kept the compositor busy for as long as the
   section stayed on screen. */
.sgm-studio__frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sgm-silver), transparent);
  transform: translateX(-100%);
  will-change: transform;
}
.sgm-studio.is-in .sgm-studio__frame::before {
  animation: sgm-st-sweep 3.2s var(--sgm-ease) .3s 3;
}
@keyframes sgm-st-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(222%); }
}

/* Re-point the reused look engine's accent token inside the studio. */
.sgm-studio .sgm-ctl {
  --sgm-gold: var(--sgm-silver);
  --sgm-gold-soft: var(--sgm-silver-soft);
}

/* ---------- Header ---------- */
.sgm-studio__head { text-align: center; }
.sgm-studio__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: max(.58rem, 12px);
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--sgm-silver);
}
.sgm-studio__eyebrow::before,
.sgm-studio__eyebrow::after {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--sgm-silver);
  opacity: .7;
}
.sgm-studio__title {
  margin: 12px 0 0;
  font-size: clamp(1.35rem, 4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}
.sgm-studio__sub {
  margin: 12px auto 0;
  max-width: 520px;
  font-size: .86rem;
  line-height: 1.6;
  color: rgb(var(--color-foreground-rgb) / 0.66);
}

/* ---------- Tab strip (the switches) ---------- */
.sgm-studio__tabs {
  position: relative;
  display: flex;
  gap: 4px;
  width: min(100%, 560px);
  margin: 24px auto 0;
  padding: 4px;
  border: 1px solid rgb(201 206 214 / 0.3);
  border-radius: 999px;
  background: rgb(var(--color-foreground-rgb) / 0.06);
}
.sgm-studio__tab {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 48px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: clamp(.6rem, 1.9vw, .7rem);
  font-weight: 600;
  letter-spacing: .13em;
  line-height: 1.25;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .35s var(--sgm-ease), opacity .35s ease;
  opacity: .68;
}
.sgm-studio__tab[aria-selected="true"] { color: #fff; opacity: 1; }
.sgm-studio__tab:focus-visible { outline: 2px solid var(--sgm-silver); outline-offset: 2px; }
.sgm-studio__tab-count {
  display: block;
  margin-top: 3px;
  font-size: max(.55rem, 12px);
  font-weight: 500;
  letter-spacing: .1em;
  opacity: .78;
}
.sgm-studio__thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 0;
  border-radius: 999px;
  background: var(--sgm-red);
  box-shadow: 0 6px 18px -8px rgb(225 25 0 / 0.85);
  transition: transform .5s var(--sgm-ease), width .5s var(--sgm-ease);
}

/* ---------- Panels ---------- */
.sgm-studio__panel { padding-top: 22px; }
.sgm-studio__panel[hidden] { display: none; }
.sgm-studio__panel-head { text-align: center; margin-bottom: 18px; }
.sgm-studio__panel-title {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.sgm-studio__panel-sub {
  margin: 8px auto 0;
  max-width: 460px;
  font-size: .82rem;
  line-height: 1.55;
  color: rgb(var(--color-foreground-rgb) / 0.64);
}

/* Neutralise the standalone-section chrome of the reused look engine. */
.sgm-studio .sgm-ctl {
  padding-block: 0;
  background: transparent;
  color: inherit;
}
.sgm-studio .sgm-ctl__inner {
  max-width: none;
  padding-inline: 0;
}

/* Cards sit on navy: lift the hairlines so they read against it. */
.sgm-studio .sgm-look-card {
  border-color: rgb(201 206 214 / 0.22);
  background: rgb(255 255 255 / 0.03);
}
.sgm-studio .sgm-look-card:hover { border-color: rgb(201 206 214 / 0.42); }
.sgm-studio .sgm-look-card.is-current,
.sgm-studio .sgm-look-card.is-current:hover { border-color: var(--sgm-silver); }

/* Variant picker (e.g. "White / M"). A translucent background made the native
   dropdown unreadable: browsers paint the option list on the control's own
   background, so a 5%-white fill collapsed to a white popup with white text.
   The control and its options are therefore explicitly LIGHT with navy text -
   readable even in browsers that ignore option styling and default to a white
   popup. */
.sgm-studio .sgm-look-card__variant {
  border-color: rgb(201 206 214 / 0.45);
  background: #eef1f6;
  color: var(--sgm-navy);
}
.sgm-studio .sgm-look-card__variant option {
  background: #ffffff;
  color: var(--sgm-navy);
}
.sgm-studio .sgm-look-card__variant option:disabled { color: #8b93a3; }

/* Ledger bar: red CTA so the block closes on a strong action. */
.sgm-studio .sgm-ctl__bar {
  margin-top: 22px;
  border-color: rgb(201 206 214 / 0.24);
  background: rgb(255 255 255 / 0.045);
}
/* "You save LE 220.00 (10%)" - the saving is the pill worth shouting about,
   so it takes the action red rather than the silver accent. */
.sgm-studio .sgm-ctl__save {
  color: #fff;
  background: var(--sgm-red);
  font-weight: 700;
}
.sgm-studio .sgm-ctl__buy {
  background: var(--sgm-red);
  border-color: var(--sgm-red);
  color: #fff;
}
.sgm-studio .sgm-ctl__buy:hover {
  background: var(--sgm-silver);
  border-color: var(--sgm-silver);
  color: var(--sgm-navy);
}

/* ---------- Motion ----------
   .sgm-studio--anim is added by JS, so if the script never runs nothing is
   hidden. Cards rise in on entry, and again each time a tab is switched. */
.sgm-studio--anim .sgm-studio__head,
.sgm-studio--anim .sgm-studio__tabs { opacity: 0; transform: translateY(14px); }
.sgm-studio--anim.is-in .sgm-studio__head { animation: sgm-st-rise .65s var(--sgm-ease) .05s forwards; }
.sgm-studio--anim.is-in .sgm-studio__tabs { animation: sgm-st-rise .65s var(--sgm-ease) .18s forwards; }

.sgm-studio--anim .sgm-look-card { opacity: 0; }
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-look-card {
  animation: sgm-st-rise .6s var(--sgm-ease) forwards;
}
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-look-card:nth-child(1) { animation-delay: .26s; }
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-look-card:nth-child(2) { animation-delay: .34s; }
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-look-card:nth-child(3) { animation-delay: .42s; }
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-look-card:nth-child(4) { animation-delay: .50s; }
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-look-card:nth-child(n+5) { animation-delay: .58s; }

.sgm-studio--anim .sgm-ctl__bar { opacity: 0; }
.sgm-studio--anim.is-in .sgm-studio__panel:not([hidden]) .sgm-ctl__bar {
  animation: sgm-st-rise .6s var(--sgm-ease) .62s forwards;
}

@keyframes sgm-st-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sgm-studio--anim .sgm-studio__head,
  .sgm-studio--anim .sgm-studio__tabs,
  .sgm-studio--anim .sgm-look-card,
  .sgm-studio--anim .sgm-ctl__bar { opacity: 1; transform: none; animation: none !important; }
  .sgm-studio.is-in .sgm-studio__frame::before { animation: none; }
  .sgm-studio__thumb { transition: none; }
}

@media (max-width: 749px) {
  .sgm-studio__frame { padding-inline: 14px; }
  .sgm-studio .sgm-ctl__buy { min-width: 100%; }
}
