/* Solar Hijri date picker: the storefront's jalali.js and the back-office's JalaliDateInput share this markup. */
.jdp-wrap {
    --jdp-accent: var(--sb-brand, var(--bs-primary, #208d44));
    --jdp-bg: var(--bs-paper-bg, var(--bs-body-bg, #fff));
    --jdp-text: var(--bs-body-color, #2f2b3d);
    --jdp-muted: var(--bs-secondary-color, #8a8d93);
    --jdp-line: var(--bs-border-color, #e6e6e8);
    position: relative;
    display: block;
    min-width: 0;
}
.jdp-wrap.jdp-inline { display: inline-block; vertical-align: middle; }
.jdp-wrap > .jdp-input { padding-inline-end: 2.4rem; width: 100%; text-align: right; }
.jdp-wrap > .jdp-input::placeholder { text-align: right; }
.jdp-toggle {
    position: absolute;
    inset-inline-end: .35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 0;
    border-radius: .375rem;
    background: transparent;
    color: var(--jdp-muted);
    cursor: pointer;
    line-height: 1;
}
.jdp-toggle:hover, .jdp-toggle:focus-visible { color: var(--jdp-accent); background: color-mix(in srgb, var(--jdp-accent) 10%, transparent); outline: none; }
.jdp-toggle:disabled { opacity: .45; cursor: default; }
.jdp-toggle .ti { font-size: 1.15rem; }

.jdp {
    position: absolute;
    z-index: 1090;
    top: calc(100% + .35rem);
    inset-inline-start: 0;
    width: 18.5rem;
    max-width: calc(100vw - 1.5rem);
    padding: .75rem;
    border: 1px solid var(--jdp-line);
    border-radius: .75rem;
    background: var(--jdp-bg);
    color: var(--jdp-text);
    box-shadow: 0 .5rem 1.75rem rgba(47, 43, 61, .18);
    direction: rtl;
    font-size: .875rem;
    text-align: center;
    animation: jdp-in .14s ease-out;
}
.jdp.jdp-up { top: auto; bottom: calc(100% + .35rem); }
@keyframes jdp-in { from { opacity: 0; transform: translateY(-4px); } }
.jdp-head { display: flex; align-items: center; gap: .35rem; margin-bottom: .5rem; }
.jdp-head select {
    flex: 1 1 auto;
    min-width: 0;
    height: 2rem;
    padding: 0 .4rem;
    border: 1px solid var(--jdp-line);
    border-radius: .5rem;
    background: var(--jdp-bg);
    color: inherit;
    font: inherit;
}
.jdp-head .jdp-year { flex: 0 0 5.2rem; }
.jdp-nav {
    flex: 0 0 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
}
.jdp-nav:hover { background: color-mix(in srgb, var(--jdp-accent) 10%, transparent); color: var(--jdp-accent); }
.jdp-week, .jdp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-week span { padding: .25rem 0; color: var(--jdp-muted); font-size: .78rem; font-weight: 600; }
.jdp-week span:last-child { color: #d9534f; }
.jdp-day {
    aspect-ratio: 1;
    min-height: 2.1rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.jdp-day:hover:not(:disabled), .jdp-day:focus-visible { background: color-mix(in srgb, var(--jdp-accent) 12%, transparent); outline: none; }
.jdp-day.is-holiday { color: #d9534f; }
.jdp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--jdp-accent); font-weight: 700; }
.jdp-day.is-selected, .jdp-day.is-selected:hover { background: var(--jdp-accent); color: #fff; font-weight: 700; }
.jdp-day:disabled { opacity: .3; cursor: not-allowed; }
.jdp-time { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--jdp-line); }
.jdp-time input { width: 6.5rem; height: 2rem; padding: 0 .4rem; border: 1px solid var(--jdp-line); border-radius: .5rem; background: var(--jdp-bg); color: inherit; font: inherit; text-align: center; }
.jdp-foot { display: flex; justify-content: space-between; gap: .25rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--jdp-line); }
.jdp-link { border: 0; border-radius: .4rem; padding: .25rem .6rem; background: transparent; color: var(--jdp-accent); font: inherit; font-weight: 600; cursor: pointer; }
.jdp-link:hover { background: color-mix(in srgb, var(--jdp-accent) 10%, transparent); }
.jdp-link.jdp-primary { background: var(--jdp-accent); color: #fff; }
.jdp-backdrop { position: fixed; inset: 0; z-index: 1089; background: transparent; }

/* Phones: a bottom sheet with big touch targets instead of a popover that may fall off screen. */
@media (max-width: 575.98px) {
    .jdp, .jdp.jdp-up {
        position: fixed;
        top: auto;
        bottom: 0;
        inset-inline: 0;
        width: auto;
        max-width: none;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
        border-radius: 1rem 1rem 0 0;
        animation: jdp-sheet .18s ease-out;
    }
    .jdp-day { min-height: 2.6rem; font-size: 1rem; }
    .jdp-backdrop { background: rgba(0, 0, 0, .35); }
}
@keyframes jdp-sheet { from { transform: translateY(100%); } }

[data-bs-theme="dark"] .jdp, .dark-style .jdp { box-shadow: 0 .5rem 1.75rem rgba(0, 0, 0, .5); }
