/* Perfume room only — linked from /shop/perfume/ pages.
   Oval rings: jewellery-like mirror-gloss mahogany with two champagne-ivory
   light catches. Keeps 50% larger ovals, dark clean interiors, hover lift,
   and the tight filter / row spacing. */

:root {
  --perfume-rim-rest:
    linear-gradient(112deg,
      #1a0904 0%,
      #2b1208 6%,
      #6b2e16 12%,
      #8d4827 18%,
      #f4d5b8 22%,
      #fff3e6 26%,
      #fffaf5 29%,
      #fff3e6 32%,
      #f4d5b8 34%,
      #8d4827 42%,
      #6b2e16 52%,
      #2b1208 62%,
      #6b2e16 68%,
      #8d4827 72%,
      #f4d5b8 75%,
      #fff3e6 78%,
      #fffaf5 80%,
      #fff3e6 82%,
      #f4d5b8 85%,
      #8d4827 90%,
      #6b2e16 96%,
      #2b1208 100%);
  --perfume-rim-hover:
    linear-gradient(124deg,
      #2b1208 0%,
      #6b2e16 8%,
      #8d4827 14%,
      #f4d5b8 18%,
      #fff3e6 22%,
      #fffaf5 25%,
      #fff3e6 28%,
      #f4d5b8 32%,
      #8d4827 40%,
      #6b2e16 50%,
      #2b1208 58%,
      #6b2e16 64%,
      #8d4827 70%,
      #f4d5b8 73%,
      #fff3e6 76%,
      #fffaf5 79%,
      #fff3e6 82%,
      #f4d5b8 86%,
      #8d4827 92%,
      #6b2e16 97%,
      #2b1208 100%);
}

/* Sit the first oval row tight under the filter bar (~16px breathing
   room for the hover lift). Tighten the hero/layer space above the
   search bar so the collection starts closer to the title. */
body.room-perfume .hero {
  padding-bottom: 20px;
}

body.room-perfume .layer {
  padding-top: 20px;
}

body.room-perfume .filters,
body.room-perfume #filters.filters {
  margin-bottom: 0;
}

/* Stretch the Perfume page to XXL / edge-to-edge. Global --wrap is 1480px,
   which left wide empty side margins on 1920px+ screens. */
body.room-perfume .wrap {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 12px;
  box-sizing: border-box;
}

/* Tight row spacing down the page. perfume.css uses 64/80/88px row-gap
   and this file previously raised it to 100px at 1100px — that, plus the
   rotateX visual inset on the next row, made huge dead bands between rows. */
body.room-perfume .pgrid {
  width: 100%;
  max-width: none;
  padding-top: 16px;
  row-gap: 28px;
  column-gap: 28px;
}

@media (min-width: 720px) {
  body.room-perfume .pgrid {
    padding-top: 16px;
    row-gap: 32px;
    column-gap: 40px;
  }
}

@media (min-width: 1100px) {
  body.room-perfume .pgrid {
    padding-top: 16px;
    row-gap: 36px;
    column-gap: 56px;
  }
}

/* 8 perfumes: 4 equal columns on wide/XXL = two full rows, no orphans. */
@media (min-width: 1400px) {
  body.room-perfume .pgrid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding-top: 16px;
    row-gap: 36px;
    column-gap: 48px;
  }
  body.room-perfume .pcard {
    max-width: none;
    width: 100%;
  }
  body.room-perfume .pcard .pimg {
    max-width: none;
    width: 100%;
  }
}

body.room-perfume .pcard .pbody {
  padding-top: 18px;
}

body.room-perfume .pgrid,
body.room-perfume .pcard {
  overflow: visible;
}

body.room-perfume .pcard {
  max-width: 420px;
}

/* Same 4px reflecting metallic rim as .filters: opaque dark interior
   on padding-box, jewellery rim gradient only on the border-box.
   Base margin first; breakpoint overrides follow so they win. */
