/* v1.4.59 — Promotion Rail Density Refine
   Scope: homepage promotion card sizing only.
   Keeps v1.4.58 rail/lightbox/data behavior intact.
   Goal: prevent 1–2 promotions from stretching into oversized cards and show 3–4 cards per desktop viewport. */

/* Desktop default: three compact cards. Low item counts keep the same card width instead of stretching. */
.home .home-promo-rail,
.home .home-promo-rail-wrap--count-1 .home-promo-rail,
.home .home-promo-rail-wrap--count-2 .home-promo-rail{
  --promo-gap:18px;
  grid-auto-columns:calc((100% - (var(--promo-gap) * 2))/3)!important;
}

/* Large desktop: four cards visible at once. */
@media(min-width:1400px){
  .home .home-promo-rail,
  .home .home-promo-rail-wrap--count-1 .home-promo-rail,
  .home .home-promo-rail-wrap--count-2 .home-promo-rail{
    --promo-gap:18px;
    grid-auto-columns:calc((100% - (var(--promo-gap) * 3))/4)!important;
  }
}

/* Slightly tighten metadata to match the denser card rhythm. */
.home .home-promo-card__body{
  min-height:82px!important;
  padding:15px 16px 17px!important;
}
.home .home-promo-card__body h3{
  font-size:16px!important;
  line-height:1.3!important;
}
.home .home-promo-card__expiry{
  margin-top:7px!important;
  font-size:12px!important;
}
.home .home-promo-card__zoom{
  width:34px!important;
  height:34px!important;
  right:10px!important;
  bottom:10px!important;
}
.home .home-promo-card__zoom svg{width:16px!important;height:16px!important}

/* Tablet keeps two cards. */
@media(max-width:980px){
  .home .home-promo-rail,
  .home .home-promo-rail-wrap--count-1 .home-promo-rail,
  .home .home-promo-rail-wrap--count-2 .home-promo-rail{
    --promo-gap:16px;
    grid-auto-columns:calc((100% - var(--promo-gap))/2)!important;
  }
}

/* Mobile keeps the existing swipe affordance: one card with the next card peeking in. */
@media(max-width:640px){
  .home .home-promo-rail,
  .home .home-promo-rail-wrap--count-2 .home-promo-rail{
    --promo-gap:12px;
    grid-auto-columns:86%!important;
  }
  .home .home-promo-rail-wrap--count-1 .home-promo-rail{
    grid-auto-columns:100%!important;
  }
  .home .home-promo-card__body{min-height:80px!important;padding:14px 15px 16px!important}
  .home .home-promo-card__body h3{font-size:16px!important}
}
