/**
 * پیش‌نمایش هوم حرفه‌ای — چیدمان موبایل‌محور فروشگاهی
 * فقط روی body.hpb-home-pro-preview اعمال می‌شود
 */

body.hpb-home-pro-preview {
  --hpro-bg: #f3f4f6;
  --hpro-surface: #ffffff;
  --hpro-ink: #111827;
  --hpro-muted: #6b7280;
  --hpro-line: #e5e7eb;
  --hpro-brand: #4a1698;
  --hpro-brand-soft: #f3e8ff;
  --hpro-radius: 14px;
  --hpro-gap: 10px;
  background: var(--hpro-bg) !important;
}

body.hpb-home-pro-preview .entry-title,
body.hpb-home-pro-preview .page-title,
body.hpb-home-pro-preview .woocommerce-products-header,
body.hpb-home-pro-preview .hpb-home-pro-preview .wp-block-post-title {
  display: none !important;
}

body.hpb-home-pro-preview .site-main,
body.hpb-home-pro-preview .entry-content,
body.hpb-home-pro-preview .page-content,
body.hpb-home-pro-preview article {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hpro {
  direction: rtl;
  color: var(--hpro-ink);
  padding-bottom: 28px;
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}

.hpro__badge {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0;
  padding: 8px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(90deg, #4a1698, #7c3aed);
  box-shadow: 0 4px 14px rgba(74, 22, 152, 0.25);
}

.hpro-sec {
  margin: 0;
  padding: var(--hpro-gap) 0 0;
}

.hpro-sec__inner {
  width: min(100%, 720px);
  margin-inline: auto;
  padding-inline: 10px;
  box-sizing: border-box;
}

.hpro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  min-height: 28px;
}

.hpro-head__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--hpro-ink);
  letter-spacing: -0.02em;
}

.hpro-head__link {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--hpro-brand) !important;
  text-decoration: none !important;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--hpro-brand-soft);
}

/* Hero */
.hpro-hero {
  padding-top: 8px;
}

.hpro-hero .hpro-sec__inner {
  padding-inline: 8px;
}

.hpro-hero .swiper,
.hpro-hero .hamta-slider,
.hpro-hero .blanton-slider,
.hpro-hero [class*="slider"] {
  border-radius: var(--hpro-radius);
  overflow: hidden;
}

.hpro-hero img {
  border-radius: var(--hpro-radius);
}

/* Categories — horizontal shop chips feel */
.hpro-cats .hpro-sec__inner {
  padding-inline: 10px;
}

.hpro-cats__viewport {
  margin-inline: -2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.hpro-cats__viewport::-webkit-scrollbar {
  display: none;
}

.hpro-cats .blanton-grid,
.hpro-cats .hamta-grid,
.hpro-cats [class*="grid-wrap"],
.hpro-cats .hpb-grid {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  width: max-content !important;
  min-width: 100%;
  padding: 2px 2px 4px !important;
  margin: 0 !important;
}

.hpro-cats .blanton-grid > *,
.hpro-cats .hamta-grid > *,
.hpro-cats .hpb-grid > *,
.hpro-cats [class*="grid"] .item,
.hpro-cats [class*="grid-item"] {
  flex: 0 0 auto !important;
  width: 72px !important;
  max-width: 72px !important;
  margin: 0 !important;
}

.hpro-cats img {
  width: 56px !important;
  height: 56px !important;
  object-fit: contain !important;
  border-radius: 14px !important;
  background: var(--hpro-surface);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
  border: 1px solid var(--hpro-line);
  padding: 6px;
  box-sizing: border-box;
}

.hpro-cats a,
.hpro-cats .item-title,
.hpro-cats [class*="title"] {
  font-size: 11px !important;
  line-height: 1.35 !important;
  text-align: center !important;
  color: var(--hpro-ink) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}

.hpro-cats .swiper-button-next,
.hpro-cats .swiper-button-prev,
.hpro-cats .nav,
.hpro-cats [class*="arrow"],
.hpro-cats [class*="nav-"] {
  display: none !important;
}

/* Flash / promo */
.hpro-flash .hpro-sec__inner {
  padding-inline: 8px;
}

.hpro-flash .flash-deals,
.hpro-flash .hamta-promo,
.hpro-flash [class*="promo"] {
  border-radius: var(--hpro-radius);
  overflow: hidden;
}

/* Shops banner already styled; tighten */
.hpro-shops .hpb-shops-banner {
  padding: 0 !important;
}

.hpro-shops .hpb-shops-banner .crafto-container {
  padding-inline: 0 !important;
  max-width: none !important;
}

/* Hide duplicate widget titles — section head is enough */
.hpro-products .carousel-title,
.hpro-products .section-title,
.hpro-products .hpb-carousel__title,
.hpro-products .blanton-title,
.hpro-partners .carousel-title,
.hpro-partners .section-title,
.hpro-cats .section-title,
.hpro-cats .blanton-title {
  display: none !important;
}

/* Product rails */
.hpro-products .hpro-products__rail {
  margin-inline: -4px;
}

.hpro-products .swiper-slide,
.hpro-products .product,
.hpro-products .hamta-carousel .item {
  background: var(--hpro-surface);
  border-radius: 12px;
  border: 1px solid var(--hpro-line);
  overflow: hidden;
}

.hpro-products .swiper-button-next,
.hpro-products .swiper-button-prev {
  width: 28px !important;
  height: 28px !important;
  margin-top: 0 !important;
  background: var(--hpro-surface) !important;
  border: 1px solid var(--hpro-line);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.hpro-products .swiper-button-next::after,
.hpro-products .swiper-button-prev::after {
  font-size: 12px !important;
  font-weight: 700;
  color: var(--hpro-ink);
}

/* Trust strip */
.hpro-trust__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hpro-trust__item {
  background: var(--hpro-surface);
  border: 1px solid var(--hpro-line);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hpro-trust__item strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--hpro-brand);
}

.hpro-trust__item span {
  font-size: 10px;
  line-height: 1.4;
  color: var(--hpro-muted);
}

/* Partners */
.hpro-partners img {
  filter: grayscale(0.15);
  opacity: 0.92;
}

.hpro-footnote {
  width: min(100%, 720px);
  margin: 18px auto 0;
  padding: 0 14px;
  text-align: center;
  font-size: 12px;
  color: var(--hpro-muted);
  line-height: 1.6;
}

/* Desktop: keep mobile composition centered, not stretched dashboard */
@media (min-width: 768px) {
  .hpro {
    padding-top: 8px;
  }

  .hpro__badge {
    border-radius: 0 0 12px 12px;
    max-width: 720px;
    margin-inline: auto;
  }

  .hpro-sec__inner {
    padding-inline: 12px;
  }
}

/* Reduce huge section paddings from theme/widgets inside preview */
body.hpb-home-pro-preview .hpro section,
body.hpb-home-pro-preview .hpro .section,
body.hpb-home-pro-preview .hpro .crafto-container {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.hpb-home-pro-preview .hpro .pt-5,
body.hpb-home-pro-preview .hpro .pb-5,
body.hpb-home-pro-preview .hpro .py-5,
body.hpb-home-pro-preview .hpro .pt-4,
body.hpb-home-pro-preview .hpro .pb-4 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
