/* SAFO — Home Smart Compression
   Loaded last to compress mobile homepage without changing app features. */

:root {
  --safo-compress-gap: 10px;
  --safo-compress-gap-lg: 12px;
  --safo-compress-radius: 20px;
  --safo-compress-border: rgba(15, 23, 42, 0.08);
}

.smart-home-cluster__header {
  align-items: flex-start;
  gap: 10px;
}

.smart-home-cluster__caption {
  margin-top: 4px;
  color: #7b8798;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.smart-home-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.smart-home-stat {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(14,159,94,0.10), rgba(37,99,235,0.06));
  color: #0f5132;
  border: 1px solid rgba(14,159,94,0.10);
  font-size: 11px;
  font-weight: 800;
}

.smart-home-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.smart-home-tab {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--safo-compress-border);
  background: rgba(255,255,255,0.88);
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.smart-home-tab.is-active {
  color: #065F46;
  border-color: rgba(14,159,94,0.16);
  background: linear-gradient(180deg, rgba(14,159,94,0.14), rgba(14,159,94,0.05));
  box-shadow: inset 0 0 0 1px rgba(14,159,94,0.10);
}

.smart-home-panel[hidden] {
  display: none !important;
}

.smart-home-grid {
  padding: 0 !important;
}

.smart-categories-strip {
  padding: 2px 0 0 !important;
}

.smart-home-promo-strip {
  padding-inline: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.smart-home-promo-card {
  min-height: 84px !important;
  padding: 14px !important;
  align-items: flex-start !important;
  gap: 10px !important;
}

.smart-home-promo-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px !important;
}

