/* Trio Primêr Ecommerce — compact & responsive category browser */
:root {
  color-scheme: dark;
  --pm-line: rgba(137, 218, 239, .3);
  --pm-ink: #f4f9fc;
  --pm-muted: #aac0d2;
}
* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body {
  color: var(--pm-ink);
  background: radial-gradient(circle at 12% 10%, rgba(46, 196, 213, .15), transparent 32rem),
              radial-gradient(circle at 88% 12%, rgba(77, 125, 234, .14), transparent 34rem),
              linear-gradient(145deg, #03101d, #08172b 52%, #0c1b35);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  position: relative;
}

/* Elegant loader prevents post-MFA blank screen */
.pm-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(3, 16, 29, .95);
  backdrop-filter: blur(16px);
  opacity: 1;
  transition: opacity .24s ease, visibility .24s ease;
}

.pm-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pm-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(137, 218, 239, .22);
  border-top-color: #3dd6df;
  border-radius: 50%;
  animation: pmSpin .8s linear infinite;
}

.pm-loader-text {
  font-size: .88rem;
  font-weight: 700;
  color: #c0ddf3;
  letter-spacing: .03em;
}

@keyframes pmSpin {
  to { transform: rotate(360deg); }
}

body.preauth .stage {
  opacity: 0;
  pointer-events: none;
}

/* Proportional Stage — avoids huge empty dead zones */
.stage {
  position: relative;
  width: 100%;
  height: 460px;
  max-width: 1040px;
  margin: clamp(8px, 3vh, 24px) auto;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0 !important;
  padding: clamp(10px, 2vh, 18px) clamp(12px, 3vw, 24px) !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  isolation: isolate;
  transition: opacity .25s ease;
}

.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: clamp(6px, 1.2vw, 14px);
  border: 1px solid rgba(132, 207, 236, .2);
  border-radius: clamp(16px, 2.5vw, 26px);
  background: linear-gradient(145deg, rgba(20, 46, 74, .45), rgba(6, 21, 39, .5));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 255, 255, .1);
  backdrop-filter: blur(20px) saturate(140%);
}

.deck {
  position: relative;
  display: block !important;
  width: 100% !important;
  max-width: 760px;
  height: 100% !important;
  min-height: 0;
  margin: 0 auto;
  align-self: center;
  justify-self: center;
  perspective: 1100px;
  transform-style: preserve-3d;
}

.deck > .card {
  position: absolute !important;
  top: 50%;
  left: 50%;
  display: grid !important;
  width: clamp(220px, 22vw, 280px) !important;
  aspect-ratio: 4 / 5;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(142, 216, 241, .28) !important;
  border-radius: 16px !important;
  background: rgba(10, 27, 48, .82) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .14) !important;
  backdrop-filter: blur(20px) saturate(140%);
  transform-origin: center;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
  cursor: pointer;
}

.deck > .card[data-offset="0"] {
  z-index: 12;
  transform: translate(-50%, -50%);
  opacity: 1;
  border-color: rgba(75, 221, 231, .65) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .52), 0 0 22px rgba(61, 214, 223, .22), inset 0 1px rgba(255, 255, 255, .2) !important;
}

.deck > .card[data-offset="-1"] {
  z-index: 8;
  transform: translate(-88%, -50%) translateZ(-6rem) rotateY(8deg) scale(.88);
  opacity: .52;
}

.deck > .card[data-offset="1"] {
  z-index: 8;
  transform: translate(-12%, -50%) translateZ(-6rem) rotateY(-8deg) scale(.88);
  opacity: .52;
}

.deck > .card[data-offset="-2"] {
  z-index: 4;
  transform: translate(-115%, -50%) translateZ(-12rem) scale(.75);
  opacity: .2;
}

.deck > .card[data-offset="2"] {
  z-index: 4;
  transform: translate(15%, -50%) translateZ(-12rem) scale(.75);
  opacity: .2;
}

.deck > .card.is-distant {
  visibility: hidden;
  pointer-events: none;
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: #071527;
}

