/* =========================================================================
   ORA — components: buttons, cards, forms, badges
   ========================================================================= */

/* --- buttons ------------------------------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--c-ink);
  --btn-bd: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 52px;
  padding-inline: var(--s-6);
  padding-block: var(--s-3);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--t-sm);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition:
    background-color var(--d-base) var(--ease),
    border-color var(--d-base) var(--ease),
    color var(--d-base) var(--ease),
    opacity var(--d-base) var(--ease);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn__icon {
  width: 16px;
  height: 16px;
  stroke: currentcolor;
  stroke-width: 1.5;
  transition: translate var(--d-base) var(--ease);
}

/* Forward motion in RTL is leftward — the chevron and its hover nudge both
   follow the reading direction, never a hard-coded translateX. */
.btn:hover .btn__icon { translate: -4px 0; }

/* Gold carries dark ink, not white. White on #d4a574 measures 2.2:1 — it
   failed AA outright, and it also flattened the accent into a pale slab.
   Ink on gold measures 8.3:1 and reads like a pressed metal plate. */
.btn--gold {
  --btn-bg: var(--c-gold);
  --btn-fg: #14120f;
  --btn-bd: var(--c-gold);
  font-weight: 600;
  box-shadow: var(--glow-gold);
}
.btn--gold:hover {
  --btn-bg: var(--c-gold-2);
  --btn-bd: var(--c-gold-2);
  box-shadow: 0 10px 32px -8px rgb(212 165 116 / 52%);
}

/* `--btn-bg: var(--c-ink)` under the dark palette resolved to a cream-white
   slab — so "add to cart" and "complete purchase", the two buttons the whole
   site exists to get pressed, rendered as the only unstyled-looking elements
   on the page. Gold is the brand and the buy signal, so the solid tier is
   gold and .btn--dark now resolves to it rather than keeping a second solid
   style that only differed by being wrong. */
.btn--dark { --btn-bg: var(--c-gold); --btn-fg: #14120f; --btn-bd: var(--c-gold); }
.btn--dark { font-weight: 600; box-shadow: var(--glow-gold); }
.btn--dark:hover {
  --btn-bg: var(--c-gold-2);
  --btn-bd: var(--c-gold-2);
  box-shadow: 0 10px 32px -8px rgb(212 165 116 / 52%);
}

.btn--ghost { --btn-bd: var(--c-line-2); --btn-fg: var(--c-ink); }
.btn--ghost:hover { --btn-bd: var(--c-gold); --btn-fg: var(--c-gold); --btn-bg: rgb(212 165 116 / 7%); }

.btn--light { --btn-bd: var(--c-line-dark); --btn-fg: var(--c-ink); }
.btn--light:hover { --btn-bg: rgb(245 243 240 / 10%); --btn-bd: rgb(245 243 240 / 45%); }

.btn--block { width: 100%; }
.btn--sm { min-height: 42px; padding-inline: var(--s-4); font-size: var(--t-xs); }

/* Text link with a rule that draws in from the reading edge. */
.link-line {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-ink);
  font-size: var(--t-sm);
  padding-block-end: 3px;
  background-image: linear-gradient(var(--c-gold), var(--c-gold));
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 100% 1px;
  transition: background-size var(--d-base) var(--ease), color var(--d-base) var(--ease);
}

.link-line:hover { background-size: 0% 1px; color: var(--c-gold); }
.link-line svg { width: 14px; height: 14px; stroke: currentcolor; stroke-width: 1.5; }

/* --- icon button --------------------------------------------------------- */

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  color: var(--c-ink);
  transition: background-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}

.icon-btn:hover { background: rgb(245 243 240 / 9%); color: var(--c-gold); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentcolor; stroke-width: 1.4; }

.icon-btn__count {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 1px;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--c-gold);
  color: #14120f;
  font-size: 0.6875rem;
  line-height: 1;
  font-weight: 600;
  scale: 0;
  transition: scale var(--d-base) var(--ease);
}

.icon-btn__count.is-visible { scale: 1; }

/* --- badges -------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 4px var(--s-3);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  color: var(--c-ink);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.badge--gold { background: var(--c-gold); color: #14120f; font-weight: 600; }
.badge--sale { background: var(--c-sale); color: #fff; }
/* Sits over photography, not over a card surface — a low-opacity tint
   disappears against a busy image, so this stays near-opaque. */
.badge--soft {
  background: rgb(7 10 13 / 78%);
  backdrop-filter: blur(6px);
  border: 1px solid rgb(212 165 116 / 32%);
  color: var(--c-gold-2);
}
.badge--out { background: rgb(7 10 13 / 72%); color: var(--c-ink-2); backdrop-filter: blur(4px); }

