:root {
  --safo-shop-black: #0e0e12;
  --safo-shop-accent: #fe4a6e;
  --safo-shop-border: rgba(15, 23, 42, 0.08);
  --safo-shop-muted: #7a8191;
  --safo-shop-soft: #f5f6f8;
}

.home-premium-shell {
  background:
    radial-gradient(circle at top right, rgba(254, 74, 110, 0.10), transparent 22%),
    radial-gradient(circle at top left, rgba(15, 159, 92, 0.08), transparent 20%),
    linear-gradient(180deg, #fafafc 0%, #f8fafc 12%, #f8fafc 100%);
}

.safo-home-header-shell {
  position: sticky;
  top: 0;
  z-index: 120;
}

.safo-home-announce {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--safo-shop-black);
  color: #fff;
  padding: 6px 12px;
  min-height: 32px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.safo-home-announce.is-hidden {
  display: none;
}

.safo-home-announce-icon,
.safo-home-announce-close {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safo-home-announce-icon {
  color: #ffd166;
}

.safo-home-announce-close {
  margin-inline-start: auto;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.72);
}

.safo-home-announce-text {
  overflow: hidden;
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.safo-home-announce-text span {
  display: inline-block;
  animation: safoAnnouncementMarquee 18s linear infinite;
}

@keyframes safoAnnouncementMarquee {
  0% { transform: translateX(18%); }
  100% { transform: translateX(-18%); }
}

.premium-header--shop {
  position: static !important;
  background: rgba(255,255,255,0.96) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.safo-header-inner--shop {
  display: grid;
  gap: 12px;
  padding: 12px 14px 10px !important;
}

.safo-home-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.safo-home-wordmark {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  text-align: right;
}

.safo-home-wordmark-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  padding: 5px;
  box-shadow: 0 8px 18px rgba(15, 159, 92, 0.14);
  flex-shrink: 0;
}

.safo-home-wordmark-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.safo-home-wordmark-copy strong {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 1.42rem;
  line-height: 1;
  letter-spacing: 0.14em;
  color: #111;
  text-transform: uppercase;
}

.safo-home-wordmark-copy span {
  font-size: 11px;
  color: var(--safo-shop-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.safo-home-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.safo-header-btn--shop {
  width: 40px !important;
  height: 40px !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ffffff, #f7f8fa) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05) !important;
}

.safo-home-searchbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8f8f9, #f2f3f5);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 8px 18px rgba(15, 23, 42, 0.04);
}

.safo-home-searchbar-icon {
  color: #b0b7c3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safo-home-searchbar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #1f2937;
}

.safo-home-searchbar input::placeholder {
  color: #c1c7d0;
}

.safo-home-searchbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.safo-home-search-action {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #8e96a3;
}

.safo-home-search-divider {
  width: 1px;
  height: 14px;
  background: rgba(15, 23, 42, 0.10);
}

.safo-home-search-meta {
  display: grid;
  gap: 8px;
}

.safo-home-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.safo-home-chip-row::-webkit-scrollbar,
.premium-top-tabs--header::-webkit-scrollbar {
  display: none;
}

.safo-home-chip-label {
  flex: 0 0 auto;
  color: #8f97a5;
  font-size: 11px;
  font-weight: 800;
}

.safo-home-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  color: #1f2937;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.safo-home-chip--accent {
  background: rgba(254, 74, 110, 0.08);
  color: #d83258;
  border-color: rgba(254, 74, 110, 0.12);
}

.premium-top-tabs--header {
  margin-bottom: 0 !important;
  padding: 0 0 2px !important;
  gap: 0 !important;
  overflow-x: auto;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.premium-top-tabs--header .top-tab {
  position: relative;
  flex: 0 0 auto;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #7d8491 !important;
  padding: 10px 14px 12px !important;
  min-height: auto !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.premium-top-tabs--header .top-tab.active {
  color: #111 !important;
}

.premium-top-tabs--header .top-tab.active::after {
  content: '';
  position: absolute;
  right: 50%;
  bottom: 0;
  transform: translateX(50%);
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #111;
}

.home-content-premium,
.profile-page {
  padding-top: 14px !important;
}

.home-hero-panel {
  padding: 14px 14px 0 !important;
}

.hero-slider-container-premium {
  min-height: 246px !important;
  height: 246px !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14) !important;
}

.hero-slider-container-premium .hero-slider-track,
.hero-slider-container-premium .hero-slide,
.hero-slider-container-premium .hero-skeleton {
  height: 246px !important;
}

.hero-premium-overlay {
  padding: 18px 18px 20px !important;
}

.hero-kicker {
  background: rgba(255,255,255,0.14) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
}

.hero-premium-title {
  max-width: 12ch !important;
}

.home-promo-card,
.quick-action-card,
.product-card,
.deal-card,
.ui2-suppliers__card,
.recent-card,
.category-card,
.section-block {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card,
.deal-card,
.ui2-suppliers__card,
.recent-card,
.quick-action-card {
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
}

.product-card:hover,
.deal-card:hover,
.home-promo-card:hover,
.quick-action-card:hover,
.ui2-suppliers__card:hover,
.recent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.10) !important;
}

.product-card-img-wrap,
.deal-card-img,
.home-promo-card,
.quick-action-card,
.ui2-suppliers__card {
  border-radius: 20px !important;
}

.section-block.premium-section,
.ui2-suppliers {
  margin-inline: 14px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255,255,255,0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(255,255,255,0.85);
}

@media (max-width: 380px) {
  .safo-home-wordmark-copy strong {
    font-size: 1.24rem;
    letter-spacing: 0.1em;
  }

  .safo-home-wordmark-copy span {
    font-size: 10px;
  }

  .safo-home-chip,
  .premium-top-tabs--header .top-tab {
    font-size: 11px !important;
  }
}

/* ── Latest suppliers refresh ─────────────────────────── */
.ui2-suppliers-carousel {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(228px, 246px);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 2px 2px 6px;
  margin-top: 10px;
  scrollbar-width: none;
}

.ui2-suppliers-carousel::-webkit-scrollbar {
  display: none;
}

.ui2-supplier-card {
  min-width: 228px !important;
  max-width: 246px !important;
  width: 100%;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 20px !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98)) !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden;
  scroll-snap-align: start;
}

