/**
 * Homepage static dual showcase — Featured Businesses + Latest Offers
 */

.homepage-showcase-section {
  background: #eef2f7;
  padding: 28px 20px 32px;
  border-bottom: 1px solid #e2e8f0;
}

.homepage-showcase-section__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

.homepage-showcase-section__inner--businesses-only {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  width: 100%;
}

@media (min-width: 992px) {
  .homepage-showcase-section {
    padding-left: 36px;
    padding-right: 36px;
  }

  .homepage-showcase-section__inner {
    max-width: none;
    margin: 0;
  }
}

@media (min-width: 1400px) {
  .homepage-showcase-section {
    padding-left: 48px;
    padding-right: 48px;
  }
}

.homepage-showcase-panel {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 16px 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.homepage-showcase-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.homepage-showcase-panel__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.homepage-showcase-panel__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.homepage-showcase-panel__icon--business {
  background: #fee2e2;
  color: #dc2626;
}

.homepage-showcase-panel__icon--offers {
  background: #fee2e2;
  color: #dc2626;
}

.homepage-showcase-panel__title {
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.homepage-showcase-panel__subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: #64748b;
  margin: 0;
}

.homepage-showcase-panel__view-all {
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.homepage-showcase-panel__view-all:hover {
  color: #1d4ed8;
}

.homepage-showcase-panel__view-all i {
  font-size: 0.7rem;
}

.homepage-showcase-carousel {
  --carousel-gap: 12px;
  --carousel-visible: 2;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 2px;
}

.homepage-showcase-carousel[data-carousel-cols="2"] {
  --carousel-visible: 2;
}

.homepage-showcase-carousel .card-carousel-track {
  padding-bottom: 4px;
}

.homepage-showcase-carousel .ad-slider-arrows {
  padding: 0 4px;
}

.homepage-showcase-carousel .ad-slider-arrow {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #334155;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
  border: 1px solid #e2e8f0;
  font-size: 13px;
}

.homepage-showcase-carousel .ad-slider-arrow:hover {
  background: #fff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.homepage-showcase-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.homepage-showcase-card:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  color: inherit;
}

.homepage-showcase-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #e2e8f0;
  overflow: hidden;
}

.homepage-showcase-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.homepage-showcase-card__badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #dc2626;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.homepage-showcase-card__body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.homepage-showcase-card__name {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  margin: 0;
}

.homepage-showcase-card__meta {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  color: #64748b;
  margin: 0;
}

.homepage-showcase-card__loc,
.homepage-showcase-card__rating,
.homepage-showcase-card__valid {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #475569;
}

.homepage-showcase-card__loc i {
  color: #64748b;
  font-size: 0.7rem;
}

.homepage-showcase-card__loc--accent i {
  color: #ea580c;
}

.homepage-showcase-card__rating {
  margin-top: 2px;
  color: #334155;
  font-weight: 600;
}

.homepage-showcase-card__rating i {
  color: #f59e0b;
  font-size: 0.72rem;
}

.homepage-showcase-card__valid {
  color: #64748b;
  font-weight: 500;
}

.homepage-showcase-card__valid i {
  color: #ea580c;
  font-size: 0.72rem;
}

[data-slide-by="card"] .card-carousel-item > .homepage-showcase-card {
  height: 100%;
}

