/* s-catalog.css — catalog family home sections: categories, quick links, brands, logos (see docs/BUILD-GUIDE.md).
   Carousels use the core .cr component; "grid on mobile" modes turn the track into a grid, so core.js marks the
   carousel .is-static (no overflow) and hides its arrows/progress. */

/* the carousel track's overflow clips outer focus rings, so tiles draw theirs inside */
.ctg__item:focus-visible, .qlk__item:focus-visible, .cs2__card:focus-visible, .cs3__card:focus-visible, .brd__item:focus-visible, .lmq__logo:focus-visible { outline-offset: -3px; }

/* ---------- category-section (.ctg) ---------- */
.ctg__item { display: grid; justify-items: center; align-content: start; gap: 10px; text-align: center; }
.ctg__media { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 8%; overflow: hidden; border-radius: 50%; background: color-mix(in srgb, var(--c-primary) 9%, transparent); }
.ctg__media img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform .5s var(--ease); }
.ctg--square .ctg__media { border-radius: var(--radius); }
.ctg--square .ctg__media img { border-radius: var(--radius-sm); }
.ctg--plain .ctg__media { padding: 0; background: none; }
.ctg__item:hover .ctg__media img { transform: scale(1.07); }
.ctg__ph { color: var(--c-primary); font-size: 2rem; font-weight: 700; }
.ctg__name { color: var(--ctg-fg, inherit); font-size: .875rem; font-weight: 600; line-height: 1.4; transition: color .2s; }
.ctg__item:hover .ctg__name { color: var(--c-primary); }
@media (min-width: 768px) { .ctg__name { font-size: .9375rem; } }
@media (max-width: 767px) {
  .ctg--grid-m .cr__track { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); overflow: visible; }
  .ctg--grid-m .cr__arrow, .ctg--grid-m .cr__progress { display: none; }
}

/* ---------- category-list (.ctl): image_radius round|medium|sharp, image_full_size = edge-to-edge cover ---------- */
.ctl { --ctl-r: 50%; row-gap: clamp(18px, 2.5vw, 30px); }
.ctl--medium .ctl { --ctl-r: var(--radius); }
.ctl--sharp .ctl { --ctl-r: 0px; }
.ctl__item { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; }
.ctl__media { display: grid; place-items: center; width: 100%; aspect-ratio: 1; margin-block-end: 6px; padding: 12%; overflow: hidden; border-radius: var(--ctl-r); background: var(--c-surface); }
.ctl__media img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--ctl-r); transition: transform .5s var(--ease); }
.ctl--full .ctl__media { padding: 0; }
.ctl--full .ctl__media img { object-fit: cover; }
a.ctl__item:hover .ctl__media img { transform: scale(1.06); }
.ctl__title { color: var(--ctl-t, var(--c-text)); font-size: .9375rem; font-weight: 700; line-height: 1.4; }
.ctl__sub { color: var(--ctl-s, var(--c-muted)); font-size: .8125rem; }

