/* ==========================================================================
   home.css — صفحه اصلی (۹ بخش)
   ========================================================================== */

/* ---------- ۱. هیرو ---------- */
.hero-section {
  border-radius: var(--r-hero);
  overflow: hidden;
  background: linear-gradient(170deg, #fffdf8 0%, #f7efe2 100%);
  box-shadow: var(--shadow);
  padding: 18px 16px 0;
  text-align: center;
}

.hero-lux-copy { margin-bottom: 14px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 13px;
  margin-bottom: 10px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ref-badge-color);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(163, 111, 44, .12);
}

.hero-section h1 { margin-bottom: 7px; }

.hero-section p {
  font-size: var(--ref-hero-sub-size);
  font-weight: 700;
  line-height: 21.5px;
  color: var(--ref-hero-sub-color);
}

.hero-image-wrap { margin: 0 -16px; }

.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ---------- ۲. کارت جستجوی سریع ---------- */
.search-card {
  margin-top: 11px;
  background: var(--ref-search-card-bg);
  border: 1px solid rgba(217, 198, 173, .62);
  border-radius: var(--r-card-lg);
  box-shadow: 0 13px 32px rgba(65, 42, 20, .067);
  padding: 13px 11px 12px;
}

.search-card h2 { margin-bottom: 2px; }

.search-sub {
  font-size: 11.5px;
  margin-bottom: 11px;
}

/* ---------- ۲.۱ سربرگ و فیلترهای کارت جستجو (الگوی مرجع) ---------- */
.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.search-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
}

.search-head .search-sub {
  margin: 0;
  font-size: 10.8px;
  line-height: 16px;
  color: #8d7b68;
}

.search-mini-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(211, 170, 105, .44);
  border-radius: 14px;
  background: #fff8ed;
  color: var(--sadaf-gold);
}

.search-mini-icon svg {
  width: 18px;
  height: 18px;
}

.search-mini-icon:focus-visible {
  outline: 2px solid var(--sadaf-gold);
  outline-offset: 2px;
}

.search-tabs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 7px;
  padding: 5px;
  margin-bottom: 10px;
  border-radius: 15px;
  background: #f8f1e8;
}

.search-tabs button {
  height: 32px;
  border-radius: 11px;
  color: var(--sadaf-muted);
  font-size: 11.4px;
  font-weight: 700;
  transition: background var(--t-fast), color var(--t-fast);
}

.search-tabs button.is-active {
  background: #fff;
  color: #a36f2c;
  box-shadow: 0 5px 12px rgba(110, 70, 27, .067);
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-box {
  position: relative;
  display: block;
  padding: 9px 10px 8px;
  border: 1px solid rgba(229, 218, 204, .95);
  border-radius: 15px;
  background: linear-gradient(#fff 0%, #fffdf9 100%);
  box-shadow: 0 5px 14px rgba(50, 32, 17, .027);
}

.filter-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.filter-label {
  color: #998976;
  font-size: 10px;
  font-weight: 800;
}

.filter-side-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(220, 186, 135, .42);
  border-radius: 10px;
  background: #fbf3e8;
  color: #c08a3e;
}

.filter-side-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-box select {
  width: 100%;
  height: 22px;
  padding: 0 0 0 22px;
  border: 0;
  background: transparent;
  color: #302923;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
}

.filter-box select:focus-visible {
  outline: 2px solid var(--sadaf-gold);
  outline-offset: 1px;
  border-radius: 6px;
}

.native-select-arrow {
  position: absolute;
  left: 11px;
  bottom: 10px;
  color: var(--sadaf-gold);
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

/* ---------- ۳. سربرگ‌ها ---------- */
.featured-title { margin-top: 20px; }
.phases-title { margin-top: 20px; }

/* ---------- ۴. کروسل منتخب ---------- */
.featured-carousel-wrap {
  margin-inline: calc(var(--shell-pad-x) * -1);
  padding-top: 2px;
}

.featured-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
}

.featured-viewport::-webkit-scrollbar { display: none; }

.featured-carousel {
  display: flex;
  gap: 10px;
  width: max-content;
  padding: 2px var(--shell-pad-x) 6px;
  will-change: transform;
}

/* حرکت خودکار: کلاس .is-auto با JS اضافه و با transform جابه‌جا می‌شود */
.featured-carousel.is-auto { transition: transform 400ms linear; }

.featured-slide {
  width: 235px;
  flex: none;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 0 0 10px;
  border-radius: var(--r-card-lg);
  background: var(--sadaf-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.featured-slide:hover {
  transform: translateY(-2px);
  box-shadow: var(--sadaf-shadow);
}

.featured-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #efe6d6;
  margin-bottom: 9px;
}

.featured-image-link { display: block; height: 100%; }

.featured-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-slide strong {
  display: block;
  padding: 0 10px;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sadaf-text);
  line-height: 1.55;
}

.featured-slide .row-price {
  display: block;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--sadaf-gold);
  margin-bottom: 2px;
}

