/* ============================================================================
   SIGMAN — Build Your Perfume Set (in-PDP bundle builder)
   Premium, mobile-first. Brand: navy #09244f / white / light gray.
   Scoped under .sgm-sb so nothing leaks into the rest of the product page.
   ========================================================================== */

.sgm-sb *,
.sgm-sb *::before,
.sgm-sb *::after { box-sizing: border-box; }

.sgm-sb {
  --sb-navy: #09244f;
  --sb-ink: #33475b;
  --sb-mut: #5b6b82;
  --sb-line: rgba(9, 36, 79, .1);
  --sb-soft: #eef1f5;
  --sb-surface: #f6f8fb;
  --sb-green: #1f9d57;
  margin: 14px 0 0;
  padding: 18px 16px 16px;
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: 18px;
  box-shadow: 0 2px 18px rgba(9, 36, 79, .06);
  color: var(--sb-ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ------------------------------------------------------------- */
.sgm-sb__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sgm-sb__title {
  margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2;
  letter-spacing: .01em; color: var(--sb-navy);
  display: flex; align-items: center; gap: 6px;
}
.sgm-sb__sub { margin: 4px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--sb-mut); }
.sgm-sb__badge {
  flex: 0 0 auto; align-self: center;
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--sb-navy); color: #fff;
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(9, 36, 79, .22);
}

/* ---- Segmented control (Any 2 / Any 3) --------------------------------- */
.sgm-sb__seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--sb-soft); border-radius: 12px; padding: 4px; margin: 15px 0 14px;
}
.sgm-sb__seg-btn {
  position: relative; z-index: 1; appearance: none; border: 0; background: transparent;
  padding: 11px 8px; font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--sb-navy); cursor: pointer; border-radius: 9px;
  transition: color .25s ease; -webkit-tap-highlight-color: transparent;
}
.sgm-sb__seg-btn small { display: block; font-size: 10px; font-weight: 600; opacity: .7; margin-top: 1px; }
.sgm-sb__seg-btn.is-active { color: #fff; }
.sgm-sb__seg-btn.is-active small { opacity: .85; }
.sgm-sb__seg-thumb {
  position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px);
  background: var(--sb-navy); border-radius: 9px; box-shadow: 0 4px 12px rgba(9, 36, 79, .25);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1); z-index: 0;
}

/* ---- Progress ---------------------------------------------------------- */
.sgm-sb__progress { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sgm-sb__step { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sb-navy); }
.sgm-sb__hint { font-size: 12px; color: var(--sb-mut); text-align: right; }

