/* Grain Home Shop — v1.2.0
   Mobile-first shoppable carousel. No external dependencies. */
.ghs-home-showcase {
  --ghs-gap: 14px;
  width: 100%;
  min-width: 0;
}

#coffees .coffees.ghs-has-showcase {
  max-width: 1320px;
  padding-inline: 0;
}

.ghs-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}
.ghs-filters::-webkit-scrollbar { display: none; }
.ghs-filter {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1.5px solid rgba(139,26,107,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: #6d635d;
  font-family: 'Tajawal', sans-serif;
  font-size: .78rem;
  font-weight: 800;
  padding: 8px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ghs-filter.is-active {
  background: var(--grape);
  border-color: var(--grape);
  color: var(--cream);
}

.ghs-carousel-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  margin-inline: auto;
}

/* Mobile: one comfortable card + a visible peek of the next card. Native
   overflow keeps iPhone swipe velocity and momentum natural. */
.ghs-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(82vw, 330px);
  gap: var(--ghs-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
  scroll-behavior: smooth;
  padding: 4px 16px 22px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
  direction: rtl;
}
.ghs-track::-webkit-scrollbar { display:none; }
.ghs-track:focus-visible { outline: 2px solid var(--grape); outline-offset: 4px; }

.ghs-card.coffee-card {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  box-shadow: 0 7px 28px rgba(26,15,10,.09);
  transform: translateY(0);
  transition: transform .38s ease, box-shadow .38s ease;
  isolation: isolate;
}
.ghs-card.coffee-card.is-current {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(26,15,10,.115);
}
.ghs-card.coffee-card:hover { box-shadow: 0 10px 34px rgba(26,15,10,.12); }
.ghs-card[hidden] { display:none !important; }

.ghs-card .ghs-visual.card-hd {
  height: clamp(205px, 57vw, 255px);
  min-height: 205px;
  border-radius: 18px 18px 0 0;
}
.ghs-card .card-img-wrap { width: 66%; max-width: 230px; }
.ghs-card .ghs-fallback-icon { font-size: 4rem; position: relative; z-index: 2; }
.ghs-card .ghs-type-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.24);
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .62rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ghs-card .card-bdg { z-index: 5; top: 12px; left: 12px; }
.ghs-card .card-scr { z-index: 5; top: 12px; right: 12px; }
.ghs-card .pcoming { z-index: 6; }

.ghs-card .ghs-body.card-bd {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 16px;
}
.ghs-card .card-or { margin-bottom: 5px; font-size: .68rem; }
.ghs-card .ghs-name.card-nm {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 7vw, 1.9rem);
  line-height: 1.02;
}
.ghs-card .ghs-notes.card-notes {
  gap: 5px;
  margin: 0 0 12px;
}
.ghs-card .ntag { font-size: .66rem; padding: 3px 9px; }
.ghs-card .ghs-short {
  color: #8e8782;
  font-size: .74rem;
  line-height: 1.55;
  margin: 0 0 12px;
}

