/* Phase 10I — compact homepage carousel, seller rotation and mobile header */
:root {
  --ff-home-green: #104b35;
  --ff-home-green-bright: #16974a;
  --ff-home-ink: #102019;
  --ff-home-muted: #687b72;
  --ff-home-pastel: #e9f7ef;
  --ff-home-pastel-blue: #e8f4f8;
  --ff-home-line: rgba(20, 63, 46, .11);
}

/* A larger brand lockup on desktop without reducing the search area. */
body.ff-storefront .ff-header .row {
  grid-template-columns: minmax(270px, 1fr) minmax(380px, 1.5fr) minmax(235px, .78fr);
  gap: 18px;
}

body.ff-storefront .ff-brand-image-link { width: min(100%, 320px); }
body.ff-storefront .ff-header #logo .ff-brand-horizontal {
  width: 100%;
  max-height: 78px;
  object-fit: contain;
  object-position: left center;
}

/* Native scroll snapping gives touch users a true swipe gesture. */
.ff-home-intro {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 30px;
  background: rgba(255,255,255,.66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.96), 0 18px 50px rgba(19,47,34,.09);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

.ff-home-slider-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
}
.ff-home-slider-track::-webkit-scrollbar { display: none; }

.ff-home-slide {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 390px;
  flex: 0 0 100%;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: center;
  padding: clamp(30px, 4vw, 54px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ff-home-slide::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 270px;
  aspect-ratio: 1;
  border: 44px solid rgba(22,151,74,.065);
  border-radius: 50%;
  pointer-events: none;
}

.ff-home-slide-intro { background: linear-gradient(130deg, rgba(255,255,255,.94), rgba(241,249,244,.78)); }
.ff-home-slide-sellers { background: linear-gradient(130deg, rgba(246,252,249,.96), rgba(232,244,248,.78)); }
.ff-home-slide-local { background: linear-gradient(130deg, rgba(255,255,255,.96), rgba(250,246,230,.72)); }
.ff-home-slide-copy { position: relative; z-index: 1; min-width: 0; }

.ff-home-slide .ff-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(19,111,60,.09);
  border-radius: 999px;
  color: #18703f;
  background: rgba(239,250,243,.78);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ff-home-slide h1,
.ff-home-slide h2 {
  max-width: 830px;
  margin: 18px 0 13px;
  color: var(--ff-home-ink);
  font-size: clamp(2.7rem, 4.6vw, 4.75rem);
  font-weight: 950;
  letter-spacing: -.068em;
  line-height: .94;
}
.ff-home-slide h2 { font-size: clamp(2.5rem, 4.2vw, 4.25rem); }
.ff-home-slide h1 em,
.ff-home-slide h2 em { color: var(--ff-home-green-bright); font-style: normal; }
.ff-home-slide-copy > p { max-width: 680px; margin: 0; color: var(--ff-home-muted); font-size: clamp(.9rem, 1.2vw, 1.05rem); line-height: 1.62; }

.ff-home-slide .ff-home-actions { margin: 20px 0 16px; }
.ff-home-slide .ff-home-actions a {
  min-height: 49px;
  border-radius: 15px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.ff-home-slide .ff-home-primary { box-shadow: 0 12px 28px rgba(16,75,53,.18); }
.ff-home-slide .ff-home-secondary,
.ff-seller-directory-link {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37,119,80,.16) !important;
  color: #115f38 !important;
  background: linear-gradient(135deg, var(--ff-home-pastel), var(--ff-home-pastel-blue)) !important;
  box-shadow: 0 10px 28px rgba(29,91,62,.1);
}
.ff-home-slide .ff-home-secondary i:first-child {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 10px;
  color: #0f6e3b;
  background: #cfeedd;
}
.ff-home-slide .ff-home-actions a i,
.ff-seller-directory-link i { transition: transform .2s ease, color .2s ease; }
.ff-home-slide .ff-home-primary:hover i { transform: translateX(5px); }
.ff-home-slide .ff-home-secondary:hover i:first-child { transform: rotate(-7deg) scale(1.08); }
.ff-home-slide .ff-home-actions a:hover,
.ff-seller-directory-link:hover { transform: translateY(-2px); box-shadow: 0 15px 34px rgba(29,91,62,.16); }
.ff-seller-directory-link:hover i { transform: translateX(4px); }

.ff-home-slide .ff-home-proof { margin-top: 4px; }

.ff-home-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 25px;
  background: rgba(255,255,255,.68);
  box-shadow: inset 0 1px 0 #fff, 0 17px 42px rgba(20,55,39,.09);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  backdrop-filter: blur(20px) saturate(145%);
}
.ff-home-metrics > div { display: flex; min-width: 0; flex-direction: column; padding: 16px; border-radius: 18px; background: rgba(247,250,247,.86); }
.ff-home-metrics > div > i { margin-bottom: 16px; color: #178249; font-size: 1.05rem; }
.ff-home-metrics strong { color: #13231c; font-size: clamp(1.55rem,2.6vw,2.25rem); font-weight: 950; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ff-home-metrics span { color: #6e8077; font-size: .67rem; }
.ff-home-metrics > p { display: flex; grid-column: 1 / -1; gap: 11px; align-items: center; margin: 0; padding: 14px; border-radius: 18px; color: #fff; background: var(--ff-home-green); }
.ff-home-metrics > p > i { display: grid; width: 38px; aspect-ratio: 1; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #79d99c; background: rgba(255,255,255,.11); }
.ff-home-metrics > p span { display: flex; min-width: 0; flex-direction: column; color: #fff; }
.ff-home-metrics > p strong { color: #fff; font-size: .78rem; letter-spacing: 0; }
.ff-home-metrics > p small { color: #c5d8ce; font-size: .62rem; }

.ff-home-slide-points { position: relative; z-index: 1; display: grid; gap: 9px; }
.ff-home-slide-points > div { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 13px; align-items: center; padding: 15px; border: 1px solid rgba(255,255,255,.92); border-radius: 19px; background: rgba(255,255,255,.7); box-shadow: 0 10px 28px rgba(20,55,39,.065); }
.ff-home-slide-points i { display: grid; width: 48px; aspect-ratio: 1; place-items: center; border-radius: 15px; color: #146d3c; background: #daf1e3; font-size: 1.05rem; }
.ff-home-slide-points span { display: flex; min-width: 0; flex-direction: column; }
.ff-home-slide-points strong { font-size: .82rem; }
.ff-home-slide-points small { margin-top: 2px; color: #73857c; font-size: .65rem; }

.ff-home-local-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ff-home-local-grid > div { display: flex; min-width: 0; min-height: 125px; flex-direction: column; justify-content: flex-end; padding: 16px; border: 1px solid rgba(255,255,255,.94); border-radius: 20px; background: rgba(255,255,255,.72); box-shadow: 0 11px 30px rgba(20,55,39,.065); }
.ff-home-local-grid i { margin-bottom: auto; color: #137a43; font-size: 1.1rem; }
.ff-home-local-grid strong { margin-top: 15px; font-size: .78rem; }
.ff-home-local-grid span { margin-top: 2px; color: #71837a; font-size: .61rem; }

/* Move seller discovery to the top and keep the home page deliberately concise. */
.ff-home-compact { padding-bottom: 20px; }
.ff-home-compact .ff-home-section { padding-top: 36px !important; }
.ff-home-compact .ff-home-sellers-section { padding-top: 30px !important; }
.ff-home-compact .ff-home-heading { margin-bottom: 14px !important; }
.ff-home-compact .ff-home-heading h2 { margin-top: 2px; font-size: clamp(1.65rem,3vw,2.65rem); }
.ff-home-compact .ff-home-category-grid { grid-auto-rows: 165px; gap: 11px; }
.ff-home-compact .ff-home-bottom { padding-top: 18px; }

.ff-seller-directory-link { min-height: 43px; padding: 0 15px; border-radius: 14px; }
.ff-home-compact .ff-home-sellers { gap: 12px; }
.ff-home-compact .ff-home-seller-cover { height: 105px; }
.ff-home-compact .ff-home-seller-body { padding-bottom: 13px; }

.ff-home-compact .ff-home-confidence { gap: 10px; margin-top: 22px !important; }
.ff-home-compact .ff-home-confidence > div { padding: 14px 16px; border-radius: 17px; }
.ff-home-compact .ff-home-confidence > div > i { width: 39px; height: 39px; border-radius: 12px; }
.ff-home-compact .ff-home-confidence-top { position: relative; z-index: 2; margin: 0 18px 18px !important; }

@media (min-width: 768px) and (max-width: 1100px) {
  body.ff-storefront .ff-header .row { grid-template-columns: 230px minmax(300px,1fr) 220px; gap: 12px; }
  body.ff-storefront .ff-brand-image-link { width: 230px; }
  .ff-home-slide { grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); }
}

@media (max-width: 767.98px) {
  body.ff-storefront .ff-header { padding: 8px 0 5px; }
  body.ff-storefront .ff-header .container { padding-inline: 12px; }
  body.ff-storefront .ff-header .row {
    display: grid !important;
    width: 100%;
    margin: 0 !important;
    grid-template-columns: minmax(0,1fr) 52px !important;
    grid-template-areas: "brand cart" "search search";
    gap: 8px 10px !important;
  }
  body.ff-storefront .ff-header .row > div { max-width: none !important; padding: 0 !important; }
  body.ff-storefront .ff-header-brand-col { grid-area: brand; width: 100% !important; }
  body.ff-storefront .ff-header-search-col { grid-area: search; width: 100% !important; }
  body.ff-storefront .ff-header #cart.ff-header-cart-col { display: block !important; grid-area: cart; width: 52px !important; margin: 0 !important; }
  body.ff-storefront .ff-brand-image-link { width: min(100%, 210px) !important; }
  body.ff-storefront .ff-header #logo .ff-brand-horizontal { width: 210px !important; max-width: 100% !important; max-height: 58px !important; }

  body.ff-storefront .ff-header #cart .ff-mini-cart-toggle {
    width: 52px;
    min-width: 52px;
    min-height: 52px !important;
    padding: 0 !important;
    border-radius: 17px !important;
  }
  body.ff-storefront .ff-header #cart .ff-mini-cart-toggle span,
  body.ff-storefront .ff-header #cart .ff-mini-cart-toggle::after { display: none !important; }
  body.ff-storefront .ff-header #cart .ff-mini-cart-toggle i { margin: 0; font-size: 1rem; }
  body.ff-storefront .ff-header #cart .ff-mini-cart-panel { right: 0 !important; left: auto !important; width: min(390px, calc(100vw - 24px)); }

  body.ff-storefront .ff-header-search-col .ff-search-shell,
  body.ff-storefront .ff-header-search-col .ff-search-form { width: 100% !important; }
  body.ff-storefront .ff-header-search-col .ff-search-form { min-height: 52px; padding-left: 15px; border-radius: 17px; }
  body.ff-storefront .ff-header-search-col .ff-search-form .form-control { height: 50px; padding-inline: 9px; font-size: .9rem; }
  body.ff-storefront .ff-header-search-col .ff-search-form .form-control::placeholder { color: #7b8982 !important; opacity: 1 !important; }
  body.ff-storefront .ff-header-search-col .ff-search-submit { width: 48px !important; height: 44px !important; border-radius: 14px !important; }

  .ff-home-intro { border-radius: 24px; }
  .ff-home-slide {
    min-height: 485px;
    grid-template-columns: minmax(0,1fr);
    gap: 18px;
    align-content: center;
    padding: 23px 18px;
  }
  .ff-home-slide .ff-eyebrow { padding: 8px 11px; font-size: .58rem; }
  .ff-home-slide h1,
  .ff-home-slide h2 { margin: 15px 0 10px; font-size: clamp(2.35rem, 11vw, 3.2rem); line-height: .95; }
  .ff-home-slide-copy > p { font-size: .84rem; line-height: 1.52; }
  .ff-home-slide .ff-home-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 17px 0 12px; }
  .ff-home-slide .ff-home-actions a { width: 100%; min-height: 48px; }
  .ff-home-slide .ff-home-proof { display: none; }
  .ff-home-metrics { padding: 9px; border-radius: 20px; }
  .ff-home-metrics > div { padding: 12px; border-radius: 15px; }
  .ff-home-metrics > div > i { margin-bottom: 8px; }
  .ff-home-metrics strong { font-size: 1.45rem; }
  .ff-home-metrics > p { padding: 11px; border-radius: 15px; }
  .ff-home-slide-points { gap: 7px; }
  .ff-home-slide-points > div { grid-template-columns: 42px minmax(0,1fr); padding: 11px; border-radius: 16px; }
  .ff-home-slide-points i { width: 42px; border-radius: 13px; }
  .ff-home-local-grid { gap: 7px; }
  .ff-home-local-grid > div { min-height: 100px; padding: 12px; border-radius: 16px; }

  .ff-home-compact .ff-home-section { padding-top: 28px !important; }
  .ff-home-compact .ff-home-sellers-section { padding-top: 24px !important; }
  .ff-home-compact .ff-home-heading { margin-bottom: 12px !important; }
  .ff-home-compact .ff-home-heading h2 { font-size: 1.8rem; }
  .ff-home-compact .ff-home-heading p { display: none; }
  .ff-seller-directory-link { min-height: 40px; padding: 0 11px; font-size: .65rem !important; }

  .ff-home-compact .ff-home-sellers {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(78%,1fr);
    grid-template-columns: none;
    gap: 10px;
    overflow-x: auto;
    padding: 1px 1px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .ff-home-compact .ff-home-sellers::-webkit-scrollbar { display: none; }
  .ff-home-compact .ff-home-seller { scroll-snap-align: start; }
  .ff-home-compact .ff-home-seller:last-child { grid-column: auto; }
  .ff-home-compact .ff-home-seller-cover { height: 96px; }

  .ff-home-compact .ff-home-confidence {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(78%,1fr);
    grid-template-columns: none;
    gap: 9px;
    overflow-x: auto;
    margin-top: 13px !important;
    padding: 1px 1px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .ff-home-compact .ff-home-confidence-top { margin: 0 11px 11px !important; }
  .ff-home-compact .ff-home-confidence::-webkit-scrollbar { display: none; }
  .ff-home-compact .ff-home-confidence > div { scroll-snap-align: start; }

  .ff-home-compact .ff-home-category-grid { grid-auto-rows: 120px; gap: 8px; }
  .ff-home-compact .ff-home-bottom { padding-top: 10px; }
}

@media (max-width: 360px) {
  body.ff-storefront .ff-brand-image-link { width: min(100%, 188px) !important; }
  body.ff-storefront .ff-header #logo .ff-brand-horizontal { width: 188px !important; }
  .ff-home-slide { min-height: 500px; padding-inline: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .ff-home-slider-track { scroll-behavior: auto; }
  .ff-home-slide .ff-home-actions a,
  .ff-seller-directory-link,
  .ff-home-slide .ff-home-actions a i { transition: none; }
}
