/* Home — Maui HomePage / NewsFeed / LastProduct / LatestProducts parity */

.dz-home {
  display: flex;
  flex-direction: column;
  gap: 10px;
  direction: rtl;
  padding: 0;
}

.dz-home > * {
  margin-left: 0;
  margin-right: 0;
}

/* Shared card chrome */
.dz-home-card-shell {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--dz-surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 0;
}

/* —— News —— */
.dz-home-news-wrap {
  position: relative;
  height: 220px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background: var(--dz-surface);
}

.dz-home-news-scroller {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  /* no CSS smooth — instant wrap jumps must not animate */
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  direction: ltr; /* swipe left→right like Maui CarouselView LTR */
  scrollbar-width: none;
}

.dz-home-news-scroller::-webkit-scrollbar {
  display: none;
}

.dz-home-news-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  scroll-snap-align: start;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: #111;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
  border-radius: 12px;
}

.dz-home-news-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dz-home-news-slide__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

.dz-home-news-slide__fade {
  height: 56px;
  margin-bottom: -1px; /* seamlessly meet caption bg */
  background: linear-gradient(
    to top,
    var(--dz-news-accent) 0%,
    var(--dz-news-accent) 8%,
    transparent 100%
  );
}

.dz-home-news-slide__cap {
  padding: 8px 12px 12px;
  background: var(--dz-news-accent);
  color: var(--dz-news-title);
  text-align: right;
  direction: rtl;
  font-size: 0.875rem; /* 14 */
  font-weight: 700;
  line-height: 1.4;
  max-height: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root {
  --dz-news-accent: #ffffff;
  --dz-news-title: #242424;
}

@media (prefers-color-scheme: dark) {
  :root {
    --dz-news-accent: #350066;
    --dz-news-title: #ffffff;
  }
}

.dz-home-news-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: #ffffff;
  color: #242424;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .dz-home-news-badge {
    background: #242424;
    color: #ffffff;
  }
}

.dz-home-skel {
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(
    90deg,
    #e8e8e8 0%,
    #f5f5f5 50%,
    #e8e8e8 100%
  );
  background-size: 200% 100%;
  animation: dz-home-shimmer 1.2s ease-in-out infinite;
}

@media (prefers-color-scheme: dark) {
  .dz-home-skel {
    background: linear-gradient(90deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%);
    background-size: 200% 100%;
  }
}

@keyframes dz-home-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.dz-home-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 148px;
  padding: 16px;
  text-align: center;
  color: var(--dz-text-muted);
  font-size: 0.75rem; /* 12 */
  font-weight: 700;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  .dz-home-empty {
    background: #1e1e1e;
    border-color: #3a3a3a;
  }
}

.dz-home-empty__ico {
  width: 28px;
  height: 28px;
  color: var(--dz-text-muted);
  display: inline-flex;
}

.dz-home-empty__ico .dz-ico {
  width: 28px;
  height: 28px;
}

/* —— Photo —— */
.dz-home-photo {
  height: 148px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid #fff;
  padding: 0;
  margin: 0;
}

.dz-home-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* —— Last product (hero) —— */
.dz-home-hero {
  position: relative;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  min-height: 120px;
  padding-block: 8px;
  padding-inline-start: 10px;
  padding-inline-end: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, #8a2be2 0%, #20003d 60%);
  border: 0;
  direction: rtl;
}

.dz-home-hero__wave {
  position: absolute;
  inset: -20% -10%;
  opacity: 0.5;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 30%, rgba(255, 255, 255, 0.2), transparent 55%);
  animation: dz-home-wave 6s ease-in-out infinite alternate;
  transform: scale(1.85);
}

@keyframes dz-home-wave {
  from { transform: scale(1.75) translateY(4px); }
  to { transform: scale(1.9) translateY(-6px); }
}

.dz-home-hero__row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 100px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: right;
  color: #fff;
  font-family: inherit;
}

.dz-home-hero__cover {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  object-fit: cover;
  background: #000;
  border: 1px solid #fff;
  display: block;
}

