/* ==========================================================================
   MIRADERM — product detail page
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero: gallery + buy box
   -------------------------------------------------------------------------- */
.product-hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--cream);
}

.product-gallery {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 28px;
  background: var(--blush);
}
.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gallery-thumb {
  height: 96px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  overflow: hidden;
  cursor: pointer;
  opacity: .58;
  transition: opacity .3s, border-color .3s;
}
.gallery-thumb.is-active { opacity: 1; border-color: var(--burgundy); }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb img { height: 100%; object-fit: cover; }

.gallery-main {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #d6bbb7;
  min-height: 520px;
}
.gallery-main img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  transition: opacity .35s, transform 1s var(--ease);
}
.gallery-main:hover img { transform: scale(1.03); }
.gallery-main.is-changing img { opacity: 0; }
.gallery-badge {
  position: absolute;
  left: 20px; top: 20px;
  z-index: 2;
  padding: 9px 13px;
  border-radius: 999px;
  background: #fff;
  color: var(--burgundy);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.gallery-zoom {
  position: absolute;
  right: 20px; bottom: 20px;
  z-index: 2;
  width: 50px; height: 50px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--burgundy);
  font-size: 22px;
  cursor: pointer;
  transition: transform .3s var(--ease);
}
.gallery-zoom:hover { transform: scale(1.08); }

.product-buybox {
  padding: 56px 5vw 52px;
  align-self: start;
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 38px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--muted);
}
.breadcrumbs b { color: var(--burgundy); }
.product-buybox h1 {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 68px);
  line-height: .92;
}
.product-headline {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.35;
  color: var(--burgundy);
  max-width: 34ch;
}
.rating-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 22px;
}
.rating-line span { color: var(--burgundy); letter-spacing: .12em; }
.rating-line small { font-size: 11px; color: var(--muted); }

.benefit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
}
.benefit-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.price-row strong { font-family: var(--serif); font-size: 36px; }
.price-row s { color: var(--muted); font-size: 18px; }
.price-row small { margin-left: auto; color: var(--muted); font-size: 12px; }

.purchase-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  margin-top: 22px;
}
.quantity-control {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.quantity-control button {
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  color: var(--burgundy);
}
.quantity-control button:hover { background: var(--blush); }
.product-add {
  min-height: 56px;
  justify-content: space-between;
  padding: 0 22px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
}
#buyNow { margin-top: 10px; min-height: 52px; }

.delivery-note {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 26px 0;
}
.delivery-note i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(92, 143, 103, .13);
  flex: 0 0 auto;
}
.delivery-note p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.delivery-note strong { color: var(--ink); }

.buy-accordions { border-top: 1px solid var(--line); }
.buy-accordions article { border-bottom: 1px solid var(--line); }
.buy-accordions > article > button {
  width: 100%;
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.buy-accordions > article > button b {
  font-size: 19px;
  font-weight: 400;
  color: var(--burgundy);
}
.buy-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s var(--ease);
}
.buy-answer.is-open { max-height: 420px; }
.buy-answer > div { padding-bottom: 22px; }
.buy-answer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.buy-answer ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Formula story
   -------------------------------------------------------------------------- */
.formula-story {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  min-height: 660px;
  background: var(--paper);
}
.formula-copy {
  padding: 9vw 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.formula-copy h2 {
  margin: 0 0 26px;
  font-size: clamp(34px, 4.6vw, 72px);
  line-height: .95;
}
.formula-copy h2 em { color: var(--burgundy); }
.formula-copy > p {
  max-width: 52ch;
  line-height: 1.85;
  color: var(--muted);
  margin: 0 0 8px;
}
.formula-copy .text-link { align-self: flex-start; margin-top: 22px; }
.formula-visual {
  position: relative;
  overflow: hidden;
  background: var(--blush);
  min-height: 440px;
}
.formula-visual img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
}
.formula-orbit {
  position: absolute;
  left: 50%; top: 50%;
  width: min(420px, 62%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 50%;
  animation: spin 22s linear infinite;
}
.formula-orbit span {
  position: absolute;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  white-space: nowrap;
}
.formula-orbit span:nth-child(1) { top: -6px; left: 50%; transform: translateX(-50%); }
.formula-orbit span:nth-child(2) { bottom: 12%; left: 2%; }
.formula-orbit span:nth-child(3) { right: -12px; top: 50%; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* --------------------------------------------------------------------------
   Ingredients
   -------------------------------------------------------------------------- */
.product-ingredients {
  padding: 100px var(--gutter);
  background: var(--burgundy-deep);
  color: #fff;
}
.pi-head { max-width: 640px; margin-bottom: 46px; }
.pi-head h2 {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 62px);
  line-height: 1;
}
.pi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.pi-card {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  padding: 26px 22px;
  transition: background .4s, transform .4s var(--ease);
}
.pi-card:hover { background: rgba(255, 255, 255, .07); transform: translateY(-4px); }
.pi-card span {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--rose);
}
.pi-card h3 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.02em;
}
.pi-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .68);
}
.pi-suitable {
  margin: 44px 0 0;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .55);
}
.pi-suitable strong { color: #fff; }

/* --------------------------------------------------------------------------
   Routine
   -------------------------------------------------------------------------- */
.routine-section {
  padding: 100px var(--gutter);
  background: var(--paper);
}
.routine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.routine-card {
  position: relative;
  background: var(--cream);
  border-radius: 16px;
  padding: 16px 16px 24px;
  transition: transform .45s var(--ease);
}
.routine-card:hover { transform: translateY(-8px); }
.routine-card > span {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--burgundy);
}
.routine-card img {
  aspect-ratio: 1/1.1;
  object-fit: cover;
  border-radius: 10px;
  margin: 14px 0;
  background: var(--blush);
}
.routine-card h3 {
  margin: 0 0 6px;
  font-size: 24px;
}
.routine-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.routine-card strong { font-family: var(--serif); font-size: 22px; }
.routine-card.is-current::after {
  content: "In this page";
  position: absolute;
  right: 16px; top: 16px;
  background: var(--burgundy);
  color: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.routine-card .routine-add {
  border: 0;
  background: transparent;
  color: var(--burgundy);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
  padding: 0;
  margin-top: 10px;
  border-bottom: 1px solid;
}

.routine-bundle {
  margin-top: 16px;
  background: var(--burgundy-deep);
  color: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.routine-bundle small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: rgba(255, 255, 255, .65);
}
.routine-bundle strong {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 28px;
}
.routine-bundle s { opacity: .5; font-size: 18px; }

/* --------------------------------------------------------------------------
   Texture break
   -------------------------------------------------------------------------- */
.texture-break {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.texture-break img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
}
.texture-break::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(52, 15, 23, .82), transparent 75%);
}
.texture-break > div {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter);
}
.texture-break h2 {
  margin: 0;
  font-size: clamp(40px, 7vw, 116px);
  line-height: .86;
}