body.room-perfume .pcard .pimg {
  max-width: 378px;
  padding: 18px;
  box-sizing: border-box;
  /* rotateX(20deg) with origin 50% 100% leaves ~85–100px empty ABOVE the
     painted rim, while the oval bottom stays anchored above .pbody.
     Negative margin-top pulls the whole .pimg layout box up (unlike
     translateY, which left a matching hole between the oval and .pbody). */
  transform: rotateX(20deg);
  margin: -64px auto 0;
  border: 4px solid transparent;
  background-color: #0d0907;
  background-image:
    linear-gradient(108deg, transparent 0 44%, rgba(255, 243, 230, 0.22) 50%, transparent 56%),
    linear-gradient(180deg, #1a120c 0%, #0d0907 100%),
    var(--perfume-rim-rest);
  background-size: 180% 100%, auto, auto;
  background-repeat: no-repeat;
  background-position: var(--sweep-x) 0, 0 0, 0 0;
  background-origin: padding-box, padding-box, border-box;
  background-clip: padding-box, padding-box, border-box;
  box-shadow:
    0 1px 0 rgba(255, 243, 230, 0.45),
    0 18px 28px -16px rgba(0,0,0,.72),
    0 6px 14px -10px rgba(0,0,0,.45),
    0 0 0 1px #240e06,
    inset 0 1px 0 rgba(255, 243, 230, 0.72),
    inset 0 -2px 5px rgba(26, 9, 4, 0.72);
  transition:
    box-shadow .9s var(--ease),
    border-color .9s var(--ease),
    --sweep-x 2.2s var(--ease);
}


@media (min-width: 720px) {
  body.room-perfume .pcard .pimg {
    margin-top: -72px;
  }
}

@media (min-width: 1100px) {
  body.room-perfume .pcard .pimg {
    margin-top: -80px;
  }
}

/* Calm hover rim: ::before is a 4px ring only (mask punches out the
   centre so the bottle stays fully visible). Opacity fades 0→1; the
   resting border-box gradient is never swapped. ::after stays the glass crescent. */
body.room-perfume .pcard .pimg::before {
  content: "";
  display: block;
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  padding: 4px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 5;
  background: var(--perfume-rim-hover);
  opacity: 0;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transition: opacity .9s var(--ease);
}

body.room-perfume .pcard:hover .pimg::before,
body.room-perfume .pcard.is-hover .pimg::before {
  content: "";
  display: block;
  background: var(--perfume-rim-hover);
  opacity: 1;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* Keep the crescent; retint from rose to a clear glass highlight. */
body.room-perfume .pcard .pimg::after {
  background: linear-gradient(180deg,
    rgba(255, 248, 240, 0.45) 0%,
    rgba(255, 255, 255, 0.16) 36%,
    transparent 72%);
}

body.room-perfume .pcard .pimg-well {
  background: linear-gradient(180deg, #1a120c 0%, #0d0907 100%);
  box-shadow:
    0 0 0 1px #240e06,
    inset 0 1px 0 rgba(255, 243, 230, 0.22),
    inset 0 -1px 0 rgba(0,0,0,.42),
    inset 0 -8px 14px -10px rgba(0,0,0,.5);
  transition: box-shadow .9s var(--ease);
}

body.room-perfume .pcard:hover .pimg,
body.room-perfume .pcard.is-hover .pimg {
  transform: rotateX(20deg);
  border: 4px solid transparent;
  box-shadow:
    0 1px 0 rgba(255, 250, 245, 0.7),
    0 0 18px -6px rgba(255, 243, 230, 0.28),
    0 18px 30px -14px rgba(26, 9, 4, 0.62),
    0 8px 16px -10px rgba(0,0,0,.5),
    0 0 0 1px rgba(244, 213, 184, 0.55),
    inset 0 1px 0 rgba(255, 250, 245, 0.95),
    inset 0 -2px 5px rgba(26, 9, 4, 0.72);
}

body.room-perfume .pcard:hover .pimg-well,
body.room-perfume .pcard.is-hover .pimg-well {
  box-shadow:
    0 0 0 1px #7a391e,
    inset 0 1px 0 rgba(255, 243, 230, 0.28),
    inset 0 10px 18px rgba(14, 5, 2, 0.58),
    inset 0 -14px 22px rgba(26, 9, 4, 0.7),
    inset 0 0 16px rgba(26, 9, 4, 0.4),
    inset 0 -1px 0 rgba(0,0,0,.4);
}


/* Match Beauty's piano-slow hover: same translate, duration, and easing.
   perfume.css still sets translate: 0 -8px and a float of -6px; a -1.5px
   hover could drop the card downward when the float is paused mid-cycle.
   Beauty uses translate: 0 -10px over .9s var(--ease) so the card always
   rises past the float. Also keep box-shadow in the transition list so
   style.css .pcard:hover shadows cannot snap. */
body.room-perfume .pcard {
  transition:
    translate .9s var(--ease),
    box-shadow .9s var(--ease),
    --sweep-x 2.2s var(--ease),
    border-color .9s var(--ease);
}

body.room-perfume .pcard:hover,
body.room-perfume .pcard.is-hover {
  animation-play-state: paused;
  translate: 0 -10px;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  body.room-perfume .pcard:hover,
  body.room-perfume .pcard.is-hover {
    translate: 0 0;
    --sweep-x: -30%;
  }
  body.room-perfume .pcard .pimg::before {
    transition: opacity .9s var(--ease);
  }
}

/* DES-63: keep the framed hero panel aligned with .filters.
   This file loads after mahogany-oval-buttons.css and sets
   body.room-perfume .wrap { width: 100%; margin-inline: 0; padding-inline: ... }.
   Re-assert the more-specific hero wrap so those full-bleed wrap rules
   cannot shrink or un-pad the mahogany hero frame. */
body.room-perfume .hero .wrap {
  width: auto;
  max-width: none;
  margin-inline: 12px;
  padding: 32px 36px 36px;
}

@media (max-width: 719px) {
  body.room-perfume .hero .wrap {
    padding: 24px 22px 26px;
  }
}
