/* consistency.css: one alignment pass over the final storefront.

   Loaded last, after the design sheets, so it can settle rules that are spread
   over final.css, store.css, suits.css and site.css. Every rule is scoped to
   :root[data-design="final"] and to a named component, and nothing here touches the
   cart, checkout, payment or account templates.

   The rules it enforces:
   - cards in one row share the same height, and their prices and calls to
     action sit on the same line across the row;
   - names are clamped to two lines, so a long name never pushes its price down;
   - sections use the full content width between the same two edges;
   - repeated controls (hero buttons, chips) have equal sizes;
   - partial rows are centred, never left hanging on one side. */

:root[data-design="final"] {
  --mx-gap-card: 8px;
  --mx-name-lines: 2;
}

/* ── Home: the full edit grid ─────────────────────────────────────────────── */
:root[data-design="final"] .dc-final-edit__grid { align-items: stretch; }
:root[data-design="final"] .dc-final-edit__item { display: flex; min-width: 0; }
:root[data-design="final"] .dc-final-edit__card { display: flex; flex-direction: column; width: 100%; }
:root[data-design="final"] .dc-final-edit__name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--mx-name-lines);
  line-clamp: var(--mx-name-lines); overflow: hidden;
  min-height: calc(var(--mx-name-lines) * 1.35em);
}
:root[data-design="final"] .dc-final-edit__meta { min-height: 1.5em; }
:root[data-design="final"] .dc-final-edit__cta {
  display: block; margin-top: auto; padding-top: var(--mx-gap-card);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
:root[data-design="final"] .dc-final-edit__card:hover .dc-final-edit__cta { color: var(--accent); }

/* The two filter rows read as one block: equal chip height, one gap. */
:root[data-design="final"] .dc-final-edit__chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
}

/* ── Shop and occasion pages: the card grid ───────────────────────────────── */
:root[data-design="final"] .grid--4 { align-items: stretch; }
:root[data-design="final"] .grid--4 > .card { height: 100%; }
:root[data-design="final"] .grid--4 .card__body { flex: 1 1 auto; }
:root[data-design="final"] .grid--4 .card__name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--mx-name-lines);
  line-clamp: var(--mx-name-lines); overflow: hidden;
  min-height: calc(var(--mx-name-lines) * 1.22em);
}
:root[data-design="final"] .grid--4 .card__sizes:last-child { margin-top: auto; }
/* Text-only related cards on product pages: the title takes two lines too. */
:root[data-design="final"] .grid--4 > .card > h3 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; line-height: 1.22; min-height: calc(2 * 1.22em);
}
/* The detail line is empty on some designs; reserving it keeps every price
   in a row on the same line. */
:root[data-design="final"] .grid--4 .card__meta {
  display: block; line-height: 1.4; min-height: 1.4em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Phones: two cards per row instead of one, so the shop is half as long and
   every row is a symmetric pair. */
@media (max-width: 600px) {
  :root[data-design="final"] .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; --mx-name-lines: 3; }
  :root[data-design="final"] .grid--4 .card__name { font-size: 15px; }
  :root[data-design="final"] .grid--4 .card__price { font-size: 15.5px; }
  :root[data-design="final"] .grid--4 .card__sizes { font-size: 11.5px; }
  :root[data-design="final"] .grid--4 .flag { font-size: 9.5px; padding: 4px 6px; }
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
/* Both calls to action are the same size. */
:root[data-design="final"] .dc-final-hero__ctas {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch;
}
:root[data-design="final"] .dc-final-hero__cta {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 14px 18px; text-decoration: none; box-sizing: border-box;
}
/* The strip lines up as one column, each line the same distance apart. */
:root[data-design="final"] .dc-final-hero__strip { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (max-width: 400px) {
  :root[data-design="final"] .dc-final-hero__strip { min-height: 0; }
}
@media (max-width: 700px) {
  :root[data-design="final"] .dc-final-hero__ctas { grid-template-columns: 1fr; }
  /* The photograph keeps the same side margins as the copy above it, in its
     own 2:3 shape, so no band is left on one side of the portrait. */
  :root[data-design="final"] .dc-final-hero picture { width: auto; margin: 0 14px; aspect-ratio: 2 / 3; }
  :root[data-design="final"] .dc-final-hero__bg { aspect-ratio: 2 / 3; object-fit: cover; object-position: center top; }
  :root[data-design="final"] .dc-final-hero__card { margin: 12px 14px 14px; }
}

/* ── Plan for your function: three equal columns ──────────────────────────── */
:root[data-design="final"] .dc-final-cal__track--even { grid-template-columns: repeat(3, minmax(0, 1fr)); }
:root[data-design="final"] .dc-final-cal__track--even .dc-final-cal__fig { margin-top: auto; padding-top: 16px; }
@media (max-width: 900px) {
  :root[data-design="final"] .dc-final-cal__track--even .dc-final-cal__col { flex: 0 0 78vw; }
}

/* ── Our commitments and the questions: full content width ────────────────── */
:root[data-design="final"] .dc-final-comm__table { max-width: none; }
:root[data-design="final"] .dc-final-comm__table td { max-width: none; }
:root[data-design="final"] .dc-final-faq__list { max-width: none; }
@media (min-width: 901px) {
  :root[data-design="final"] .dc-final-faq__list {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); column-gap: clamp(32px, 4vw, 64px);
  }
  :root[data-design="final"] .dc-final-faq__item dd { max-width: none; }
}

/* ── Product page ─────────────────────────────────────────────────────────── */
/* The summary line follows the column's left edge like everything around it. */
:root[data-design="final"] .suit-detail .lede { margin-left: 0; margin-right: 0; text-align: left; }
/* Thumbnails: five a row at a fixed size; a short last row is centred. */
:root[data-design="final"] .suit-product .gallery__thumbs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
:root[data-design="final"] .suit-product .gallery__thumbs button {
  flex: 0 0 calc((100% - 4 * 8px) / 5); aspect-ratio: 2 / 3; overflow: hidden;
}
:root[data-design="final"] .suit-product .gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