/* ---- "Your Bundle" chips ----------------------------------------------- */
.sgm-sb__label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-mut); margin: 0 0 8px; }
.sgm-sb__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 15px; padding: 0; }
.sgm-sb__chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sb-navy); color: #fff; border-radius: 999px; padding: 7px 10px 7px 11px;
  font-size: 12px; font-weight: 600; line-height: 1;
  opacity: 0; transform: scale(.82); transition: opacity .28s ease, transform .28s cubic-bezier(.34, 1.56, .64, 1);
}
.sgm-sb__chip.is-in { opacity: 1; transform: scale(1); }
.sgm-sb__chip svg { width: 14px; height: 14px; flex: 0 0 auto; color: #7fe0aa; }
.sgm-sb__chip em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .03em; opacity: .9; background: rgba(255, 255, 255, .16); padding: 2px 6px; border-radius: 6px; }
.sgm-sb__chip-x { appearance: none; border: 0; background: transparent; color: #fff; opacity: .65; font-size: 16px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; transition: opacity .15s; }
.sgm-sb__chip-x:hover { opacity: 1; }
.sgm-sb__chip--empty { background: transparent; color: #9aa8bb; border: 1px dashed rgba(9, 36, 79, .22); opacity: 1; transform: none; padding: 7px 12px; }

/* ---- Search ------------------------------------------------------------ */
.sgm-sb__search { position: relative; margin-bottom: 12px; }
.sgm-sb__search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--sb-mut); pointer-events: none; }
.sgm-sb__search input {
  width: 100%; border: 1px solid rgba(9, 36, 79, .16); border-radius: 12px;
  padding: 11px 14px 11px 38px; font: inherit; font-size: 14px; color: var(--sb-navy);
  background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.sgm-sb__search input::placeholder { color: #9aa8bb; }
.sgm-sb__search input:focus { border-color: var(--sb-navy); box-shadow: 0 0 0 3px rgba(9, 36, 79, .08); }

/* ---- Perfume grid ------------------------------------------------------ */
.sgm-sb__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sgm-sb__empty { grid-column: 1 / -1; text-align: center; color: var(--sb-mut); font-size: 13px; padding: 18px 0; }

.sgm-sb__card {
  position: relative; display: flex; flex-direction: column; text-align: left;
  padding: 8px; background: #fff; border: 1.5px solid var(--sb-line); border-radius: 14px;
  cursor: pointer; appearance: none; font: inherit; color: inherit; width: 100%;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.sgm-sb__card.is-hidden { display: none; }
.sgm-sb__card.is-current { order: -1; border-color: var(--sb-navy); background: linear-gradient(180deg, rgba(9, 36, 79, .05), #fff); }
.sgm-sb__card.is-selected { border-color: var(--sb-navy); box-shadow: 0 4px 16px rgba(9, 36, 79, .16); }
.sgm-sb__card.is-disabled,
.sgm-sb__card[aria-disabled="true"] {
  opacity: .35;
  filter: grayscale(60%) brightness(0.75) blur(0.6px);
  cursor: not-allowed;
  transition: opacity .25s ease, filter .25s ease;
}
.sgm-sb__card.is-just-added { animation: sgmsbpop .5s ease; }
.sgm-sb__card.sgm-sb--shake { animation: sgmsbshake .4s ease; }

.sgm-sb__media {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: linear-gradient(100deg, #eef1f5 30%, #f7f9fb 50%, #eef1f5 70%);
  background-size: 200% 100%; animation: sgmsbshimmer 1.5s linear infinite;
}
.sgm-sb__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sgm-sb__check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 999px;
  background: var(--sb-navy); color: #fff; display: flex; align-items: center; justify-content: center;
  transform: scale(0); transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  font-family: var(--font-heading--family, sans-serif);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.sgm-sb__check svg { width: 13px; height: 13px; }
.sgm-sb__card.is-selected .sgm-sb__check { transform: scale(1); }

.sgm-sb__chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--sb-navy);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-inline-end: 4px;
}

.sgm-sb__name { font-size: 12px; font-weight: 700; line-height: 1.25; letter-spacing: .01em; color: var(--sb-navy); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sgm-sb__price { font-size: 12px; font-weight: 600; color: var(--sb-mut); margin-top: 2px; }

.sgm-sb__pill {
  display: block; text-align: center; margin-top: 8px; padding: 6px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: var(--sb-navy);
  background: var(--sb-soft); transition: background .2s, color .2s;
}
.sgm-sb__card.is-selected .sgm-sb__pill { background: var(--sb-navy); color: #fff; }
.sgm-sb__pill--current { display: flex; align-items: center; justify-content: center; gap: 4px; background: rgba(9, 36, 79, .08); color: var(--sb-navy); }
.sgm-sb__pill--current svg { width: 12px; height: 12px; }

/* ---- Live price summary ------------------------------------------------ */
.sgm-sb__summary { margin-top: 16px; background: var(--sb-surface); border: 1px solid rgba(9, 36, 79, .08); border-radius: 14px; padding: 13px 16px; }
.sgm-sb__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 0; }
.sgm-sb__row span:first-child { color: var(--sb-mut); }
.sgm-sb__row--save span { color: var(--sb-green); font-weight: 700; }
.sgm-sb__row--total { border-top: 1px dashed rgba(9, 36, 79, .16); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 800; color: var(--sb-navy); }
.sgm-sb__row--total span:first-child { color: var(--sb-navy); }

/* ---- CTA --------------------------------------------------------------- */
.sgm-sb__cta {
  position: relative; width: 100%; margin-top: 14px; min-height: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; background: var(--sb-navy); color: #fff;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: .03em; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.sgm-sb__cta:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(9, 36, 79, .28); transform: translateY(-1px); }
.sgm-sb__cta:active:not(:disabled) { transform: translateY(0); }
.sgm-sb__cta:disabled { background: #c7cede; cursor: not-allowed; box-shadow: none; transform: none; }
.sgm-sb__cta.is-loading { color: transparent; }
.sgm-sb__cta.is-loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: sgmsbspin .7s linear infinite; }
.sgm-sb__cta.is-done { background: var(--sb-green); }

.sgm-sb__msg { margin: 8px 0 0; font-size: 12.5px; text-align: center; color: var(--sb-mut); min-height: 1em; }
.sgm-sb__msg.is-error { color: #c0392b; }

/* ---- Keyframes --------------------------------------------------------- */
@keyframes sgmsbspin { to { transform: rotate(360deg); } }
@keyframes sgmsbshimmer { to { background-position: -200% 0; } }
@keyframes sgmsbpop { 0% { transform: scale(1); } 40% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes sgmsbshake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* ---- Desktop / tablet -------------------------------------------------- */
@media (min-width: 750px) {
  .sgm-sb { padding: 22px 20px 20px; }
  .sgm-sb__grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .sgm-sb__card:not(.is-disabled):hover { border-color: rgba(9, 36, 79, .32); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(9, 36, 79, .1); }
  .sgm-sb__title { font-size: 19px; }
}
@media (min-width: 990px) {
  .sgm-sb__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Foldable: collapsed by default ------------------------------------ */
.sgm-sb__disc { cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.sgm-sb__disc::-webkit-details-marker { display: none; }
.sgm-sb__disc::marker { content: ''; }
.sgm-sb__disc:focus-visible { outline: 2px solid var(--sb-navy); outline-offset: 3px; border-radius: 10px; }
.sgm-sb__chev { flex: 0 0 auto; align-self: center; color: var(--sb-navy); display: inline-flex; transition: transform .3s ease; }
details.sgm-sb[open] .sgm-sb__chev { transform: rotate(180deg); }

/* ---- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sgm-sb *, .sgm-sb *::before, .sgm-sb *::after { animation: none !important; transition: none !important; }
  .sgm-sb__chip { opacity: 1; transform: none; }
  .sgm-sb__media { background: #eef1f5; }
}