/* ================================================================
   SunBurger — Jalali date picker (jdate.css)
   Elegant RTL Persian calendar popup + mobile bottom-sheet.
   Brand: Vazirmatn, cream surface, burgundy accents.
   ================================================================ */

.jdp-input {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  color: var(--text);
}
.jdp-input::placeholder { color: var(--text-secondary); opacity: .7; }

/* ---------- popup shell ---------- */
.jdp {
  position: fixed;
  z-index: 400;
  width: 292px;
  background: var(--surface, #fff9f4);
  border: 1.5px solid var(--border, #e6dcd5);
  border-radius: 16px;
  box-shadow: 0 18px 44px -14px rgba(33, 27, 24, .35);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
}
.jdp.open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* ---------- header ---------- */
.jdp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.jdp-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text, #211b18);
}
.jdp-nav {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1.5px solid var(--border, #e6dcd5);
  background: var(--surface, #fff);
  color: var(--text-secondary, #6f625b);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.jdp-nav:hover {
  background: var(--primary-tint, #f7e9e6);
  color: var(--primary, #8b0000);
  border-color: rgba(139, 0, 0, .3);
}

/* ---------- weekday header ---------- */
.jdp-wd {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.jdp-wd span {
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-secondary, #6f625b);
  padding: 4px 0;
}
.jdp-wd span:last-child { color: var(--danger, #B3261E); } /* جمعه */

/* ---------- day grid ---------- */
.jdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.jdp-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #211b18);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.jdp-day:hover { background: var(--primary-tint, #f7e9e6); color: var(--primary, #8b0000); }
.jdp-day:active { transform: scale(.92); }
.jdp-day.empty { pointer-events: none; }
.jdp-day.fri { color: var(--danger, #B3261E); }
.jdp-day.today {
  box-shadow: inset 0 0 0 1.5px var(--primary, #8b0000);
  color: var(--primary, #8b0000);
  font-weight: 900;
}
.jdp-day.sel {
  background: var(--primary, #8b0000);
  color: #fff !important;
  box-shadow: 0 4px 10px -4px rgba(139, 0, 0, .55);
}

/* ---------- footer ---------- */
.jdp-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #e6dcd5);
}
.jdp-foot button {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary, #8b0000);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
}
.jdp-foot button:hover { background: var(--primary-tint, #f7e9e6); }
.jdp-clear { color: var(--text-secondary, #6f625b) !important; }

/* ---------- mobile bottom-sheet ---------- */
@media (max-width: 560px) {
  .jdp.sheet {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    box-shadow: 0 -14px 40px -10px rgba(33, 27, 24, .4);
  }
  .jdp.sheet.open { transform: none; }
  .jdp.sheet::before {
    content: "";
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 44px; height: 4px;
    border-radius: 999px;
    background: var(--border, #e6dcd5);
  }
  .jdp.sheet .jdp-grid { gap: 3px; }
  .jdp.sheet .jdp-day { aspect-ratio: auto; height: 42px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .jdp { transition: none; }
}
