/* Amer banner grid — Design 1: two or more banners in a row.
 * Canonical reference: home-cosmetic.html:1916 `tf-grid-layout md-col-2
 * gap-10` (planning/DESIGN-COMPOSITIONS.md row 134). Cards are
 * `.banner-image-text.type-abs.style-11.hover-img` (styles.css:16967-16996):
 * square-ish photo, bottom-anchored text over a dark gradient, filled white
 * button. The same card renders wherever design 1 is used, including
 * home-electronics.html's own (differently-classed) instance of the same
 * design. Default spacing = the template's own wrapper, `.flat-spacing`
 * (styles.css:1121-1136): 80px above 991px, 60px 426-991px, 40px at or below
 * 425px — the two designed sample instances that skip the top half (`pt-0`)
 * do that because of what sits above them on that one page, so they carry
 * `padding_top: 00` in their own content, not in this default. */

.mt-section.amer-banner-grid--d1 {
  padding-block: var(--mt-space-top, 80px) var(--mt-space-bottom, 80px);
}
@media (max-width: 991px) {
  .mt-section.amer-banner-grid--d1 {
    padding-block: var(--mt-space-top, 60px) var(--mt-space-bottom, 60px);
  }
}
@media (max-width: 767px) {
  .mt-section.amer-banner-grid--d1 {
    padding-block: var(--mt-space-top-mobile, var(--mt-space-top, 60px)) var(--mt-space-bottom-mobile, var(--mt-space-bottom, 60px));
  }
}
@media (max-width: 425px) {
  .mt-section.amer-banner-grid--d1 {
    padding-block: var(--mt-space-top-mobile, var(--mt-space-top, 40px)) var(--mt-space-bottom-mobile, var(--mt-space-bottom, 40px));
  }
}

.amer-banner-grid--d1 .amer-banner-grid__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
/* «القسم بعرض الشاشة كلها» (full_width) on the «wide» cards: the row reaches
   both screen edges, the cards square-cornered (Mohamed, 2026-10-13). It
   only lifted the 1440px cap before: the 15px gutter and the 16px corners
   stayed at 1440 and on phones (options review, 2026-10-13). The square
   cards («صورة مربعة وزرار») keep the gutter and only widen, as before:
   the decision named the wide style alone (round 2), and the label says so. */
.amer-banner-grid--d1.amer-banner-grid--wide.mt-section--full { --mt-content-gutter: 0px; }
.amer-banner-grid--d1.amer-banner-grid--wide.mt-section--full .amer-banner-grid__card { border-radius: 0; }
@media (min-width: 768px) {
  /* Template: `md-col-2` (styles.css:1870). The count is set by the section
     from the banner list (capped at 4) so 2, 3 or 4 banners all sit in one row. */
  .amer-banner-grid--d1 .amer-banner-grid__grid {
    grid-template-columns: repeat(var(--amer-banner-grid-cols, 2), 1fr);
  }
}

.amer-banner-grid--d1 .amer-banner-grid__card {
  /* The template's card is as tall as its 700x700 picture (`.bn-image img`
     is width:100%/height:100% in an auto-height parent, so the square ratio
     drives it) but never under `min-height: 350px` (styles.css:16983).
     Measured: 700 / 492 / 364 / 360 square at 1440 / 1024 / 768 / 390. */
  --amer-banner-grid-ratio: 1 / 1;
  --amer-banner-grid-min: 350px;
  border-radius: 0; /* style-11: `.bn-image { border-radius: 0 }` (styles.css:16980) */
}

/* style-11::before (styles.css:16967-16978): a bottom-rising gradient so the
   white text stays legible, in the template's own purple #5b1348 — visible as
   a mauve band under the text on home-cosmetic. The colour is the section's
   `scrim_color` setting (default = the template's), so a merchant whose
   pictures clash with it can pick a dark one; the stops are the template's. */