.dz-home-hero__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}

.dz-home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 5px;
  padding: 4px 10px;
  color: #5d189f;
  font-size: 0.6875rem; /* 11 */
  font-weight: 700;
  line-height: 1.2;
}

.dz-home-hero__badge-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #00c853;
  box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.5);
  animation: dz-home-pulse 1.4s ease-out infinite;
}

@keyframes dz-home-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 200, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}

.dz-home-hero__name {
  margin: 5px 0 0;
  font-size: 1.25rem; /* 20 */
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: right;
  width: 100%;
}

.dz-home-hero__date {
  margin: 5px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #f47dff;
  font-size: 0.625rem; /* 10 */
  font-weight: 700;
}

.dz-home-hero__date-ico {
  color: #ea00ff;
  width: 15px;
  height: 15px;
  display: inline-flex;
}

.dz-home-hero__date-ico .dz-ico {
  width: 15px;
  height: 15px;
}

/* —— Latest products —— */
.dz-home-latest {
  padding: 12px 10px 10px;
  direction: rtl;
  border-radius: 20px;
  background: var(--dz-surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--dz-border);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .dz-home-latest {
    border-color: var(--dz-primary-dark);
  }
}

.dz-home-latest__title {
  margin: 0 4px 2px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dz-text);
  text-align: right;
}

.dz-home-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 10px 5px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  direction: rtl;
}

.dz-home-strip::-webkit-scrollbar {
  display: none;
}

.dz-home-mini {
  flex: 0 0 92px;
  width: 92px;
  min-height: 140px;
  border: 1px solid transparent;
  padding: 0;
  border-radius: 10px;
  background: #f5f5f5;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  color: var(--dz-text);
  text-align: center;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  .dz-home-mini {
    background: #2a2a2a;
    border-color: var(--dz-primary-dark);
  }
}

.dz-home-mini__cover {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
  background: #ddd;
}

.dz-home-mini__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 60px;
  background: linear-gradient(180deg, #aaaaaa 0.1%, #cccccc 9%, #ffffff 30%);
}

@media (prefers-color-scheme: dark) {
  .dz-home-mini__body {
    background: linear-gradient(180deg, #000 0.1%, #111 9%, #242424 30%);
  }
}

.dz-home-mini__name {
  margin: 0;
  padding: 4px 4px 2px;
  font-size: 0.75rem; /* 12 */
  font-weight: 700;
  line-height: 1.35;
  min-height: 42px;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dz-home-mini__date {
  margin-top: auto;
  background: #5d189f;
  color: #fff;
  font-size: 0.625rem; /* 10 */
  font-weight: 700;
  min-height: 18px;
  line-height: 18px;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dz-home-more {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  padding: 8px 10px;
  min-width: 72px;
}

.dz-home-more__icon {
  width: 28px;
  height: 28px;
  color: var(--dz-primary-dark);
  display: inline-flex;
}

.dz-home-more__icon .dz-ico {
  width: 28px;
  height: 28px;
}

.dz-home-more__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dz-primary-dark);
}

@media (prefers-color-scheme: dark) {
  .dz-home-more__label {
    color: #fff;
  }

  .dz-home-more__icon {
    color: var(--dz-primary-dark);
  }
}

.dz-home-skel-row {
  display: flex;
  gap: 8px;
  padding: 10px 5px;
  direction: rtl;
}

.dz-home-skel-card {
  width: 90px;
  height: 150px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* دسکتاپ (داخل قاب): کارت‌ها عرض را پر کنند تا فضای خالی نماند */
@container dz-stage (min-width: 400px) {
  .dz-home-strip {
    overflow-x: hidden;
    justify-content: stretch;
    align-items: stretch;
    gap: 8px;
    padding-inline: 2px;
  }

  .dz-home-mini {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  /* ستون آخر: آیکن+متن دقیقاً وسط فضای بین آخرین کارت و لبه چپ */
  .dz-home-more {
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
  }

  .dz-home-skel-row {
    gap: 8px;
  }

  .dz-home-skel-card {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}
