/* ==========================================================================
   Products section — added 28 September 2026.
   Built only from the original theme's tokens. styles.css is deliberately
   left untouched so the approved interface stays byte-identical.
   ========================================================================== */

.products-section {
  background: linear-gradient(180deg, #fff 0%, var(--navy-50) 55%, #fff 100%);
}

.products { display: grid; gap: 1.75rem; }

/* ---------- Product card ---------- */
.product {
  display: grid;
  grid-template-columns: minmax(260px, 5fr) 7fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.product:hover { box-shadow: var(--sh-lg); border-color: rgba(176, 195, 54, .55); }

/* Alternate the photo side so the two products read as a sequence. The column
   widths must flip with it, or the text lands in the narrow column. */
.product:nth-child(even) { grid-template-columns: 7fr minmax(260px, 5fr); }
.product:nth-child(even) .product__stage { order: 2; }

.product__stage {
  position: relative;
  display: grid;
  justify-items: center;
  /* Stand the bottle on the stage floor, so the floor shadow below always
     lines up with its base however tall the card grows. */
  align-items: end;
  padding: 3rem 1.5rem 3.25rem;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(55% 50% at 50% 42%, rgba(176, 195, 54, .28), transparent 72%),
    linear-gradient(160deg, #EEF3FA 0%, #DCE6F3 100%);
}
/* Beauty's label is khaki, so its stage is warm rather than blue. */
.product__stage--warm {
  background:
    radial-gradient(55% 50% at 50% 42%, rgba(214, 196, 150, .5), transparent 72%),
    linear-gradient(160deg, #F7F3EB 0%, #E9E1D2 100%);
}

/* Dashed ring behind the bottle */
.product__stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  /* centred on the bottle: stage padding + half the bottle's height */
  bottom: calc(3.25rem + 160px);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px dashed rgba(28, 63, 119, .2);
  transform: translate(-50%, 50%);
  transition: transform .8s var(--ease);
}
/* Soft floor shadow, sitting under the bottle's base */
.product__stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: calc(3.25rem - 12px);
  width: 150px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(16, 32, 58, .34), transparent);
  transform: translateX(-50%);
  transition: transform .55s var(--ease), opacity .55s var(--ease);
}

.product__img {
  width: auto;
  height: 320px;
  filter: drop-shadow(0 16px 18px rgba(16, 32, 58, .16));
  transition: transform .55s var(--ease);
}
.product:hover .product__img { transform: translateY(-9px) rotate(-2deg); }
.product:hover .product__stage::after { transform: translateX(-50%) scale(.82); opacity: .65; }
.product:hover .product__stage::before { transform: translate(-50%, 50%) rotate(40deg) scale(1.04); }

.product__size {
  position: absolute;
  inset-block-start: 1.1rem;
  inset-inline-start: 1.1rem;
  padding: .35rem 1rem;
  border-radius: var(--r-pill);
  background: var(--navy);
  color: #fff;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .85rem;
  box-shadow: 0 6px 16px rgba(28, 63, 119, .25);
}

.product__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.6rem, 3vw, 2.6rem);
}
.product__cat {
  align-self: flex-start;
  display: inline-block;
  margin-block-end: .8rem;
  padding: .28rem .95rem;
  border-radius: var(--r-pill);
  background: var(--lime-100);
  color: var(--lime-700);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .8rem;
}
.product__name { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-block-end: .1rem; }
.product__latin {
  margin-block-end: .9rem;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .08em;
  color: var(--muted);
}
/* The Latin name is always LTR text; keep it on the same side as the heading. */
html[dir="rtl"] .product__latin { text-align: right; }
html[dir="ltr"] .product__latin { text-align: left; }
.product__desc { margin-block-end: .2rem; }
.product__points {
  grid-template-columns: 1fr 1fr;
  gap: .6rem 1.25rem;
  margin-block: 1.1rem 1.5rem;
}
.product__points li { font-size: .95rem; }
.product__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.product__more { padding-inline: .5rem; }

/* ---------- How the active ingredient works ---------- */
.mechanism {
  position: relative;
  margin-block-start: clamp(2.5rem, 5vw, 3.5rem);
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, var(--navy-900) 0%, var(--navy) 60%, var(--navy-600) 100%);
  color: rgba(255, 255, 255, .8);
  overflow: hidden;
  isolation: isolate;
}
.mechanism::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(176, 195, 54, .22) 1.6px, transparent 1.7px);
  background-size: 34px 34px;
  mask-image: linear-gradient(200deg, #000 0%, transparent 60%);
}
.mechanism__head { max-width: 780px; margin-block-end: 2rem; }
.mechanism__head h3 { color: #fff; font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
.mechanism__head p { margin: 0; color: rgba(255, 255, 255, .78); }

.mechanism__steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.mechanism__step {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .13);
  transition: background .3s, border-color .3s, transform .35s var(--ease);
}
.mechanism__step:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(176, 195, 54, .5);
  transform: translateY(-4px);
}
.mechanism__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-block-end: 1rem;
  border-radius: 16px;
  background: rgba(176, 195, 54, .16);
  color: var(--lime-on-navy);
}
.mechanism__icon svg { width: 34px; height: 34px; }
.mechanism__num {
  position: absolute;
  inset-block-start: 1.1rem;
  inset-inline-end: 1.4rem;
  font-family: var(--f-head);
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  color: rgba(255, 255, 255, .13);
}
.mechanism__step h4 { color: #fff; font-size: 1.08rem; margin-block-end: .4rem; }
.mechanism__step p { margin: 0; font-size: .93rem; color: rgba(255, 255, 255, .76); }

/* Arrow between steps, pointing in the reading direction */
.mechanism__step:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset-block-start: 2.55rem;
  inset-inline-end: -1.18rem;
  width: 1rem;
  height: 1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B0C336' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
html[dir="rtl"] .mechanism__step:not(:last-child)::after { transform: scaleX(-1); }

.mechanism__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-block-start: 1.75rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid rgba(255, 255, 255, .14);
}
.mechanism__foot p { margin: 0; color: rgba(255, 255, 255, .88); font-weight: 500; }

