/* =========================================================================
   Garmeja Landing — style.css
    ========================================================================= */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  /* ---- Colors (طبق Specifications پیوست) ---- */
  --color-orange: #EF5D33;      /* نارنجی سازمانی / CTA / بردر هاور */
  --color-blue: #0047AB;        /* آبی لندنی - قیمت نهایی جایگزین */
  --color-black: #222222;       /* عنوان/متن اصلی */
  --color-grey: #717171;        /* متن ثانویه / مشخصات فنی */
  --color-grey-end: #608A80;    /* گرادیانت کمکی */
  --color-border: #EBEBEB;      /* خطوط جداکننده ظریف */
  --color-tag-bg: #F5F5F5;      /* پس‌زمینه بسیار روشن تگ‌های اختصاصی */
  --color-star: #FFD700;

  --container-max: 1200px;
  --container-content: 1140px;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  --shadow-card: 0px 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0px 12px 28px rgba(0, 0, 0, 0.14);

  --font-body: 'Vazirmatn', 'IRANSansX', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--color-black);
  background: #FAFAFA;
  direction: rtl;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }

.container {
  width: 100%;
  max-width: var(--container-content);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================= HEADER ============================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  max-width: var(--container-max);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.logo-mark { color: var(--color-orange); font-size: 20px; }
.hamburger { color: var(--color-black); display: flex; }

/* ============================= HERO ============================= */
.hero {
  position: relative;
  width: 100%;
  height: 350px; /* ~30vh طبق سند دسکتاپ */
  overflow: hidden;
}
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 100%);
}
.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
}
.hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #FFFFFF;
}
.hero-subtitle {
  margin: 8px 0 0;
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  font-weight: 400;
}

/* ==================== FLOATING SEARCH BOX (Desktop) ==================== */
/* wrapper بیرون از .hero قرار دارد؛ با margin-top منفی روی عکس هدر می‌نشیند
   بدون اینکه overflow:hidden هیرو چیزی از باکس را قطع کند. */
.search-box-wrap {
  position: relative;
  z-index: 10;
  margin-top: -60px;
}
.search-box {
  max-width: 1000px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.search-row { display: flex; align-items: stretch; }
.search-row--primary { border-bottom: 1px solid var(--color-border); padding-bottom: 16px; }
.search-row--secondary { padding-top: 16px; align-items: center; gap: 16px; }

.search-field {
  flex: 1;
  padding: 0 16px;
  border-right: 1px solid var(--color-border);
}
.search-field:first-child { padding-right: 4px; }
.search-row--primary .search-field:last-child { border-right: 1px solid var(--color-border); }
/* نکته RTL: "left-border" در سند برای جداکردن ستون‌ها به‌کار رفته؛ در چیدمان راست‌به‌چپ
   معادل بصری آن border-right بین فیلدهاست که در بالا پیاده شده است. */

.search-field label {
  display: block;
  font-size: 12px;
  color: var(--color-grey);
  margin-bottom: 4px;
}
.field-control { display: flex; align-items: center; gap: 8px; }
.field-icon { color: var(--color-grey); flex-shrink: 0; }
.search-field input {
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--color-black);
  width: 100%;
  background: transparent;
}
#fieldDates { cursor: pointer; }
#dateFieldControl { cursor: pointer; }

.search-row--secondary .search-field {
  border-right: none;
  padding: 0;
  flex: 1;
}
.search-row--secondary .search-field--dropdown { max-width: 170px; }

/* ==================== CUSTOM DROPDOWN ==================== */
.dropdown { position: relative; }
.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--color-black);
  padding: 0;
}
.dropdown-value {
  flex: 1;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropdown-chevron {
  color: var(--color-grey);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.dropdown.is-open .dropdown-chevron { transform: rotate(180deg); color: var(--color-orange); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  min-width: 180px;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  border: 1px solid var(--color-border);
  padding: 6px;
  list-style: none;
  margin: 0;
  z-index: 50;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  max-height: 260px;
  overflow-y: auto;
}
.dropdown.is-open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-option {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--color-black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.12s ease;
}
.dropdown-option:hover { background: #F7F7F7; }
.dropdown-option.is-selected {
  background: #FEF1EC;
  color: var(--color-orange);
  font-weight: 600;
}
.dropdown-option.is-selected::after {
  content: '✓';
  font-size: 12px;
}

/* دراپ‌داون داخل Bottom Sheet کمی متفاوت است: تریگر شبیه یک اینپوت با بردر است */
.sheet-field .dropdown-trigger {
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 14px;
}
.sheet-field .dropdown-menu { right: 0; left: 0; }

.btn-icon-only {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F5F5F5;
  color: var(--color-black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-only-label { display: none; }

.btn-search {
  margin-right: auto; /* در ردیف دوم، سمت چپ می‌نشیند (RTL) */
  background: var(--color-orange);
  color: #FFFFFF;
  height: 48px;
  padding: 0 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: filter 0.15s ease;
}
.btn-search:hover { filter: brightness(0.94); }

/* ==================== QUICK FILTER CHIPS ==================== */
/* دسکتاپ: وسط‌چین، بدون اسکرول */
.chips-wrap {
  overflow: hidden;
}
.chips-track {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 20px 8px;
  max-width: var(--container-content);
  margin: 0 auto;
}
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-black);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--color-orange); color: var(--color-orange); }

/* ==================== LISTINGS GRID ==================== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-bottom: 60px;
}

/* ---- Card ---- */
.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #0F0F0F0D; /* بردر ظریف تقریبا نامرئی طبق ترفند سند */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: var(--color-orange);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-orange);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.card-fav {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-black);
}
.card-host-avatar {
  position: absolute;
  bottom: -20px; /* نصف روی عکس، نصف روی بدنه سفید کارت */
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.card-host-avatar img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  padding: 4px 12px 12px;
  padding-top: 24px; /* جا برای نیمه‌ی پایینی آواتار میزبان */
}

.card-title {
  font-size: 15px;
  font-weight: 600; /* DemiBold */
  color: var(--color-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 8px;
}

.card-specs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-grey);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.card-specs span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

.card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-tag {
  background: var(--color-tag-bg);
  color: var(--color-black);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}
.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-black);
}
.card-rating .reviews { font-weight: 400; color: var(--color-grey); }