@media (max-width: 767.98px) {
  .homepage-desktop-panels {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .homepage-showcase-section__inner {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: none;
    margin: 0;
    width: 100%;
  }

  .homepage-showcase-section__inner--businesses-only {
    max-width: none;
    margin: 0;
    width: 100%;
  }

  /* 26px + rail (6px) + scroll (4px) bottom padding = 36px, matching the gap below the offers/ads promo sections */
  .homepage-showcase-section {
    padding: 0 0 26px;
    background: #e3f3ea;
    border-bottom: none;
  }

  .homepage-showcase-panel--businesses {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  /* Phones: swipe row, one card + a peek of the next */
  .homepage-featured-promo-rail {
    padding: 6px 0;
  }

  .homepage-featured-promo-rail__scroll {
    scroll-padding-inline: 16px;
    padding: 0 16px 4px;
  }

  .homepage-featured-promo-card {
    flex: 0 0 min(72vw, 292px);
    width: min(72vw, 292px);
    max-width: 292px;
  }
}

/* ── Featured business promo cards (all screen sizes) ──
   The card is just the uploaded creative (any message is designed into the image) inside a
   coloured border; the colour comes from the item's category tone (slate when unknown). */
.homepage-featured-promo-rail {
  position: relative;
  width: 100%;
  max-width: none;
  overflow: hidden;
  margin: 0;
}

.homepage-featured-promo-rail__scroll {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.homepage-featured-promo-rail__scroll::-webkit-scrollbar {
  display: none;
}

/* Prev/next arrows: tablet + desktop only (phones swipe); shown by JS only when the row overflows */
.homepage-featured-promo-rail__arrow {
  display: none;
}

.homepage-featured-promo-card {
  position: relative;
  scroll-snap-align: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

/* Magnifier button: touch screens only (mouse users get the hover zoom instead) */
.homepage-featured-promo-card__zoom {
  display: none;
}

@media (hover: none) {
  .homepage-featured-promo-card__zoom {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.25);
  }
}

/* Larger image popup opened by the magnifier */
.homepage-featured-zoom {
  /* The site-wide reset zeroes margins; auto margins are what centre a modal dialog */
  margin: auto;
  width: min(92vw, 520px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.homepage-featured-zoom::backdrop {
  background: rgba(15, 23, 42, 0.82);
}

body:has(.homepage-featured-zoom[open]) {
  overflow: hidden;
}

.homepage-featured-zoom__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.homepage-featured-zoom__img {
  display: block;
  width: 100%;
  /* Leave room for the "View business" button and some margin on short screens */
  max-height: 78vh;
  max-height: calc(100dvh - 110px);
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.homepage-featured-zoom__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.homepage-featured-zoom__visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.homepage-featured-promo-card__link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
}

.homepage-featured-promo-card__frame {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
  background: linear-gradient(165deg, #94a3b8 0%, #475569 45%, #1e293b 100%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.homepage-featured-promo-card--orange .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #fb923c 0%, #ea580c 45%, #c2410c 100%);
}

.homepage-featured-promo-card--green .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #22c55e 0%, #15803d 45%, #14532d 100%);
}

.homepage-featured-promo-card--red .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #f87171 0%, #dc2626 45%, #991b1b 100%);
}

.homepage-featured-promo-card--purple .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #c084fc 0%, #9333ea 45%, #6b21a8 100%);
}

.homepage-featured-promo-card--blue .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #60a5fa 0%, #2563eb 45%, #1e40af 100%);
}

.homepage-featured-promo-card--brown .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #d6a06b 0%, #a16207 45%, #713f12 100%);
}

.homepage-featured-promo-card--teal .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #2dd4bf 0%, #0d9488 45%, #115e59 100%);
}

.homepage-featured-promo-card--pink .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #f472b6 0%, #db2777 45%, #9d174d 100%);
}

.homepage-featured-promo-card--indigo .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #818cf8 0%, #4f46e5 45%, #3730a3 100%);
}