/* ---------- Product detail dialog ---------- */
html.dialog-open { overflow: hidden; }

.product-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: #fff;
  color: var(--body);
  box-shadow: 0 30px 80px rgba(10, 22, 40, .35);
  overflow: hidden;
}
.product-dialog::backdrop { background: rgba(10, 22, 40, .6); backdrop-filter: blur(4px); }
.product-dialog[open] { animation: dialogIn .38s var(--ease); }
.product-dialog[open]::backdrop { animation: backdropIn .38s ease; }
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.product-dialog__inner {
  position: relative;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.4rem, 4vw, 2.25rem);
}
.product-dialog__close {
  position: absolute;
  inset-block-start: .85rem;
  inset-inline-end: .85rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy-50);
  color: var(--navy);
  font-size: 1.3rem;
  transition: background .2s, transform .25s var(--ease);
}
.product-dialog__close:hover { background: var(--navy-100); transform: rotate(90deg); }

.product-dialog__head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-block-end: 1.5rem;
  padding-inline-end: 3rem;
}
.product-dialog__thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 96px;
  height: 150px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #EEF3FA, #DCE6F3);
}
.product-dialog__thumb--warm { background: linear-gradient(160deg, #F7F3EB, #E9E1D2); }
.product-dialog__thumb img { width: auto; height: 132px; }
.product-dialog__head h3 { font-size: 1.5rem; margin-block-end: 0; }
/* A long category can wrap in the narrow dialog head; a pill radius would
   turn two lines into an oval. */
.product-dialog__head .product__cat { border-radius: 12px; line-height: 1.6; }
.product-dialog__head .product__latin { margin-block-end: 0; }
.product-dialog h4 { font-size: 1.02rem; margin: 1.4rem 0 .6rem; }

.spec { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0; }
.spec > div {
  padding: .8rem 1rem;
  border-radius: var(--r);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
}
.spec > div:first-child { grid-column: 1 / -1; }
.spec dt { font-size: .78rem; color: var(--muted); }
.spec dd {
  margin: .15rem 0 0;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--navy);
}
.spec sub { font-size: .7em; }
html[dir="rtl"] .spec dd[dir="ltr"] { text-align: right; }

.product-dialog .checklist { margin-block: .4rem 0; gap: .5rem; }
.spec-list { display: grid; gap: .45rem; }
.spec-list li { position: relative; padding-inline-start: 1.4rem; font-size: .93rem; }
.spec-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .72rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
}
.product-dialog__note {
  margin: 1.4rem 0 1.2rem;
  padding: .85rem 1.1rem;
  border-radius: var(--r);
  background: var(--lime-100);
  color: var(--lime-700);
  font-weight: 600;
  font-size: .9rem;
}
.product-dialog__actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.product-dialog__actions .btn { flex: 1 1 180px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product,
  .product:nth-child(even) { grid-template-columns: 1fr; }
  .product:nth-child(even) .product__stage { order: 0; }
  .product__stage { padding-block: 2.8rem 3rem; }
  .product__stage::after { bottom: calc(3rem - 12px); }
  .product__img { height: 270px; }
  .product__stage::before { width: 220px; height: 220px; bottom: calc(3rem + 135px); }

  .mechanism__steps { grid-template-columns: 1fr; gap: 1.6rem; }
  /* Steps stack, so the arrows point down between them */
  html[dir] .mechanism__step:not(:last-child)::after {
    inset-block-start: auto;
    inset-inline-end: auto;
    right: auto;
    left: 50%;
    bottom: -1.3rem;
    transform: translateX(-50%) rotate(90deg);
  }
}

@media (max-width: 560px) {
  .product__points { grid-template-columns: 1fr; }
  .product__actions .btn { flex: 1 1 100%; }
  .mechanism__foot .btn { width: 100%; }
  .spec { grid-template-columns: 1fr; }
  .product-dialog__head { gap: .9rem; }
  .product-dialog__thumb { width: 78px; height: 122px; }
  .product-dialog__thumb img { height: 106px; }
}

@media (prefers-reduced-motion: reduce) {
  .product:hover .product__img,
  .product:hover .product__stage::before,
  .mechanism__step:hover { transform: none; }
}

@media print {
  .product-dialog, .product__actions, .mechanism__foot .btn { display: none !important; }
}