.featured-slide .row-meta {
  display: block;
  padding: 0 10px;
  font-size: 10.5px;
  color: var(--sadaf-muted);
}

/* ---------- ۶. استریپ فازها ---------- */
.phase-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  margin-inline: calc(var(--shell-pad-x) * -1);
  padding: 2px var(--shell-pad-x) 8px;
}

.phase-strip::-webkit-scrollbar { display: none; }

/* تصویر فاز با background-image درون‌خط روی خود عنصر تنظیم می‌شود.
   توجه: از var(--phase-img) استفاده نمی‌کنیم چون مقدار یک custom property
   در زمان مصرف نسبت به فایل stylesheet حل می‌شود، نه نسبت به سند
   (همین اشکال، تصویر فاز ۱ را در سایت مرجع ۴۰۴ کرده است). */
.phase-card {
  position: relative;
  flex: none;
  width: 132px;
  height: 118px;
  border-radius: 16px;
  overflow: hidden;
  background: #e8dcc4 center / cover no-repeat;
  scroll-snap-align: start;
  display: block;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.phase-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 23, 17, .06), rgba(31, 23, 17, .48));
}

.phase-card span {
  position: absolute;
  inset-inline: 0;
  bottom: 9px;
  z-index: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #fffdf8;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}

.phase-card { transition: transform var(--t-fast), box-shadow var(--t-fast), background-size var(--t-base); }
.phase-card:hover { transform: translateY(-2px); box-shadow: var(--sadaf-shadow); background-size: 108% auto; }

/* ---------- ۷. کارت نقشه ---------- */
.phase-map-card {
  margin-top: 14px;
  padding: 10px;
  background: #fff;
  border-radius: var(--r-card-lg);
}

.map-visual-wrap {
  border-radius: 16px;
  overflow: hidden;
  background: #eef1ea;
}

.map-image {
  width: 100%;
  height: auto;
  display: block;
}

.map-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 46px;
  border-radius: 14px;
  background: var(--sadaf-gold);
  color: #fffdf8;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--t-fast);
}

.map-search-btn:hover { background: #a9762f; }

/* ---------- ۸. چرا ما ---------- */
.why-us {
  margin-top: 14px;
  padding: 15px 12px;
  background: #fff;
  border-radius: var(--r-card);
}

.why-us h2 { margin-bottom: 11px; }

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.why-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 9px;
  border-radius: 13px;
  background: #fbf6ec;
  border: 1px solid var(--sadaf-line);
}

.why-item i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff;
  flex: none;
}

.why-item svg {
  width: 17px;
  height: 17px;
  color: var(--sadaf-gold);
}

.why-item strong {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sadaf-text);
  line-height: 1.6;
}

/* ---------- ۹. CTA پایانی ---------- */
.cta-upgrade {
  margin-top: 14px;
  padding: 16px 10px 14px;
  border-radius: var(--r-cta);
  background: linear-gradient(165deg, #fffdf8, #f6ecdb);
}

.cta-upgrade h2 {
  text-align: center;
  margin-bottom: 5px;
}

.cta-upgrade > p {
  text-align: center;
  font-size: 11.5px;
  margin-bottom: 13px;
}

.cta-actions {
  display: grid;
  gap: 8px;
}

.cta-item {
  display: block;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--sadaf-line);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.cta-item:hover {
  border-color: rgba(184, 137, 59, .5);
  transform: translateY(-1px);
}

.cta-kicker {
  display: block;
  font-size: 11px;
  color: var(--sadaf-muted);
  line-height: 1.7;
  margin-bottom: 6px;
}

.cta-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--sadaf-gold);
}

.cta-link i { font-style: normal; }

/* ---------- حالت خالی/خطای کروسل منتخب ---------- */
.featured-empty {
  width: min(calc(100vw - 32px), 360px);
  flex: none;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--sadaf-line);
  border-radius: var(--r-card-lg);
  background: var(--sadaf-card);
  color: var(--sadaf-muted);
  font-size: 12px;
  line-height: 1.7;
}

.featured-empty strong {
  font-size: 13px;
  color: var(--sadaf-text);
}

.featured-empty a {
  margin-top: 4px;
  color: var(--sadaf-gold);
  font-weight: 700;
}

.featured-empty--error {
  border-color: rgba(176, 68, 53, .32);
}

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 380px) {
  .featured-slide { width: 205px; }
  .phase-card { width: 116px; height: 104px; }
  .why-grid { grid-template-columns: 1fr; }
  .hero-section { padding: 14px 12px 0; }
  .hero-image-wrap { margin: 0 -12px; }
}

@media (max-width: 340px) {
  .featured-slide { width: 186px; }
}