/* --- product card -------------------------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    border-color var(--d-base) var(--ease),
    box-shadow var(--d-base) var(--ease),
    translate var(--d-base) var(--ease);
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--c-line-2);
    box-shadow: var(--shadow-lift);
    translate: 0 -4px;
  }
}

.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--c-bg-alt);
}

/* The veil sits above the photograph and below the controls. It is what
   stops a white-background shot from punching a hole in the grid. */
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--grade-veil);
  transition: opacity var(--d-base) var(--ease);
}

@media (hover: hover) {
  .card:hover .card__media::after { opacity: 0.55; }
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--grade-img);
  transition: scale var(--d-slow) var(--ease), filter var(--d-base) var(--ease);
}

@media (hover: hover) {
  .card:hover .card__img { scale: 1.045; filter: var(--grade-img-hover); }
}

/* Top-left in an RTL page is the inline-end corner — the spot the eye lands
   on last, which is where a secondary action belongs. */
.card__wish {
  position: absolute;
  inset-block-start: var(--s-3);
  inset-inline-end: var(--s-3);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: rgb(7 10 13 / 55%);
  backdrop-filter: blur(8px);
  border: 1px solid rgb(245 243 240 / 12%);
  color: var(--c-ink-2);
  transition: background-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}

.card__wish svg {
  width: 17px;
  height: 17px;
  stroke: currentcolor;
  stroke-width: 1.4;
  transition: fill var(--d-fast) var(--ease);
}

.card__wish:hover { background: rgb(7 10 13 / 80%); border-color: rgb(212 165 116 / 40%); color: #e0655a; }
.card__wish[aria-pressed="true"] { color: #e0655a; }
.card__wish[aria-pressed="true"] svg { fill: currentcolor; }

.card__flags {
  position: absolute;
  inset-block-start: var(--s-3);
  inset-inline-start: var(--s-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}

/* Quick-add slides up over the image on hover; on touch it is always
   visible, since there is no hover to reveal it. */
.card__quick {
  position: absolute;
  inset-inline: var(--s-3);
  inset-block-end: var(--s-3);
  z-index: 2;
  min-height: 44px;
  background: rgb(7 10 13 / 72%);
  backdrop-filter: blur(10px);
  border: 1px solid rgb(212 165 116 / 30%);
  color: var(--c-ink);
  font-size: var(--t-xs);
  font-weight: 500;
}

.card__quick:hover { background: var(--c-gold); color: #14120f; border-color: var(--c-gold); }

@media (hover: hover) {
  .card__quick {
    opacity: 0;
    translate: 0 8px;
    transition:
      opacity var(--d-base) var(--ease),
      translate var(--d-base) var(--ease),
      background-color var(--d-base) var(--ease),
      color var(--d-base) var(--ease);
  }

  .card:hover .card__quick,
  .card__quick:focus-visible { opacity: 1; translate: 0 0; }
}

.card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-4);
  text-align: center;
  flex: 1;
}

.card__name {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--c-ink);
  line-height: var(--lh-tight);
}

.card__brand {
  font-size: var(--t-xs);
  color: var(--c-ink-3);
}

.card__meta {
  font-size: 0.75rem;
  color: var(--c-ink-3);
}

.card__price {
  margin-block-start: var(--s-2);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-ink);
}

.price__unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--c-ink-3);
  margin-inline-start: 2px;
}

.price--was {
  font-size: var(--t-xs);
  font-weight: 400;
  color: var(--c-ink-3);
  text-decoration: line-through;
}

.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* --- product grid -------------------------------------------------------- */

