/* Jalali datepicker — RedBilit */
.rb-datepicker {
  position: relative;
  overflow: visible !important;
  min-width: 190px;
}
.rb-datepicker__trigger {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  min-height: 26px;
}
.rb-datepicker__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--rb-ink);
  text-align: right;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-datepicker__value.is-placeholder {
  color: #9a9c9a;
  font-weight: 500;
}
.rb-datepicker__icon {
  color: var(--rb-teal);
  flex-shrink: 0;
}
.rb-datepicker.is-open {
  background: transparent;
}
.rb-datepicker__panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 80;
  width: 320px;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(225, 29, 46, 0.12);
  border-radius: 18px;
  box-shadow:
    0 8px 20px rgba(26, 28, 30, 0.06),
    0 24px 48px rgba(26, 28, 30, 0.14);
  animation: rb-dp-in .18s ease both;
}
@media (max-width: 991px) {
  .rb-datepicker {
    min-width: 0 !important;
    width: 100%;
  }
}
.rb-datepicker__panel[hidden] {
  display: none !important;
}
@keyframes rb-dp-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rb-dp-sheet-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.rb-datepicker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.rb-datepicker__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--rb-ink);
}
.rb-datepicker__nav {
  appearance: none;
  border: 1px solid #ececee;
  background: #fafafb;
  color: var(--rb-ink);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.rb-datepicker__nav:hover {
  background: var(--rb-red);
  border-color: var(--rb-red);
  color: #fff;
}
.rb-datepicker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.rb-datepicker__weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #8a8c8a;
  padding: 6px 0;
}
.rb-datepicker__weekdays .is-weekend {
  color: var(--rb-red);
}
.rb-datepicker__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.rb-datepicker__day {
  appearance: none;
  border: 0;
  background: transparent;
  aspect-ratio: 1;
  min-height: 38px;
  border-radius: 50%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-ink);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.rb-datepicker__day:hover:not(:disabled):not(.is-selected) {
  background: rgba(225, 29, 46, 0.08);
  color: var(--rb-red);
}
.rb-datepicker__day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1.5px var(--rb-red);
  color: var(--rb-red);
}
.rb-datepicker__day.is-selected {
  background: linear-gradient(135deg, #E11D2E 0%, #C41524 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(225, 29, 46, 0.3);
}
.rb-datepicker__day.is-weekend:not(.is-selected):not(.is-muted) {
  color: var(--rb-red);
}
.rb-datepicker__day.is-muted {
  color: #c5c7c5;
}
.rb-datepicker__day:disabled {
  color: #d0d2d0;
  cursor: not-allowed;
  opacity: 0.55;
}
.rb-datepicker__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f2;
}
.rb-datepicker__today,
.rb-datepicker__clear {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.rb-datepicker__today {
  color: var(--rb-red);
  background: rgba(225, 29, 46, 0.08);
}
.rb-datepicker__today:hover {
  background: rgba(225, 29, 46, 0.14);
}
.rb-datepicker__clear {
  color: #6b6e6a;
}
.rb-datepicker__clear:hover {
  background: #f5f5f6;
  color: var(--rb-ink);
}

.rb-datepicker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(18, 20, 22, 0.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: rb-dp-in .18s ease both;
}
.rb-datepicker-backdrop[hidden] {
  display: none !important;
}
body.rb-datepicker-lock {
  overflow: hidden;
}

/* Tours search field variant */
.rb-tours-search .rb-datepicker {
  min-width: 0;
  width: 100%;
}
.rb-tours-search .rb-datepicker__trigger {
  min-height: 42px;
  padding: 0 4px;
  border-radius: 12px;
}
.rb-tours-search .rb-datepicker__value {
  font-size: 13.5px;
}
.rb-tours-search .rb-datepicker__panel {
  right: 0;
  left: auto;
}

@media (max-width: 767px) {
  .rb-datepicker.is-open {
    z-index: 200;
  }
  .rb-datepicker__panel {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(78vh, 560px);
    overflow: auto;
    border-radius: 24px !important;
    padding: 18px 16px 20px !important;
    z-index: 200;
    box-shadow:
      0 -4px 24px rgba(26, 28, 30, 0.12),
      0 24px 60px rgba(26, 28, 30, 0.22) !important;
    animation: rb-dp-sheet-in .24s cubic-bezier(.2,.8,.2,1) both;
  }
  .rb-datepicker__panel::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #e5e7eb;
  }
  .rb-datepicker__title {
    font-size: 17px;
  }
  .rb-datepicker__nav {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .rb-datepicker__day {
    min-height: 44px;
    font-size: 14px;
  }
  .rb-datepicker__today,
  .rb-datepicker__clear {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 14px;
  }
}