/* ---------- quick-links (.qlk): two rows per breakpoint, grid on mobile ---------- */
.qlk__item { display: block; aspect-ratio: 136 / 200; overflow: hidden; border-radius: var(--radius-sm); background: var(--c-surface); }
.qlk__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
a.qlk__item:hover img { transform: scale(1.05); }
@media (min-width: 768px) { .qlk--r2-d .cr__track { grid-template-rows: repeat(2, auto); } }
@media (max-width: 767px) {
  .qlk--r2-m .cr__track { grid-template-rows: repeat(2, auto); }
  .qlk--grid-m .cr__track { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .qlk--grid-m .cr__arrow, .qlk--grid-m .cr__progress { display: none; }
}

/* ---------- category-style2 (.cs2): title box on a physical 3×3 position grid ---------- */
.cs2__card { position: relative; display: block; aspect-ratio: 600 / 496; overflow: hidden; border-radius: var(--radius); background: var(--c-surface); }
.cs2__card > img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.cs2__card:hover > img { transform: scale(1.05); }
/* positions are literally physical (top_right…), so the overlay runs LTR and only the label keeps the page direction */
.cs2__pos { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(12px, 2vw, 22px); direction: ltr; pointer-events: none; }
.cs2__pos[data-pos^="top"] { justify-content: flex-start; }
.cs2__pos[data-pos^="bottom"] { justify-content: flex-end; }
.cs2__pos[data-pos$="left"] { align-items: flex-start; }
.cs2__pos[data-pos$="right"] { align-items: flex-end; }
.cs2__label { max-width: 100%; padding: .5em 1.25em; border: var(--l-bw, 1px) solid var(--l-bc, transparent); border-radius: var(--l-r, 0); background: var(--l-bg, #fff); color: var(--l-fg, var(--c-text)); font-size: clamp(.9rem, .8rem + .35vw, 1.1rem); font-weight: 700; line-height: 1.35; text-align: center; box-shadow: var(--shadow-sm); }
[dir="rtl"] .cs2__label { direction: rtl; }

/* ---------- category-style3 (.cs3): image card with eyebrow, title, button ---------- */
.cs3__card { position: relative; isolation: isolate; display: block; width: 100%; aspect-ratio: 600 / 496; max-height: 440px; overflow: hidden; border-radius: var(--radius); background: var(--c-surface); }
.cs3__card > img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.cs3__card:hover > img { transform: scale(1.05); }
.cs3__body { position: absolute; inset-inline: 0; inset-block-end: 0; display: grid; justify-items: start; gap: 6px; padding: 72px clamp(18px, 3vw, 34px) clamp(18px, 3vw, 30px); background: linear-gradient(to top, rgb(0 0 0 / 52%), transparent); color: #fff; }
.cs3__sub { color: var(--c3-s, rgb(255 255 255 / 88%)); font-size: .875rem; font-weight: 600; }
.cs3__title { color: var(--c3-t, #fff); font-size: clamp(1.2rem, .95rem + 1.1vw, 1.85rem); font-weight: 800; line-height: 1.25; }
.cs3__btn { margin-block-start: 8px; }
@media (max-width: 767px) {
  .cs3--grid-m .cr__track { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .cs3--grid-m .cr__arrow, .cs3--grid-m .cr__progress { display: none; }
}

/* ---------- spicial-categories (.spc): the band (not the section) carries background + overlay ---------- */
.s--spicial-categories.s--bg { padding-block: 0; background: none; }
.spc { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--s-bg, var(--c-primary-soft)) var(--s-bg-img, none) center / cover no-repeat; }
.container--full > .spc { border-radius: 0; }
.spc::before { content: ""; position: absolute; inset: 0; background: var(--spc-ov, none); pointer-events: none; }
.spc__in { position: relative; display: grid; align-items: center; gap: clamp(20px, 3vw, 40px); padding: clamp(24px, 4vw, 56px); text-align: center; }
.spc__in.container { padding-inline: var(--gutter); }
.spc__copy { display: grid; justify-items: center; gap: clamp(18px, 2.4vw, 30px); }
.spc__title { color: var(--spc-t, var(--c-text)); font-size: clamp(1.3rem, 1rem + 1.4vw, 2.1rem); font-weight: 800; }
/* Up to 3 items keep one row; longer lists use two rows without shrinking six circles into one line. */
.spc__items { display: flex; align-items: flex-start; justify-content: center; gap: clamp(14px, 3vw, 36px); }
.spc__items > li { flex: 0 1 clamp(92px, 11vw, 150px); min-width: 0; }
.spc__items--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 522px); }
.spc__item { display: grid; justify-items: center; }
.spc__circle { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 12%; border-radius: 50%; background: var(--it-bg, #fff); box-shadow: var(--shadow); transition: transform .3s var(--ease); }
.spc__circle img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
a.spc__item:hover .spc__circle { transform: translateY(-4px); }
.spc__name { position: relative; max-width: 100%; margin-block-start: -14px; padding: 4px 10px; border-radius: 15px; background: var(--it-bg, #fff); color: var(--it-fg, var(--c-text)); font-size: .8125rem; font-weight: 700; text-align: center; text-wrap: balance; overflow-wrap: break-word; box-shadow: var(--shadow-sm); }
.spc__art img { width: 100%; max-height: 320px; object-fit: contain; aspect-ratio: auto 1; } /* a square box until the image loads, not 0px */
@media (min-width: 768px) {
  .spc--art .spc__in { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); text-align: start; }
  .spc--art .spc__copy { justify-items: start; }
  .spc--art .spc__items { justify-content: flex-start; }
}

/* ---------- informative (.inf): items around a centre image (desktop), 2/4-column grid under it (mobile/tablet) ---------- */
.inf { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .inf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.inf__col { display: contents; }
.inf__main { position: relative; grid-column: 1 / -1; order: -1; justify-self: center; width: 100%; max-width: 446px; margin-block-end: 8px; }
.inf__img { display: block; overflow: hidden; border-radius: var(--radius); background: var(--c-surface); }
.inf__img img { width: 100%; aspect-ratio: 446 / 500; object-fit: cover; transition: transform .6s var(--ease); }
a.inf__img:hover img { transform: scale(1.04); }
.inf__btn { position: absolute; inset-inline: 0; inset-block-end: 18px; width: max-content; max-width: calc(100% - 36px); margin-inline: auto; box-shadow: var(--shadow); }
.inf__item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px; border-radius: var(--radius); background: var(--c-surface); text-align: center; }
.inf__icon { display: grid; flex: none; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s; }
.inf__icon img { width: 40px; height: 40px; object-fit: contain; }
a.inf__item:hover .inf__icon { transform: scale(1.08); box-shadow: var(--shadow); }
.inf__copy { display: grid; gap: 2px; }
.inf__title { color: var(--c-text); font-size: .9375rem; font-weight: 700; line-height: 1.4; }
.inf__desc { color: color-mix(in srgb, var(--c-muted) 95%, #000); font-size: .8125rem; line-height: 1.55; } /* 4.5:1 on the item's surface */
/* the items' light card: their text keeps the light-page variant on a dark page (ui.fg_attrs), except on the page itself */
body.page-dark .inf__item [data-fg] { color: var(--fg-l, var(--fg)); }
@media (min-width: 992px) { /* without a main image the card grid above stays */
  .inf--around { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); }
  .inf--around .inf__col { display: grid; align-content: space-evenly; gap: 22px; }
  .inf__main { grid-column: auto; order: 0; align-self: center; margin: 0; }
  .inf--around .inf__item { flex-direction: row; padding: 0; background: none; text-align: start; }
  body.page-dark .inf--around .inf__item [data-fg] { color: var(--fg-d, var(--fg)); }
  .inf--around .inf__col--a .inf__item { flex-direction: row-reverse; text-align: end; } /* icons face the centre image */
}

/* ---------- images-square (.isq): bento — first image 2×2, later images fill the grid without gaps for any count ---------- */
.isq { display: grid; gap: clamp(10px, 1.4vw, 18px); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 42vw; }
.isq__it > img { transition: transform .6s var(--ease); }
a.isq__it:hover > img { transform: scale(1.05); }
.isq__it:first-child { grid-column: span 2; grid-row: span 2; }
@media (max-width: 767px) { .isq__it:nth-child(even):last-child { grid-column: span 2; } } /* lone last tile fills its row */
@media (min-width: 768px) {
  .isq { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 18vw, 250px); }
  /* 1–4 images: the tiles beside the lead image stretch to fill its 2×2 block */
  .isq__it:only-child { grid-column: 1 / -1; }
  .isq__it:nth-child(2):last-child { grid-column: span 2; grid-row: span 2; }
  .isq__it:nth-child(2):nth-last-child(2), .isq__it:nth-child(3):last-child { grid-row: span 2; }
  .isq__it:nth-child(4):last-child { grid-column: span 2; }
  /* 6+ images: rows of 4 start at 6, 10, 14…; a short last row is widened (1 → full, 2 → halves, 3 → 2+1+1) */
  .isq__it:nth-child(4n+6):last-child { grid-column: 1 / -1; }
  .isq__it:nth-child(4n+6):nth-last-child(2), .isq__it:nth-child(4n+7):last-child, .isq__it:nth-child(4n+6):nth-last-child(3) { grid-column: span 2; }
}
.isq__cap { position: absolute; inset-inline: 0; inset-block-end: 0; display: grid; gap: 2px; padding: 48px clamp(12px, 2vw, 22px) clamp(12px, 1.8vw, 20px); background: linear-gradient(to top, rgb(0 0 0 / 58%), transparent); color: #fff; pointer-events: none; }
.isq__title { color: var(--isq-t, #fff); font-size: clamp(.95rem, .85rem + .45vw, 1.2rem); font-weight: 700; line-height: 1.3; }
.isq__it:first-child .isq__title { font-size: clamp(1.15rem, .9rem + 1.1vw, 1.8rem); }
.isq__sub { color: var(--isq-s, rgb(255 255 255 / 85%)); font-size: .8125rem; }

/* ---------- home-brands / brands (.brd): circular (default) or rounded logo tiles ---------- */
.brd__item { display: grid; justify-items: center; align-content: start; gap: 2px; text-align: center; }
.brd__logo { display: grid; place-items: center; width: 100%; aspect-ratio: 1; margin-block-end: 8px; padding: 18%; border: 1px solid var(--c-border); border-radius: 50%; background: #fff; transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.brd--rounded .brd__logo { border-radius: var(--radius); }
.brd__logo img { width: 100%; height: 100%; object-fit: contain; }
a.brd__item:hover .brd__logo { border-color: var(--c-primary); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.brd__name { color: var(--c-text); font-size: .9rem; font-weight: 700; line-height: 1.4; }
.brd__sub { color: var(--c-muted); font-size: .8125rem; }

/* ---------- brands-style-2 / partners (.lmq): full-width logo marquee; fixed tile sizes so core.js measures before images load ---------- */
.lmq { --h: var(--lmq-h-m, 44px); --pad: 12px; --ratio: 2.4; display: grid; gap: 14px; }
@media (min-width: 768px) { .lmq { --h: var(--lmq-h, 56px); --pad: 16px; } }
.s--partners .lmq { --ratio: 1.5; }
.lmq__row { -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.lmq--nofade .lmq__row { -webkit-mask-image: none; mask-image: none; }
/* margin (not gap) keeps both marquee halves identical, so the loop has no jump */
.lmq__logo { display: grid; flex: none; place-items: center; box-sizing: content-box; width: calc(var(--h) * var(--ratio)); height: var(--h); margin-inline-end: 14px; padding: var(--pad); border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: #fff; transition: border-color .25s, box-shadow .25s; }
.lmq__logo img { width: 100%; height: 100%; object-fit: contain; }
a.lmq__logo:hover { border-color: var(--c-primary); box-shadow: var(--shadow-sm); }
.lmq--plain .lmq__logo { padding-inline: 6px; border-color: transparent; background: none; }
.lmq--plain a.lmq__logo:hover { border-color: transparent; box-shadow: none; }