.meta {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 52px;
  align-items: center;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, .1) !important;
  border-radius: 0 !important;
  background: rgba(8, 25, 46, .88) !important;
}

.label {
  min-width: 0;
  color: #f5fbff !important;
  font: 800 .84rem/1.2 "Space Grotesk", sans-serif !important;
  overflow-wrap: break-word;
}

.cta, .authBox button {
  min-height: 44px !important;
  padding: 6px 12px !important;
  border: 1px solid rgba(104, 225, 235, .42) !important;
  border-radius: 9px !important;
  color: #f4feff !important;
  background: linear-gradient(145deg, rgba(58, 200, 216, .42), rgba(52, 91, 180, .58)) !important;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .2) !important;
  font: 800 .72rem/1 "DM Sans", sans-serif !important;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease;
}

.cta:hover, .authBox button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.stage > .controls {
  position: relative !important;
  z-index: 30;
  inset: auto !important;
  display: flex !important;
  width: auto !important;
  align-items: center;
  justify-content: center;
  gap: 12px !important;
  margin: 0 auto !important;
  padding: 0 0 2px !important;
  transform: none !important;
}

.controls button {
  position: relative !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0, 212, 255, .5) !important;
  background: rgba(0, 212, 255, .12) !important;
  color: #d8f8ff !important;
  font-size: 1.1rem !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4), inset 0 0 12px rgba(0, 212, 255, .25), inset 0 1px 0 rgba(255, 255, 255, .4) !important;
  overflow: hidden !important;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s ease, background .18s ease, border-color .18s ease !important;
}

.controls button::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 15%;
  right: 15%;
  height: 38%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .05) 80%, transparent 100%);
  border-radius: 999px;
  pointer-events: none;
}

.controls button:hover {
  transform: scale(1.1) translateY(-2px);
  border-color: rgba(0, 212, 255, .9) !important;
  background: rgba(0, 212, 255, .24) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 24px rgba(0, 212, 255, .55), inset 0 0 16px rgba(0, 212, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .6) !important;
}

.controls button:active {
  transform: scale(0.96);
}

.logoWrap {
  position: absolute;
  z-index: 30;
  top: 14px;
  left: 14px;
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(151, 220, 240, .28);
  border-radius: 50%;
  background: rgba(13, 37, 62, .75);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .17);
  backdrop-filter: blur(14px);
}

.rotatingLogo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-link { display: contents; }

.authBox {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 16px;
  color: #fff;
  background: rgba(5, 19, 35, .94);
  text-align: center;
  backdrop-filter: blur(20px);
}

.authBox p {
  margin: 0 0 4px;
  font-weight: 750;
  font-size: .82rem;
}

.authBox button { width: 100%; }

.gallery-progress {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, #3dd6df, #4f8cff, transparent);
}

.back-to-top { display: none !important; }

/* Responsive adjustments for phones & tablets */
@media (max-width: 768px) {
  .stage {
    width: calc(100% - 8px);
    height: 430px;
    margin: 4px auto;
    padding: 8px !important;
    gap: 6px;
  }
  .stage::before {
    inset: 4px;
  }
  .deck {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
  }
  .deck > .card {
    width: min(72vw, 260px) !important;
    border-radius: 14px !important;
  }
  .deck > .card[data-offset="-1"] {
    transform: translate(-76%, -50%) translateZ(-7rem) scale(.82);
    opacity: .3;
  }
  .deck > .card[data-offset="1"] {
    transform: translate(-24%, -50%) translateZ(-7rem) scale(.82);
    opacity: .3;
  }
  .deck > .card[data-offset="-2"],
  .deck > .card[data-offset="2"] {
    visibility: hidden;
  }
  .logoWrap {
    top: 8px;
    left: 8px;
    width: 38px;
  }
  .controls button {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
}

@media (max-height: 560px) {
  .deck {
    height: min(100%, 390px) !important;
  }
  .deck > .card {
    width: min(55vh, 270px) !important;
  }
  .meta {
    min-height: 46px;
    padding: 6px 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck > .card { transition: none; }
  .gallery-progress { display: none; }
  .pm-spinner { animation: none; }
}