.amer-banner-grid--d1 .amer-banner-grid__scrim {
  background: linear-gradient(180.52deg, transparent 51.85%, var(--amer-banner-grid-scrim, #5b1348) 122.82%);
}
@media (max-width: 991px) {
  .amer-banner-grid--d1 .amer-banner-grid__scrim {
    background: linear-gradient(180.52deg, transparent 20%, var(--amer-banner-grid-scrim, #5b1348) 122.82%);
  }
}
/* Under white words («ألوان النص» light) the shade starts higher and reaches
   its full colour at the foot (105%, not 122.82%): the template's stops left
   white words at 1.2-3.0:1 on busy photos even with a black shade (sport,
   visual review 2026-09-23); 3.6-10.9:1 now at 1440, 768 and 390. Dark or
   custom words keep the template's stops. */
.amer-banner-grid--d1:not(.amer-banner-grid--wide):not(.amer-banner-grid--text-top) .amer-banner-grid__card--light .amer-banner-grid__scrim {
  background: linear-gradient(180.52deg, transparent 30%, var(--amer-banner-grid-scrim, #5b1348) 105%);
}
@media (max-width: 991px) {
  .amer-banner-grid--d1:not(.amer-banner-grid--wide):not(.amer-banner-grid--text-top) .amer-banner-grid__card--light .amer-banner-grid__scrim {
    background: linear-gradient(180.52deg, transparent 20%, var(--amer-banner-grid-scrim, #5b1348) 105%);
  }
}

.amer-banner-grid--d1 .amer-banner-grid__content {
  inset-inline: 20px;
  inset-block-end: 18px;
}
.amer-banner-grid--d1 .amer-banner-grid__title { margin-block-end: 12px; }
.amer-banner-grid--d1 .amer-banner-grid__desc { margin-block-end: 24px; }
/* A line break typed in the title or the text is kept from 768px up: the
   template's headline breaks here are `<br class="d-none d-md-block">`
   (home-cosmetic.html:1923, 1941). Between 576 and 767px they are off, so
   «ULTIMATE MOISTURE CREAM DUO» is one line there (measured 38px high at
   700px in the template). */
@media (min-width: 768px) {
  .amer-banner-grid--d1 .amer-banner-grid__title,
  .amer-banner-grid--d1 .amer-banner-grid__desc { white-space: pre-line; }
}
/* «الكلام فوق الصورة ولا تحت» = top: the template's style-6 (home-pet-care)
   and style-top-left.tl-3 (home-bag-accessories): the words 20px from the
   top and sides, 48px from 1200px. The shade falls from the top instead, and
   only behind white words: over the pet food and the bags, the words at the
   foot read 1.0-2.3:1, at the top 10-17:1 (visual review 2026-09-23). */
.amer-banner-grid--d1.amer-banner-grid--text-top .amer-banner-grid__content { inset-block: 20px auto; }
@media (min-width: 1200px) {
  .amer-banner-grid--d1.amer-banner-grid--text-top .amer-banner-grid__content { inset-block-start: 48px; inset-inline: 48px; }
}
.amer-banner-grid--d1.amer-banner-grid--text-top .amer-banner-grid__scrim { background: none; }
.amer-banner-grid--d1.amer-banner-grid--text-top .amer-banner-grid__card--light .amer-banner-grid__scrim {
  background: linear-gradient(.52deg, transparent 51.85%, var(--amer-banner-grid-scrim, #5b1348) 122.82%);
}
@media (max-width: 991px) {
  .amer-banner-grid--d1.amer-banner-grid--text-top .amer-banner-grid__card--light .amer-banner-grid__scrim {
    background: linear-gradient(.52deg, transparent 20%, var(--amer-banner-grid-scrim, #5b1348) 122.82%);
  }
}

/* Card style «wide»: home-electronics.html:1757 `.box-image_v04` in a
 * `tf-grid-layout sm-col-2` (styles.css:16571-16620, 1790, 1843, 1913). The
 * photo keeps its 690x388 shape but never drops under 350px (300px up to
 * 575px), the corners round at 16px and clip, no scrim (each banner sets its
 * own colour scheme against its photo), the text sits 20px from the start and
 * bottom (40/36px from 1200px) and is only as wide as it needs to be, and the
 * button is the underlined `.tf-btn-line-2`.
 * Grid gaps are `.tf-grid-layout`'s own three tiers, measured on the page:
 * 16/24 under 576px, 24/32 to 1199px, 30/40 from 1200px. */
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__grid { column-gap: 16px; row-gap: 24px; }
@media (min-width: 576px) {
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__grid {
    grid-template-columns: repeat(var(--amer-banner-grid-cols, 2), 1fr);
    column-gap: 24px;
    row-gap: 32px;
  }
}
@media (min-width: 1200px) {
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__grid { column-gap: 30px; row-gap: 40px; }
}
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card {
  --amer-banner-grid-ratio: 690 / 388;
  --amer-banner-grid-min: 350px;
  border-radius: 16px;
  overflow: hidden; /* `.box-image_v04 { overflow: hidden }` (styles.css:16574) */
}
@media (max-width: 575px) {
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card { --amer-banner-grid-min: 300px; }
}
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__scrim { background: none; }
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__content {
  /* `.box-image_v04 .box-image_content { left: 20px; bottom: 20px }` — the end
     side is free, so the block is only as wide as its longest line (measured
     306.2px inside a 690px card at 1440). RTL flips it, exactly as the
     template's own `.rtl` rule does (styles.css:23687). */
  inset-inline-start: 20px;
  inset-inline-end: auto;
  inset-block-end: 20px;
}
@media (min-width: 1200px) {
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__content {
    inset-inline-start: 40px;
    inset-block-end: 36px;
  }
}
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__title { font-weight: 500; margin-block-end: 8px; }
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__desc { margin-block-end: 12px; }
/* «مكان الكلام» on the wide cards: the box is pinned to the start (above),
   so «end» and «center» only aligned the lines inside it. They move the box
   now, so the words can go to the picture's empty side (wellness in Arabic;
   visual review 2026-09-23). */
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--align-end .amer-banner-grid__content {
  inset-inline-start: auto;
  inset-inline-end: 20px;
}
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--align-center .amer-banner-grid__content { inset-inline: 20px; }
@media (min-width: 1200px) {
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--align-end .amer-banner-grid__content { inset-inline-end: 40px; }
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--align-center .amer-banner-grid__content { inset-inline: 40px; }
}
/* White words on a wide card: a shade rising from the foot, under the words
   only (the electronics woman banner 2.3:1 and the car-parts banner 1.1:1
   before; 4.9:1 and 4.1:1 with it, stronger under 992px where the words
   take more of the picture). Nothing on a card without a picture. */
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--light .amer-banner-grid__scrim {
  background: linear-gradient(to top, rgb(0 0 0 / .55) 0%, rgb(0 0 0 / .25) 45%, rgb(0 0 0 / 0) 70%);
}
@media (max-width: 991px) {
  .amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--light .amer-banner-grid__scrim {
    background: linear-gradient(to top, rgb(0 0 0 / .7) 0%, rgb(0 0 0 / .4) 50%, rgb(0 0 0 / 0) 85%);
  }
}
.amer-banner-grid--d1.amer-banner-grid--wide .amer-banner-grid__card--light:has(.amer-banner-grid__media--empty) .amer-banner-grid__scrim { background: none; }
