/* ==========================================================
   صفحه رزرو، تقویم شمسی و پرداخت
   ========================================================== */

/* ---------- چیدمان صفحه رزرو ---------- */
.reserve-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 26px;
  align-items: start;
}
.reserve-side { position: sticky; top: calc(var(--header-h) + 16px); }

/* ---------- خلاصه جستجو ---------- */
.search-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.summary-items { display: flex; gap: 26px; flex-wrap: wrap; }
.summary-item .lbl { font-size: .72rem; color: var(--ink-4); font-weight: 600; display: block; }
.summary-item .val { font-size: .95rem; font-weight: 700; color: var(--ink); }

/* ---------- کارت اتاق در صفحه رزرو ---------- */
.room-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 18px;
  transition: box-shadow .22s, border-color .2s;
}
.room-row:hover { box-shadow: var(--shadow); border-color: rgba(201, 162, 39, .45); }
.room-row.unavailable { opacity: .72; }

.room-row-head { display: grid; grid-template-columns: 250px 1fr; gap: 0; }
.room-row-media { position: relative; background: var(--line-2); min-height: 210px; }
.room-row-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.room-row-media .count-badge {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 10px;
  background: rgba(36, 27, 30, .84);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}
.room-row-info { padding: 20px 22px; }
.room-row-info h3 { margin-bottom: 8px; font-size: 1.2rem; }
.room-row-specs {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--ink-2);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.room-row-specs .spec { display: inline-flex; align-items: center; gap: 6px; }
.room-row-specs .spec .ico { color: var(--gold-dark); font-size: .95rem; }
.room-row-specs .spec b { font-weight: 700; }

.amenity-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.amenity-list .more { color: var(--burgundy); font-size: .78rem; font-weight: 600; cursor: pointer; align-self: center; }

/* ---------- ردیف پلن قیمت ---------- */
.plan-rows { border-top: 1px solid var(--line); }
.plan-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
  transition: background .18s;
}
.plan-row:last-child { border-bottom: none; }
.plan-row:hover { background: var(--burgundy-50); }

.plan-name { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.plan-name .ico { font-size: 1.05rem; }
.plan-desc { font-size: .77rem; color: var(--ink-3); font-weight: 400; margin-top: 2px; }

.plan-price { text-align: left; }
.plan-price .per-person {
  font-size: .74rem;
  color: var(--ink-4);
  display: block;
}
.plan-price .total { font-size: 1.24rem; font-weight: 800; color: var(--burgundy); line-height: 1.35; }
.plan-price .nights-note { font-size: .72rem; color: var(--ink-4); }
.plan-price .calc {
  font-size: .73rem;
  color: var(--gold-dark);
  background: var(--gold-50);
  border: 1px solid rgba(201, 162, 39, .28);
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-block;
  margin-top: 3px;
}

/* ---------- کادر خالی ---------- */
.empty-state { text-align: center; padding: 60px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty-state .ico { font-size: 2.6rem; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--ink-3); font-size: .9rem; max-width: 420px; margin-inline: auto; }

/* ==========================================================
   تقویم شمسی
   ========================================================== */
.jdp {
  position: absolute;
  z-index: 500;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 14px;
  width: 320px;
  display: none;
  top: calc(100% + 8px);
  inset-inline-start: 0;
}
.jdp.open { display: block; }
.jdp.jdp-double { width: 620px; }

.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.jdp-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: .85rem;
  transition: background .16s, border-color .16s;
  flex-shrink: 0;
}
.jdp-nav:hover { background: var(--burgundy-50); border-color: var(--burgundy); color: var(--burgundy); }
.jdp-nav:disabled { opacity: .35; cursor: not-allowed; }
.jdp-title { font-weight: 700; font-size: .95rem; text-align: center; flex: 1; }

.jdp-months { display: flex; gap: 18px; }
.jdp-month { flex: 1; }
.jdp-month-title { text-align: center; font-weight: 700; font-size: .88rem; margin-bottom: 8px; color: var(--ink-2); }

.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-wd {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink-4);
  padding: 4px 0 6px;
}
.jdp-wd.fri { color: var(--bad); }

.jdp-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: background .14s, color .14s;
  position: relative;
  padding: 0;
  line-height: 1.1;
}
.jdp-day:hover:not(:disabled) { background: var(--burgundy-50); }
.jdp-day.empty { visibility: hidden; }
.jdp-day.fri { color: var(--bad); }
.jdp-day.today { font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--gold); }
.jdp-day:disabled { color: var(--ink-4); cursor: not-allowed; opacity: .45; text-decoration: line-through; }
.jdp-day.closed { color: var(--ink-4); cursor: not-allowed; background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--line-2) 4px, var(--line-2) 8px); }

