/* 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: 2600;
  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, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 4px;
}
.rb-datepicker__weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #8a8c8a;
  padding: 4px 0;
}
.rb-datepicker__weekdays .is-weekend {
  color: var(--rb-red);
}
.rb-datepicker__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.rb-datepicker__day {
  appearance: none;
  border: 0;
  background: transparent;
  aspect-ratio: 1;
  width: 100%;
  max-width: 42px;
  max-height: 42px;
  min-width: 0;
  min-height: 0;
  height: auto;
  justify-self: center;
  border-radius: 50%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-ink);
  cursor: pointer;
  padding: 0;
  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: 2400;
  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: 1279px) {
  .rb-datepicker-sheet-host {
    position: fixed;
    inset: 0;
    z-index: 2410;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    pointer-events: none;
  }
  .rb-datepicker.is-open {
    z-index: 2410;
  }
  .rb-datepicker-sheet-host .rb-datepicker__panel,
  .rb-datepicker__panel.is-sheet {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 360px !important;
    max-height: min(calc(100dvh - 24px), 480px);
    overflow: hidden;
    border-radius: 22px !important;
    padding: 12px 14px 14px !important;
    z-index: 2411 !important;
    pointer-events: auto !important;
    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.is-sheet::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #e5e7eb;
  }
  .rb-datepicker__head {
    margin-bottom: 8px;
  }
  .rb-datepicker__title {
    font-size: 16px;
  }
  .rb-datepicker__nav {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .rb-datepicker__weekdays span {
    font-size: 11px;
    padding: 2px 0;
  }
  .rb-datepicker__day {
    max-width: 40px;
    max-height: 40px;
    font-size: 13px;
  }
  .rb-datepicker__day,
  .rb-datepicker__today,
  .rb-datepicker__clear,
  .rb-datepicker__nav {
    touch-action: manipulation;
  }
  .rb-datepicker__footer {
    margin-top: 8px;
    padding-top: 8px;
  }
  .rb-datepicker__today,
  .rb-datepicker__clear {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }
}
@media (min-width: 768px) and (max-width: 1279px) {
  .rb-datepicker-sheet-host,
  .rb-datepicker-sheet-host.is-centered {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .rb-datepicker-sheet-host .rb-datepicker__panel,
  .rb-datepicker__panel.is-sheet.is-centered {
    animation: rb-dp-in .18s ease both;
    box-shadow:
      0 8px 24px rgba(26, 28, 30, 0.08),
      0 28px 64px rgba(26, 28, 30, 0.18) !important;
  }
  .rb-datepicker__panel.is-sheet.is-centered::before,
  .rb-datepicker-sheet-host.is-centered .rb-datepicker__panel::before {
    display: none;
  }
}
@media (max-width: 1279px) and (max-height: 560px) {
  .rb-datepicker-sheet-host .rb-datepicker__panel,
  .rb-datepicker__panel.is-sheet {
    padding: 8px 12px 10px !important;
    max-height: calc(100dvh - 16px);
  }
  .rb-datepicker__panel.is-sheet::before {
    margin-bottom: 6px;
  }
  .rb-datepicker__day {
    max-width: 32px;
    max-height: 32px;
    font-size: 12px;
  }
  .rb-datepicker__nav {
    width: 32px;
    height: 32px;
  }
}
@media (max-width: 360px) {
  .rb-datepicker-sheet-host {
    padding-left: 8px;
    padding-right: 8px;
  }
  .rb-datepicker__day {
    max-width: 36px;
    max-height: 36px;
  }
}