.grid-products {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

/* The reference art shows five across. Five only survives on very wide
   viewports; below that the cards get too narrow for a Persian name plus a
   brand plus a price, so the grid steps down to four. */
@media (min-width: 1500px) {
  .grid-products--five { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 560px) {
  .grid-products {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-3);
  }

  .card__body { padding: var(--s-4) var(--s-3); }
  .card__name { font-size: 0.9375rem; }
}

/* --- form controls ------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--s-2); }

.field__label {
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--c-ink);
}

.field__hint { font-size: 0.75rem; color: var(--c-ink-3); }

.field__error {
  font-size: 0.75rem;
  color: var(--c-sale);
  display: none;
}

.field.is-invalid .field__error { display: block; }
.field.is-invalid .input { border-color: var(--c-sale); }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 50px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-ink);
  font-size: var(--t-sm);
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--c-ink-3); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgb(169 138 86 / 16%);
}

.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }

.select {
  appearance: none;
  padding-inline-end: var(--s-7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23938b7e' stroke-width='1.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: left var(--s-4) center;
}

/* --- choice chips (sizes, filters) --------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-full);
  background: var(--c-surface);
  color: var(--c-ink-2);
  font-size: var(--t-xs);
  cursor: pointer;
  transition:
    border-color var(--d-fast) var(--ease),
    background-color var(--d-fast) var(--ease),
    color var(--d-fast) var(--ease);
}

.chip:hover { border-color: var(--c-ink-3); color: var(--c-ink); }

.chip input { position: absolute; opacity: 0; pointer-events: none; }

/* Was a solid --c-ink fill, i.e. a white block once the palette went dark.
   A tinted gold wash with a full-strength gold edge reads as selected at a
   glance without competing with the buy button beside it. */
.chip:has(input:checked) {
  border-color: var(--c-gold);
  background: rgb(212 165 116 / 14%);
  color: var(--c-ink);
  box-shadow: inset 0 0 0 1px rgb(212 165 116 / 45%);
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.chip--size {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 96px;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  text-align: center;
}

.chip--size .chip__vol { font-size: var(--t-sm); font-weight: 500; color: inherit; }
.chip--size .chip__price { font-size: 0.75rem; color: var(--c-ink-3); }
.chip--size:has(input:checked) .chip__price { color: var(--c-gold-2); }

.chip--size:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.chip__perml {
  font-size: 0.6875rem;
  color: var(--c-ink-3);
  margin-block-start: 2px;
}

.chip--size:has(input:checked) .chip__perml { color: rgb(245 243 240 / 62%); }

/* Cheapest millilitre in the range. */
.chip--best { padding-block-start: var(--s-5); }

.chip__flag {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  padding: 2px var(--s-2);
  border-end-end-radius: var(--r-sm);
  background: var(--c-gold);
  color: #14120f;
  font-size: 0.625rem;
  line-height: 1.5;
  font-weight: 500;
}

/* --- quantity stepper ---------------------------------------------------- */

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.qty__btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  color: var(--c-ink-2);
  transition: background-color var(--d-fast) var(--ease);
}

.qty__btn:hover:not(:disabled) { background: rgb(245 243 240 / 8%); color: var(--c-gold); }
.qty__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.qty__btn svg { width: 15px; height: 15px; stroke: currentcolor; stroke-width: 1.6; }

.qty__value {
  min-width: 44px;
  text-align: center;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}

/* --- notes pyramid ------------------------------------------------------- */

.notes { display: grid; gap: var(--s-5); }

.note-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: start;
  gap: var(--s-4);
  padding-block-end: var(--s-5);
  border-block-end: 1px solid var(--c-line);
}

.note-row:last-child { border-block-end: 0; padding-block-end: 0; }

.note-row__label {
  font-size: var(--t-xs);
  color: var(--c-gold);
  padding-block-start: 3px;
}

.note-row__values { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.note-pill {
  padding: 3px var(--s-3);
  border: 1px solid var(--c-line);
  border-radius: var(--r-full);
  background: var(--c-bg-alt);
  font-size: var(--t-xs);
  color: var(--c-ink-2);
}

/* --- meters (longevity / sillage) ---------------------------------------- */

.meter { display: grid; gap: var(--s-2); }

.meter__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  font-size: var(--t-xs);
}

.meter__label { color: var(--c-ink-2); }
.meter__value { color: var(--c-ink-3); }

.meter__track {
  height: 3px;
  border-radius: var(--r-full);
  background: var(--c-line);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  width: var(--meter, 0%);
  border-radius: inherit;
  background: var(--c-gold);
  transition: width var(--d-slow) var(--ease);
}

/* --- accordion ----------------------------------------------------------- */

.acc { border-block-start: 1px solid var(--c-line); }
.acc:last-of-type { border-block-end: 1px solid var(--c-line); }

.acc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  padding-block: var(--s-5);
  color: var(--c-ink);
  font-size: var(--t-sm);
  font-weight: 500;
  text-align: start;
}

.acc__icon {
  width: 16px;
  height: 16px;
  stroke: currentcolor;
  stroke-width: 1.5;
  transition: rotate var(--d-base) var(--ease);
  flex: none;
}

.acc__head[aria-expanded="true"] .acc__icon { rotate: 180deg; }

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--d-base) var(--ease);
}

.acc__panel[data-open="true"] { grid-template-rows: 1fr; }

.acc__panel > div { overflow: hidden; }

.acc__body {
  padding-block-end: var(--s-5);
  font-size: var(--t-sm);
  color: var(--c-ink-2);
}

/* --- toast --------------------------------------------------------------- */

.toast {
  position: fixed;
  inset-block-end: var(--s-6);
  inset-inline-start: var(--s-6);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  max-width: min(400px, calc(100vw - 2 * var(--s-6)));
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  border: 1px solid rgb(212 165 116 / 26%);
  color: var(--c-ink);
  font-size: var(--t-sm);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  translate: 0 16px;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease), translate var(--d-base) var(--ease);
}

.toast.is-visible { opacity: 1; translate: 0 0; }
.toast svg { width: 18px; height: 18px; stroke: var(--c-gold-2); stroke-width: 1.6; flex: none; }

@media (max-width: 560px) {
  .toast {
    inset-inline: var(--s-4);
    inset-block-end: var(--s-4);
    max-width: none;
  }
}