.ghs-variations.spills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 2px 0 13px;
  position: relative;
  z-index: 7;
}
.ghs-size.spill {
  min-height: 40px;
  min-width: 72px;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.ghs-size.spill.is-oos { opacity: .38; }

.ghs-card .ghs-purchase.card-pr {
  margin-top: auto;
  gap: 8px;
  position: relative;
  z-index: 7;
}
.ghs-card .ghs-price.price2 {
  font-size: 1.08rem;
  line-height: 1.25;
  min-height: 1.35em;
}
.ghs-card .ghs-add.add-btn2,
.ghs-card .ghs-state.ctag {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 11px;
  font-size: .86rem;
}
.ghs-card .ghs-add.add-btn2:active { transform: scale(.985); }

.ghs-nav {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 15;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(139,26,107,.14);
  background: rgba(245,237,216,.96);
  color: var(--grape);
  font: 900 1.8rem/1 sans-serif;
  box-shadow: 0 5px 18px rgba(0,0,0,.12);
  cursor: pointer;
  transform: translateY(-50%);
  -webkit-tap-highlight-color: transparent;
}
.ghs-prev { left: 8px; }
.ghs-next { right: 8px; }

.ghs-mobile-hint {
  width: 54px;
  height: 3px;
  border-radius: 99px;
  background: rgba(139,26,107,.12);
  margin: -9px auto 4px;
  overflow: hidden;
}
.ghs-mobile-hint span {
  display: block;
  width: 52%;
  height: 100%;
  border-radius: inherit;
  background: var(--grape);
  animation: ghsHint 2.8s ease-in-out infinite;
}
@keyframes ghsHint {
  0%,100% { transform: translateX(0); opacity:.55; }
  50% { transform: translateX(92%); opacity:1; }
}

/* Keep Batch Release notes compact if it attaches to these home cards. */
.ghs-card .gbr-release-note.is-home { margin-top: 2px; }

@media (min-width: 600px) {
  .ghs-filters { padding-inline: 20px; justify-content: center; }
  .ghs-track {
    grid-auto-columns: minmax(250px, calc((100% - 28px) / 2.25));
    padding-inline: 24px;
    scroll-padding-inline: 24px;
  }
  .ghs-card .ghs-visual.card-hd { height: 235px; }
  .ghs-mobile-hint { display:none; }
}

/* Desktop is intentionally different from mobile. When only 1–4 cards are
   visible they are centered as a balanced product row instead of being
   pinned to the RTL edge and leaving a large empty half of the section. */
@media (min-width: 900px) {
  #coffees .coffees.ghs-has-showcase {
    max-width: 1380px;
    padding-inline: clamp(28px, 4vw, 64px);
  }
  .ghs-carousel-wrap {
    max-width: 1280px;
  }
  .ghs-track {
    grid-auto-columns: clamp(270px, 23vw, 305px);
    gap: 18px;
    padding: 10px 58px 30px;
    scroll-padding-inline: 58px;
    scroll-snap-type: x mandatory;
  }
  .ghs-nav { display: grid; place-items: center; }
  .ghs-prev { left: 4px; }
  .ghs-next { right: 4px; }
  .ghs-card .ghs-visual.card-hd { height: 220px; min-height: 220px; }
  .ghs-card .ghs-body.card-bd { padding: 18px; }
  .ghs-card .ghs-name.card-nm { font-size: 1.7rem; }

  .ghs-home-showcase.ghs-few-items .ghs-track {
    display: flex;
    justify-content: center;
    align-items: stretch;
    overflow-x: visible;
    gap: 18px;
    padding: 10px 58px 30px;
  }
  .ghs-home-showcase.ghs-few-items .ghs-card {
    flex: 0 1 305px;
    width: 305px;
    max-width: 31vw;
  }
  .ghs-home-showcase.ghs-few-items .ghs-nav { display: none; }
}

@media (min-width: 1200px) {
  .ghs-home-showcase.ghs-few-items .ghs-card {
    flex-basis: 318px;
    width: 318px;
    max-width: 318px;
  }
}

@media (max-width: 380px) {
  .ghs-track {
    grid-auto-columns: min(86vw, 315px);
    padding-inline: 12px;
    scroll-padding-inline: 12px;
  }
  .ghs-card .ghs-body.card-bd { padding: 14px; }
  .ghs-card .ghs-visual.card-hd { height: 205px; }
  .ghs-card .ghs-name.card-nm { font-size: 1.42rem; }
  .ghs-card .ghs-price.price2 { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ghs-mobile-hint span { animation:none; }
  .ghs-track { scroll-behavior: auto; }
  .ghs-card.coffee-card { transition: none; }
}

/* v1.2.0 — specialty identity details from Grain's existing product meta. */
.ghs-card .ghs-coffee-type-badge {
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ghs-card .ghs-specialty-meta.card-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 11px 12px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: rgba(245,237,216,.82);
  border: 1px solid rgba(139,26,107,.055);
}
.ghs-card .ghs-specialty-meta .ghs-meta-item {
  min-width: 0;
}
.ghs-card .ghs-specialty-meta .ml {
  font-size: .58rem;
  line-height: 1.15;
  margin-bottom: 3px;
  color: #a39a93;
}
.ghs-card .ghs-specialty-meta .mv {
  font-size: .69rem;
  line-height: 1.28;
  color: var(--dark);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@media (max-width: 380px) {
  .ghs-card .ghs-specialty-meta.card-meta {
    gap: 7px 10px;
    padding: 10px;
  }
  .ghs-card .ghs-specialty-meta .mv { font-size: .65rem; }
}