.jdp-day.selected { background: var(--burgundy); color: #fff; font-weight: 700; }
.jdp-day.selected:hover { background: var(--burgundy-dark); }
.jdp-day.in-range { background: var(--burgundy-100); border-radius: 0; }
.jdp-day.range-start { border-radius: 0 8px 8px 0; }
.jdp-day.range-end { border-radius: 8px 0 0 8px; }

.jdp-day .dprice {
  font-size: .55rem;
  color: var(--ok);
  font-weight: 600;
  margin-top: -1px;
}
.jdp-day.selected .dprice, .jdp-day.in-range .dprice { color: inherit; opacity: .85; }

.jdp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-2);
  font-size: .78rem;
  color: var(--ink-3);
}
.jdp-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.jdp-legend span { display: inline-flex; align-items: center; gap: 4px; }
.jdp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.jdp-legend i.sel { background: var(--burgundy); }
.jdp-legend i.cls { background: var(--line); }

/* ---------- فرم پرداخت / اطلاعات مهمان ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.form-card h3 { padding-bottom: 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-group label .req { color: var(--bad); }
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--ivory);
  font-size: .93rem;
  transition: border-color .18s, box-shadow .18s, background .18s;
  text-align: right;
}
.form-control:focus { outline: none; border-color: var(--burgundy); background: #fff; box-shadow: 0 0 0 3px rgba(122, 30, 46, .1); }
.form-control.error { border-color: var(--bad); background: var(--bad-bg); }
textarea.form-control { min-height: 90px; resize: vertical; line-height: 1.8; cursor: text; }
.form-error { color: var(--bad); font-size: .76rem; margin-top: 4px; font-weight: 500; }
.form-hint { color: var(--ink-4); font-size: .74rem; margin-top: 4px; }
.form-success { color: var(--ok); font-size: .76rem; margin-top: 4px; font-weight: 500; }

/* ---------- کارت خلاصه سفارش ---------- */
.summary-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.summary-card-head { background: linear-gradient(135deg, var(--burgundy), var(--burgundy-dark)); color: #fff; padding: 16px 20px; }
.summary-card-head h4 { color: #fff; margin: 0; font-size: 1rem; }
.summary-card-head .sub { font-size: .78rem; color: rgba(255, 255, 255, .78); }
.summary-card-body { padding: 18px 20px; }

.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; font-size: .88rem; }
.summary-row .lbl { color: var(--ink-3); }
.summary-row .val { font-weight: 600; text-align: left; }
.summary-row.total {
  border-top: 2px solid var(--line);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 1rem;
}
.summary-row.total .val { font-size: 1.3rem; font-weight: 800; color: var(--burgundy); }

.nights-table { font-size: .8rem; margin-top: 10px; }
.nights-table .nrow { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line-2); gap: 10px; }
.nights-table .nrow:last-child { border-bottom: none; }
.nights-table .nrow .d { color: var(--ink-3); }
.nights-table .nrow .p { font-weight: 600; white-space: nowrap; }
.nights-table .nrow.special .p { color: var(--gold-dark); }

.price-explain {
  background: var(--gold-50);
  border: 1px solid rgba(201, 162, 39, .3);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: .77rem;
  color: var(--gold-dark);
  line-height: 1.7;
  margin-top: 12px;
}
.price-explain b { color: var(--ink-2); }

/* ---------- مراحل ---------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 32px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; color: var(--ink-4); font-size: .86rem; font-weight: 600; }
.step .n {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--line-2);
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step.active { color: var(--burgundy); }
.step.active .n { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.step.done { color: var(--ok); }
.step.done .n { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.step-line { width: 52px; height: 2px; background: var(--line); margin: 0 12px; }
.step-line.done { background: var(--ok); }

/* ---------- نتیجه پرداخت ---------- */
.result-card { max-width: 620px; margin-inline: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 42px 34px; text-align: center; box-shadow: var(--shadow-lg); }
.result-icon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; margin: 0 auto 20px; }
.result-icon.ok { background: var(--ok-bg); color: var(--ok); }
.result-icon.bad { background: var(--bad-bg); color: var(--bad); }
.result-icon.warn { background: var(--warn-bg); color: var(--warn); }
.result-code {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: var(--cream);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 12px 20px;
  display: inline-block;
  margin: 14px 0;
  direction: ltr;
}

/* ---------- تست درگاه ---------- */
.test-gateway { max-width: 460px; margin: 40px auto; background: #fff; border: 2px dashed var(--warn); border-radius: var(--r-lg); padding: 30px; text-align: center; }
.test-gateway .tag { background: var(--warn-bg); color: var(--warn); font-size: .78rem; font-weight: 700; padding: 5px 14px; border-radius: 100px; display: inline-block; margin-bottom: 14px; }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 980px) {
  .reserve-layout { grid-template-columns: 1fr; }
  .reserve-side { position: static; }
  .jdp.jdp-double { width: 320px; }
  .jdp.jdp-double .jdp-month:nth-child(2) { display: none; }
}

@media (max-width: 760px) {
  .room-row-head { grid-template-columns: 1fr; }
  .room-row-media { min-height: 190px; }
  .plan-row { grid-template-columns: 1fr; gap: 10px; text-align: right; }
  .plan-price { text-align: right; }
  .plan-row .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .steps { gap: 0; }
  .step-line { width: 24px; margin: 0 6px; }
  .step .lbl { display: none; }
  .jdp { inset-inline-start: 50%; transform: translateX(50%); width: 300px; }
}