.card-price { text-align: left; }
.card-price .old-price {
  font-size: 12px;
  color: var(--color-grey);
  text-decoration: line-through;
  display: block;
}
.card-price .final-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-black);
}
.card-price .per-night { font-size: 10px; color: var(--color-grey); font-weight: 400; }

/* ==================== BOTTOM SHEET (mobile filters) ==================== */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #FFFFFF;
  border-radius: 20px 20px 0 0;
  z-index: 41;
  padding: 12px 20px 24px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.sheet-title { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.sheet-field { margin-bottom: 14px; position: relative; z-index: 1; }
.sheet-field label { display: block; font-size: 12px; color: var(--color-grey); margin-bottom: 6px; }
.sheet-apply { width: 100%; justify-content: center; margin-top: 8px; }

/* ==================== CALENDAR MODAL (تقویم فارسی) ==================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 15, 15, 0.45);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.calendar-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(0.97);
  width: 340px;
  max-width: calc(100% - 32px);
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  z-index: 61;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.calendar-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.calendar-title { font-size: 15px; font-weight: 700; color: var(--color-black); }
.calendar-nav {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #F5F5F5;
  color: var(--color-black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.calendar-nav:hover:not(:disabled) { background: var(--color-orange); color: #FFFFFF; }
.calendar-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--color-grey);
  margin-bottom: 6px;
}
.calendar-weekdays span { padding: 4px 0; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-black);
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.calendar-day.is-empty { cursor: default; }
.calendar-day:not(.is-empty):not(.is-disabled):hover { background: #F5F5F5; }
.calendar-day.is-disabled { color: #D0D0D0; cursor: not-allowed; }
.calendar-day.is-today { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--color-orange); }
.calendar-day.is-in-range { background: #FEF1EC; border-radius: 0; }
.calendar-day.is-checkin,
.calendar-day.is-checkout {
  background: var(--color-orange);
  color: #FFFFFF;
  font-weight: 700;
}
.calendar-day.is-checkin { border-radius: 10px 0 0 10px; }
.calendar-day.is-checkout { border-radius: 0 10px 10px 0; }
.calendar-day.is-checkin.is-checkout { border-radius: 10px; }

.calendar-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.calendar-selection { font-size: 12px; color: var(--color-grey); margin-bottom: 10px; text-align: center; }
.calendar-actions { display: flex; gap: 8px; }
.calendar-clear {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  color: var(--color-black);
  font-size: 13px;
}
.calendar-clear:hover { border-color: var(--color-grey); }
.calendar-confirm {
  flex: 1.4;
  height: 42px;
  border-radius: 10px;
  background: var(--color-orange);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.calendar-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

/* =========================================================================
   MOBILE BREAKPOINT (< 768px) — طبق پیوست سند
   ========================================================================= */
@media (max-width: 768px) {

  .hero { height: 250px; }
  .hero-title { font-size: 20px; }
  .hero-subtitle { font-size: 13px; }

  /* ---- Floating search box: جمع‌وجور و زیر هم ---- */
  .search-box-wrap { margin-top: -40px; }
  .search-box {
    width: calc(100% - 32px);
    max-width: none;
    margin: 0 auto;
    padding: 16px;
  }

  .search-row--primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-bottom: none;
    padding-bottom: 12px;
  }
  .search-field { border-right: none !important; padding: 0; }
  .search-row--primary .search-field:last-child { display: none; } /* تعداد نفرات به ردیف دوم منتقل می‌شود */

  .search-row--secondary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
  }
  /* دراپ‌داون نوع اقامتگاه و امکانات رفاهی در موبایل داخل Bottom Sheet هستند */
  .search-row--secondary .search-field--dropdown { display: none; }
  .search-row--secondary .search-field:not(.search-field--dropdown) {
    display: block; /* فیلد "تعداد نفرات" */
  }
  .btn-icon-only {
    display: flex;
    width: 44px; height: 44px;
    grid-column: 2;
    grid-row: 1;
  }
  .btn-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }

  /* ---- Quick filter chips: کاروسل خودکار (بدون اسکرول دستی) ---- */
  /* chips-track توسط script.js یک‌بار تکرار می‌شود تا حلقه‌ی بی‌نهایت بدون پرش دیده شود */
  .chips-track {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: max-content;
    animation: chipsMarquee 22s linear infinite;
  }
  .chips-track.is-paused { animation-play-state: paused; }
  @keyframes chipsMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }

  /* ---- Listing grid: تک‌ستونه ---- */
  .listing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
  }

  .card:hover { transform: none; box-shadow: none; border-color: #0F0F0F0D; } /* هاور فقط دسکتاپ */

  .card-image-wrap { border-radius: var(--radius-md); }
  .card-title { font-size: 14px; }
  .card-specs, .card-tags { font-size: 12px; }

  .card-footer { align-items: flex-end; }
  .card-price .final-price { font-size: 15px; }

  /* دکمه/ناحیه لمسی حداقل 44px طبق سند */
  .card-fav { width: 44px; height: 44px; }
}