.smart-home-promo-card span:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45 !important;
  font-size: 11px !important;
}

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

  .safo-home-announce {
    min-height: 28px;
    padding: 5px 10px;
  }

  .safo-home-announce-text {
    font-size: 10px;
  }

  .safo-home-wordmark-logo,
  .safo-header-btn--shop {
    width: 36px !important;
    height: 36px !important;
    border-radius: 12px !important;
  }

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

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

  .safo-home-searchbar {
    min-height: 42px;
    border-radius: 14px;
    gap: 8px;
    padding: 0 9px 0 10px;
  }

  .safo-home-searchbar input {
    font-size: 12px;
  }

  .safo-home-search-action {
    width: 28px;
    height: 28px;
  }

  .safo-home-search-meta {
    gap: 6px;
  }

  .safo-home-chip-row {
    gap: 6px;
  }

  .safo-home-chip {
    padding: 6px 10px;
    font-size: 11px;
  }

  .premium-top-tabs--header .top-tab {
    padding: 8px 12px 10px !important;
    font-size: 12px !important;
  }

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

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

  .hero-slider-container-premium {
    min-height: 190px !important;
    height: 190px !important;
    border-radius: 24px !important;
  }

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

  .hero-premium-overlay {
    padding: 14px 14px 16px !important;
  }

  .hero-meta-row {
    margin-bottom: 8px !important;
  }

  .hero-kicker,
  .hero-slide-counter {
    font-size: 10px !important;
    padding: 5px 8px !important;
  }

  .hero-premium-title {
    font-size: 24px !important;
    line-height: 1.08 !important;
    max-width: 10ch !important;
    margin-bottom: 6px !important;
  }

  .hero-premium-text {
    font-size: 11px !important;
    line-height: 1.55 !important;
    max-width: 32ch !important;
  }

  .hero-slider-dots {
    bottom: 10px !important;
  }

  .hero-slider-arrow {
    width: 34px !important;
    height: 34px !important;
  }

  .smart-home-promo-strip {
    padding-inline: 12px;
    gap: 8px;
  }

  .section-block.premium-section,
  .ui2-suppliers {
    margin-inline: 12px;
    padding: 12px;
    border-radius: 20px;
  }

  .smart-home-cluster--categories {
    margin-top: 10px;
  }

  .section-header-inline h3,
  .ui2-suppliers__title {
    font-size: 18px !important;
    line-height: 1.2;
  }

  .view-all,
  .ui2-suppliers__link {
    font-size: 12px !important;
  }

  .alibaba-categories-scroll {
    gap: 8px !important;
    padding: 0 !important;
    margin-top: 8px;
  }

  .category-card,
  .pro-cat-card,
  .alibaba-category-card {
    min-width: 86px !important;
    max-width: 92px !important;
    padding: 8px 6px !important;
    border-radius: 16px !important;
  }

  .category-card svg,
  .pro-cat-icon-wrap,
  .alibaba-category-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .smart-home-feed {
    scroll-margin-top: 84px;
  }

  .smart-home-panels {
    min-height: 0;
  }

  .products-grid.smart-home-grid,
  .deals-grid.smart-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 0 !important;
  }

  .mx-product-card,
  .mx-skeleton-card,
  .product-card,
  .deal-card {
    border-radius: 16px !important;
    box-shadow: 0 8px 20px rgba(15,23,42,0.06) !important;
  }

  .mx-product-thumb {
    aspect-ratio: 1 / 1.02 !important;
  }

  .mx-badge {
    top: 8px !important;
    inset-inline-start: 8px !important;
    min-height: 22px !important;
    padding: 0 8px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
  }

  .mx-product-body {
    padding: 8px 9px 10px !important;
  }

  .mx-product-price-row {
    gap: 5px;
    margin-bottom: 4px;
  }

  .mx-product-price {
    font-size: 14px !important;
    line-height: 1.1 !important;
  }

  .mx-product-old-price {
    font-size: 10px !important;
  }

  .mx-product-title {
    font-size: 11px !important;
    min-height: 30px !important;
    line-height: 1.35 !important;
    margin-bottom: 0 !important;
  }

  .ui2-suppliers__header {
    gap: 8px;
  }

  .ui2-suppliers-carousel {
    grid-auto-columns: minmax(176px, 68%) !important;
    gap: 10px;
    margin-top: 8px;
    padding-bottom: 2px;
  }

  .ui2-supplier-card,
  .ui2-suppliers__card {
    min-width: 176px !important;
    max-width: 100% !important;
    border-radius: 16px !important;
  }

  .ui2-supplier-card__body {
    padding: 11px;
    gap: 8px;
  }

  .ui2-supplier-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .ui2-supplier-name {
    font-size: 13px;
  }

  #bottomNav,
  .bottom-nav {
    inset-inline: 10px !important;
    bottom: 8px !important;
    padding: 8px 6px !important;
    border-radius: 22px !important;
    gap: 4px !important;
  }

  .bottom-nav-item,
  .ui2-nav-item {
    min-height: 52px;
    gap: 3px;
    border-radius: 14px;
  }

  .bottom-nav-item span:last-child,
  .ui2-nav-item span:last-child {
    font-size: 10px;
  }

  .bottom-nav-item.active::after,
  .ui2-nav-item.active::after {
    top: 5px;
    inset-inline: 24%;
  }

  #app-content,
  .app-content,
  main {
    padding-bottom: 96px;
  }
}

@media (max-width: 420px) {
  .smart-home-promo-strip {
    grid-template-columns: 1fr 1fr;
  }

  .smart-home-tab {
    min-height: 36px;
    padding-inline: 8px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .hero-slider-container-premium {
    min-height: 176px !important;
    height: 176px !important;
  }

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

  .hero-premium-title {
    font-size: 21px !important;
  }

  .section-block.premium-section,
  .ui2-suppliers,
  .smart-home-promo-strip,
  .home-hero-panel {
    margin-inline: 0;
  }

  .section-block.premium-section,
  .ui2-suppliers {
    margin-inline: 10px;
    padding: 10px;
  }

  .smart-home-promo-strip {
    padding-inline: 10px;
  }

  .products-grid.smart-home-grid,
  .deals-grid.smart-home-grid {
    gap: 6px !important;
  }
}