/* --------------------------------------------------------------------------
   Reviews
   -------------------------------------------------------------------------- */
.product-reviews {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 5vw;
  padding: 100px var(--gutter);
  background: var(--cream);
}
.reviews-summary h2 { margin: 0 0 26px; font-size: clamp(34px, 4vw, 58px); }
.reviews-summary > strong {
  display: block;
  font-family: var(--serif);
  font-size: 84px;
  line-height: 1;
}
.reviews-summary > span { color: var(--burgundy); letter-spacing: .16em; }
.reviews-summary > p { margin-top: 12px; font-size: 12px; color: var(--muted); }
.review-list article {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.review-list article > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.review-list span { color: var(--burgundy); letter-spacing: .14em; }
.review-list small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.review-list h3 { margin: 20px 0 12px; font-size: clamp(24px, 2.6vw, 36px); }
.review-list p { margin: 0 0 14px; color: var(--muted); line-height: 1.7; }
.review-list b {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

/* --------------------------------------------------------------------------
   Final CTA
   -------------------------------------------------------------------------- */
.product-final-cta {
  padding: 120px var(--gutter);
  background: var(--burgundy);
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.product-final-cta > p {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  opacity: .8;
}
.product-final-cta h2 {
  margin: 26px 0 36px;
  font-size: clamp(48px, 9vw, 140px);
  line-height: .78;
}
.product-final-cta h2 em { color: var(--blush); }
.product-final-cta .btn { min-width: min(420px, 100%); }

/* --------------------------------------------------------------------------
   Lightbox + not found
   -------------------------------------------------------------------------- */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(31, 8, 14, .96);
  display: grid;
  place-items: center;
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, visibility .4s;
}
.image-lightbox.is-open { opacity: 1; visibility: visible; }
.image-lightbox img {
  max-width: 88vw;
  max-height: 86vh;
  width: auto;
  object-fit: contain;
  border-radius: 12px;
}
.image-lightbox button {
  position: absolute;
  right: 28px; top: 20px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 38px;
  cursor: pointer;
}

.not-found {
  padding: 140px var(--gutter);
  text-align: center;
}
.not-found h1 { font-size: clamp(36px, 5vw, 64px); margin: 0 0 14px; }
.not-found p { color: var(--muted); margin-bottom: 26px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1050px) {
  .product-hero,
  .formula-story,
  .product-reviews { grid-template-columns: 1fr; }
  .product-buybox { padding: 44px var(--gutter); }
  .formula-copy { padding: 70px var(--gutter); }
  .formula-visual { min-height: 480px; }
  .routine-grid { grid-template-columns: 1fr; }
  .reviews-summary { margin-bottom: 30px; }
  .gallery-main { min-height: 460px; }
}

@media (max-width: 620px) {
  .product-gallery {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }
  .gallery-main { min-height: 62vh; border-radius: 0; }
  .gallery-thumbs {
    order: 2;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
  }
  .gallery-thumbs::-webkit-scrollbar { display: none; }
  .gallery-thumb { flex: 0 0 72px; height: 72px; }
  .breadcrumbs { margin-bottom: 26px; }
  .price-row { flex-wrap: wrap; }
  .price-row small { margin-left: 0; width: 100%; }
  .purchase-row { grid-template-columns: 100px 1fr; }
  .product-ingredients, .routine-section,
  .product-reviews { padding: 74px var(--gutter); }
  .texture-break { min-height: 56vh; }
  .product-final-cta { padding: 90px var(--gutter); }
  .routine-bundle { flex-direction: column; align-items: flex-start; }
  .routine-bundle .btn { width: 100%; }
}