.ui2-supplier-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12) !important;
}

.ui2-supplier-card__media-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe 50%, #dcfce7 100%);
  overflow: hidden;
}

.ui2-supplier-card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ui2-supplier-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.ui2-supplier-card__top {
  align-items: center;
}

.ui2-supplier-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #dcfce7);
  color: #065F46;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.ui2-supplier-name {
  font-size: 14px;
  white-space: normal;
  line-height: 1.4;
}

.ui2-supplier-location {
  margin-top: 4px;
  font-size: 11px;
}

.ui2-supplier-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  background: rgba(255,255,255,0.92);
  color: #065F46;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.ui2-supplier-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.ui2-supplier-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ui2-supplier-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.ui2-supplier-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ui2-supplier-action {
  min-height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ui2-supplier-action:hover {
  transform: translateY(-1px);
}

.ui2-supplier-action--primary {
  background: linear-gradient(135deg, #2563eb, #49B47B);
  color: #fff !important;
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.18);
}

.ui2-supplier-action--ghost {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: #fff;
  color: #1d4ed8 !important;
}

/* ── Categories page sidebar spacing fix ─────────────── */
.cats-sidebar {
  width: 122px !important;
  min-width: 122px !important;
}

.cats-list-item {
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px;
}

.cats-list-name {
  font-size: 12.5px;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .ui2-suppliers-carousel {
    grid-auto-columns: minmax(214px, 86%);
  }

  .cats-sidebar {
    width: 118px !important;
    min-width: 118px !important;
  }
}

@media (max-width: 360px) {
  .ui2-suppliers-carousel {
    grid-auto-columns: minmax(200px, 90%);
  }

  .cats-sidebar {
    width: 112px !important;
    min-width: 112px !important;
  }

  .cats-list-name {
    font-size: 12px;
  }
}

/* Mobile header: notifications replace the cart shortcut. The cart remains
   available from the persistent bottom navigation and its own page. */
@media (max-width: 768px) {
  .safo-home-header-actions .safo-header-btn--cart {
    display: none !important;
  }

  .safo-home-header-actions .safo-header-btn--notif {
    display: inline-flex !important;
  }
}


/* ── Home header premium refinement ─────────────────────
   Visual-only layer: preserves existing navigation handlers. */
.safo-home-header-shell {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(5,96,68,.12);
  box-shadow: 0 12px 30px rgba(5,96,68,.08);
}

.safo-home-header-top {
  min-height: 58px;
  gap: 14px;
}

.safo-home-wordmark {
  gap: 12px;
  padding: 0;
  cursor: pointer;
}

.safo-home-wordmark-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  padding: 6px;
  border: 1px solid rgba(5,96,68,.12);
  box-shadow: 0 10px 22px rgba(5,96,68,.16);
}

.safo-home-wordmark-copy strong {
  color: #056044;
  font-size: 1.56rem;
  letter-spacing: .16em;
}

.safo-home-wordmark-copy span {
  color: #648077;
  font-size: 11px;
}

.safo-home-header-actions {
  gap: 9px;
}