.homepage-featured-promo-card--amber .homepage-featured-promo-card__frame {
  background: linear-gradient(165deg, #fbbf24 0%, #d97706 45%, #92400e 100%);
}

/* Image shown whole, never cropped; the white backing fills the card so cards in the row stay
   equal when image shapes differ (very tall images are capped and shrunk to fit) */
.homepage-featured-promo-card__hero {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.homepage-featured-promo-card__hero img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 28rem;
  object-fit: contain;
}

/* Mouse devices: the hovered (or keyboard-focused) card grows a little */
@media (hover: hover) and (min-width: 768px) {
  .homepage-featured-promo-card {
    transition: transform 0.25s ease;
  }

  .homepage-featured-promo-card__frame {
    transition: box-shadow 0.25s ease;
  }

  .homepage-featured-promo-card:hover,
  .homepage-featured-promo-card:focus-within {
    z-index: 1;
    transform: scale(1.05);
  }

  .homepage-featured-promo-card:hover .homepage-featured-promo-card__frame,
  .homepage-featured-promo-card:focus-within .homepage-featured-promo-card__frame {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .homepage-featured-promo-card,
  .homepage-featured-promo-card__frame {
    transition: none;
  }
}

/* Tablet + desktop: one full-width row of tall portrait (3:4) cards with a thinner border —
   3 cards up to 1199px, then 5 cards plus a peek of the 6th from 1200px; extra cards are
   reached with the arrows */
@media (min-width: 768px) {
  .homepage-featured-promo-rail__scroll {
    --fp-cols: 3;
    --fp-gap: 20px;
    gap: var(--fp-gap);
    /* Room inside the strip so a hovered card can grow 5% without being clipped; the panel's
       own padding is reduced by the same amount, so cards sit where they did */
    padding: 12px 8px 14px;
    scroll-padding-inline: 8px;
  }

  .homepage-featured-promo-rail__arrow {
    position: absolute;
    top: calc(50% - 6px);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #0f172a;
    font-size: 0.9375rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
    transform: translateY(-50%);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .homepage-featured-promo-rail__arrow:hover {
    background: #f1f5f9;
  }

  .homepage-featured-promo-rail__arrow:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
  }

  .homepage-featured-promo-rail__arrow--prev {
    left: 18px;
  }

  .homepage-featured-promo-rail__arrow--next {
    right: 18px;
  }

  .homepage-featured-promo-card {
    flex: 0 0 calc((100% - var(--fp-gap) * (var(--fp-cols) - 1)) / var(--fp-cols));
    width: calc((100% - var(--fp-gap) * (var(--fp-cols) - 1)) / var(--fp-cols));
  }

  .homepage-featured-promo-card__frame {
    padding: 6px;
    border-radius: 14px;
  }

  .homepage-featured-promo-card__hero {
    flex: 0 0 auto;
    aspect-ratio: 3 / 4;
  }

  .homepage-featured-promo-card__hero img {
    max-height: none;
  }
}

@media (min-width: 1200px) {
  .homepage-featured-promo-rail__scroll {
    --fp-cols: 5;
    --fp-gap: 28px;
  }

  /* 5 full cards plus about a third of the 6th, so it is clear the row continues */
  .homepage-featured-promo-card {
    flex-basis: calc((100% - var(--fp-gap) * var(--fp-cols)) / (var(--fp-cols) + 0.35));
    width: calc((100% - var(--fp-gap) * var(--fp-cols)) / (var(--fp-cols) + 0.35));
  }

  /* A 4px border leaves the image as much room as possible */
  .homepage-featured-promo-card__frame {
    padding: 4px;
    border-radius: 12px;
  }

  .homepage-featured-promo-card__hero {
    border-radius: 8px;
  }
}

@media (max-width: 767.98px) {
  .homepage-showcase-panel--offers {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  .homepage-popular-deals {
    margin: 4px 14px 0;
    padding: 16px 14px 14px;
    border-radius: 12px;
    background: linear-gradient(165deg, #169642 0%, #14532d 48%, #0d3b22 100%);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  }

  .homepage-popular-deals__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .homepage-popular-deals__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0;
  }

  .homepage-popular-deals__view-all {
    flex-shrink: 0;
    max-width: 5.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-align: right;
    padding-top: 2px;
  }

  .homepage-popular-deals__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .homepage-popular-deals__tile {
    position: relative;
    display: block;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    text-decoration: none;
  }

  .homepage-popular-deals__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 12px 10px 36px;
    box-sizing: border-box;
  }

  .homepage-popular-deals__media img {
    width: 100%;
    height: 100%;
    max-height: 112px;
    object-fit: contain;
    display: block;
  }

  .homepage-popular-deals__badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 5px;
    background: #cc0c39;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.01em;
  }
}

/* Tablet: same compact card width as phone (one card + peek), left-aligned rail */
@media (min-width: 576px) and (max-width: 767.98px) {
  .homepage-featured-promo-card {
    flex: 0 0 min(72vw, 300px);
    width: min(72vw, 300px);
    max-width: 300px;
  }
}

@media (max-width: 575.98px) {
  .homepage-showcase-panel__head {
    flex-wrap: wrap;
  }

  .homepage-showcase-panel__view-all {
    margin-left: 52px;
    padding-top: 0;
  }

  .homepage-showcase-carousel {
    --carousel-visible: 1;
  }
}

@media (min-width: 1200px) {
  .homepage-showcase-section {
    padding-left: 40px;
    padding-right: 40px;
  }
}