.safo-header-btn--shop {
  position: relative;
  width: 48px !important;
  height: 48px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 16px !important;
  background: linear-gradient(180deg,#ffffff 0%,#effaf5 100%) !important;
  border: 1px solid rgba(5,96,68,.14) !important;
  color: #056044 !important;
  box-shadow: 0 8px 18px rgba(5,96,68,.10) !important;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.safo-header-btn--shop svg {
  width: 25px !important;
  height: 25px !important;
  stroke-width: 2.25;
}

.safo-header-btn--shop:hover,
.safo-header-btn--shop:focus-visible {
  transform: translateY(-2px);
  background: #e1f5eb !important;
  box-shadow: 0 12px 24px rgba(5,96,68,.16) !important;
  outline: none;
}

.safo-header-btn--cart {
  background: linear-gradient(180deg,#056044 0%,#087c59 100%) !important;
  color: #fff !important;
  border-color: #056044 !important;
  box-shadow: 0 10px 22px rgba(5,96,68,.23) !important;
}

.safo-header-btn--cart:hover,
.safo-header-btn--cart:focus-visible {
  background: #044b36 !important;
}

.safo-home-searchbar {
  min-height: 52px;
  border-radius: 18px;
  background: #f4fbf7;
  border: 1px solid rgba(5,96,68,.15);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.98), 0 8px 20px rgba(5,96,68,.06);
}

.safo-home-searchbar-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #dff4e9;
  color: #056044;
}

.safo-home-searchbar-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.4;
}

.safo-home-searchbar input {
  color: #163b2f;
  font-size: 13px;
  font-weight: 700;
}

.safo-home-searchbar input::placeholder {
  color: #78968a;
}

.safo-home-search-action {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #056044;
}

.safo-home-search-action svg {
  width: 18px !important;
  height: 18px !important;
}

.safo-home-header-shell + .home-content-premium {
  padding-top: 10px !important;
}

@media (max-width: 520px) {
  .safo-header-inner--shop {
    padding: 10px 12px 11px !important;
    gap: 10px;
  }

  .safo-home-header-top {
    min-height: 50px;
    gap: 9px;
  }

  .safo-home-wordmark-logo {
    width: 44px;
    height: 44px;
  }

  .safo-home-wordmark-copy strong {
    font-size: 1.32rem;
    letter-spacing: .12em;
  }

  .safo-home-wordmark-copy span {
    font-size: 10px;
  }

  .safo-home-header-actions {
    gap: 6px;
  }

  .safo-header-btn--shop {
    width: 43px !important;
    height: 43px !important;
    border-radius: 14px !important;
  }

  .safo-header-btn--shop svg {
    width: 23px !important;
    height: 23px !important;
  }

  .safo-home-searchbar {
    min-height: 49px;
  }
}

@media (max-width: 360px) {
  .safo-home-wordmark-copy span {
    display: none;
  }

  .safo-home-wordmark-copy strong {
    font-size: 1.18rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .safo-header-btn--shop {
    transition: none;
  }
}

/* The repeated chip rows and tab strip are intentionally removed from
   the home header markup; keep this rule as a defensive visual fallback
   for stale cached HTML from older home snapshots. */
.safo-home-header-shell .safo-home-search-meta,
.safo-home-header-shell .premium-top-tabs--header {
  display: none !important;
}

.safo-home-announce {
  background: #e8f7ef;
  color: #056044;
  border-bottom: 1px solid rgba(5,96,68,.10);
  box-shadow: none;
}

.safo-home-announce-icon {
  color: #0a8b63;
}

.safo-home-announce-close {
  background: rgba(5,96,68,.08);
  color: #056044;
}

@media (max-width: 520px) {
  .safo-home-announce {
    min-height: 30px;
    padding: 5px 10px;
  }
}

@media (min-width: 760px) {
  .safo-header-inner--shop {
    max-width: 1180px;
    margin: 0 auto;
    grid-template-columns: minmax(240px,.85fr) minmax(360px,1.5fr);
    grid-template-areas: 'top search';
    align-items: center;
    column-gap: 22px;
    row-gap: 0;
  }

  .safo-home-header-top { grid-area: top; }
  .safo-home-searchbar { grid-area: search; }
}

@media (min-width: 760px) {
  .safo-home-header-shell {
    padding-inline: 16px;
  }
}

@media (min-width: 1100px) {
  .safo-home-header-top {
    min-height: 66px;
  }

  .safo-header-btn--shop {
    width: 52px !important;
    height: 52px !important;
    border-radius: 17px !important;
  }

  .safo-header-btn--shop svg {
    width: 27px !important;
    height: 27px !important;
  }
}

@media (max-width: 759px) {
  .safo-home-header-shell {
    padding-inline: 0;
  }
}

/* Avoid the old dark theme leaking into the refreshed home header. */
.safo-home-header-shell,
.safo-home-header-shell .premium-header--shop {
  color-scheme: light;
}

.safo-home-header-shell button {
  -webkit-tap-highlight-color: transparent;
}

.safo-home-header-shell button:focus-visible {
  outline: 3px solid rgba(10,139,99,.28);
  outline-offset: 2px;
}
