/* Zardasht - additions for the Blazor build.
   The original three stylesheets are untouched; this file only covers the pieces
   that used to be native <dialog> elements plus the Blazor error UI. */

.zd-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(33, 26, 39, .55);
  animation: zdFade .22s ease-out;
}

@keyframes zdFade { from { opacity: 0 } to { opacity: 1 } }

.zd-modal__box {
  position: relative;
  width: calc(100% - 1rem);
  max-width: 780px;
  max-height: calc(100% - 2rem);
  overflow: hidden;
  border-radius: var(--r-l);
  background: #fff;
  box-shadow: var(--shadow);
}

.zd-modal__box--wide { max-width: 860px; background: transparent; box-shadow: none }

.zd-fieldset { border: 0; padding: 0; margin: 0 }

.zd-spinner {
  display: grid;
  place-items: center;
  min-height: 40vh;
  color: var(--purple);
  font-weight: 700;
}

#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
  display: none;
  left: 0;
  padding: .6rem 1.25rem .7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: .75rem;
  top: .5rem;
}

/* ==========================================================================
   Shamsi date picker (Components/Shared/JalaliDatePicker.razor)
   Works on the storefront and inside the admin panel, so every colour falls
   back to a literal when the surrounding theme does not define the variable.
   ========================================================================== */

.zd-jdp { position: relative; display: inline-block; width: 100%; max-width: 210px; }

.zd-jdp__field {
  position: relative;
  display: flex;
  align-items: center;
  gap: .2rem;
}

.zd-jdp__inp {
  width: 100%;
  padding: .55rem 2.4rem .55rem .7rem;
  font: inherit;
  font-size: .86rem;
  color: inherit;
  background: #fff;
  border: 1px solid var(--adm-line, var(--line, #e6e1ee));
  border-radius: 10px;
  letter-spacing: .02em;
}

[dir="rtl"] .zd-jdp__inp { padding: .55rem .7rem .55rem 2.4rem; }

.zd-jdp__inp:focus {
  outline: none;
  border-color: var(--adm-purple, var(--purple, #6b3fa0));
  box-shadow: 0 0 0 3px rgba(107, 63, 160, .12);
}

.zd-jdp__icon {
  position: absolute;
  inset-inline-end: .35rem;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  color: var(--adm-purple, var(--purple, #6b3fa0));
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.zd-jdp__icon:hover { background: rgba(107, 63, 160, .1); }
.zd-jdp__icon--clear { inset-inline-end: 2.1rem; color: var(--adm-muted, var(--muted, #7b7387)); }

.zd-jdp__scrim { position: fixed; inset: 0; z-index: 60; }

.zd-jdp__pop {
  position: absolute;
  z-index: 61;
  inset-inline-start: 0;
  inset-block-start: calc(100% + .4rem);
  width: 268px;
  padding: .7rem;
  background: #fff;
  border: 1px solid var(--adm-line, var(--line, #e6e1ee));
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(33, 26, 39, .18);
}

.zd-jdp__head {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-block-end: .5rem;
}

.zd-jdp__nav {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  color: var(--adm-purple, var(--purple, #6b3fa0));
  background: transparent;
  border: 1px solid var(--adm-line, var(--line, #e6e1ee));
  border-radius: 8px;
  cursor: pointer;
}

.zd-jdp__nav:hover { background: rgba(107, 63, 160, .08); }

.zd-jdp__pop .ic--prev { transform: rotate(90deg); }
.zd-jdp__pop .ic--next { transform: rotate(-90deg); }

.zd-jdp__sel {
  flex: 1 1 auto;
  min-width: 0;
  padding: .35rem .4rem;
  font: inherit;
  font-size: .82rem;
  background: #fff;
  border: 1px solid var(--adm-line, var(--line, #e6e1ee));
  border-radius: 8px;
}

.zd-jdp__week,
.zd-jdp__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.zd-jdp__week span {
  padding: .25rem 0;
  font-size: .7rem;
  color: var(--adm-muted, var(--muted, #7b7387));
  text-align: center;
}

.zd-jdp__cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: .8rem;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.zd-jdp__cell:hover:not(:disabled) { background: rgba(107, 63, 160, .1); }
.zd-jdp__cell--void { cursor: default; }
.zd-jdp__cell:disabled { opacity: .32; cursor: not-allowed; }

.zd-jdp__cell.is-today {
  box-shadow: inset 0 0 0 1px var(--adm-gold, var(--gold, #c9a25c));
}

.zd-jdp__cell.is-on {
  color: #fff;
  background: var(--adm-purple, var(--purple, #6b3fa0));
}

.zd-jdp__time {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-block-start: .55rem;
  padding-block-start: .55rem;
  border-block-start: 1px solid var(--adm-line, var(--line, #e6e1ee));
}

.zd-jdp__foot {
  display: flex;
  gap: .35rem;
  margin-block-start: .55rem;
}

.zd-jdp__act {
  flex: 1 1 0;
  padding: .4rem .2rem;
  font: inherit;
  font-size: .76rem;
  color: var(--adm-purple, var(--purple, #6b3fa0));
  background: transparent;
  border: 1px solid var(--adm-line, var(--line, #e6e1ee));
  border-radius: 8px;
  cursor: pointer;
}

.zd-jdp__act:hover { background: rgba(107, 63, 160, .08); }

.zd-jdp__act--main {
  color: #fff;
  background: var(--adm-purple, var(--purple, #6b3fa0));
  border-color: transparent;
}

/* ==========================================================================
   Contact phone numbers (Components/Shared/ContactPhones.razor)
   ========================================================================== */

.zd-phones {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .7rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zd-phones__label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted, #7b7387);
}

.zd-phones__item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .55rem;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line, #e6e1ee);
  border-radius: 999px;
  transition: background .15s ease, border-color .15s ease;
}

.zd-phones__item:hover {
  border-color: var(--purple, #6b3fa0);
  background: rgba(107, 63, 160, .08);
}

.zd-phones--plain .zd-phones__item { padding: 0; border: 0; border-radius: 0; }
.zd-phones--plain .zd-phones__item:hover { background: transparent; text-decoration: underline; }
.zd-phones--sm .zd-phones__item { font-size: .8rem; }
.zd-phones--stack { flex-direction: column; align-items: flex-start; }

/* ==========================================================================
   Brochure language chips (one image per language)
   ========================================================================== */

.zd-blang {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-block-start: .5rem;
}

.zd-blang__chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  font-size: .78rem;
  color: var(--purple, #6b3fa0);
  text-decoration: none;
  background: rgba(107, 63, 160, .07);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.zd-blang__chip:hover { border-color: var(--purple, #6b3fa0); }
.zd-blang__chip.is-on { color: #fff; background: var(--purple, #6b3fa0); }
.zd-blang__chip:disabled { opacity: .45; cursor: not-allowed; }

/* ==========================================================================
   Brochure viewer: the brochure is an image, so the image is the interface
   ========================================================================== */

.zd-bview {
  background: #fff;
  box-shadow: var(--shadow);
  max-width: min(1180px, 96vw);
}

.zd-bview__in {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, .85fr);
  max-height: calc(100vh - 3rem);
}

.zd-bview__stage {
  display: grid;
  place-items: center;
  min-height: 46vh;
  max-height: calc(100vh - 3rem);
  padding: 1rem;
  overflow: auto;
  background: var(--purple-ink, #211a27);
  overscroll-behavior: contain;
}

.zd-bview__img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 5rem);
  object-fit: contain;
  cursor: zoom-in;
}

/* Zoomed: drop the fit constraint and let the stage scroll. */
.zd-bview__stage.is-zoom { place-items: start center; }

.zd-bview__stage.is-zoom .zd-bview__img {
  width: 190%;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.zd-bview__empty {
  margin: 0;
  padding: 2.4rem 1.2rem;
  color: rgba(255, 255, 255, .82);
  font-size: .9rem;
  text-align: center;
}

.zd-bview__side {
  padding: 1.5rem 1.6rem;
  overflow-y: auto;
  border-inline-start: 1px solid var(--line, #ece7f2);
}

.zd-bview__side h3 { margin: .35rem 0 .5rem; }
.zd-bview__side p { color: var(--muted); font-size: .88rem; }

.zd-bview__note {
  padding: .5rem .7rem;
  border: 1px solid rgba(107, 63, 160, .22);
  border-radius: 10px;
  background: rgba(107, 63, 160, .05);
  font-size: .8rem;
}

.zd-bview__acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1rem; }

@media (max-width: 860px) {
  .zd-bview__in { grid-template-columns: 1fr; overflow-y: auto; }
  .zd-bview__stage { min-height: 38vh; max-height: 56vh; }
  .zd-bview__img { max-height: 52vh; }
  .zd-bview__side { border-inline-start: 0; border-block-start: 1px solid var(--line, #ece7f2); }
}

/* ============ brochure card: language images, no cover ============
   A brochure is its language editions, so the card previews the selected edition instead of a
   separate cover shot. Pages must never be cropped, hence contain over cover. */

.bcard__stage {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 4 / 3;
  background: #f6f3fa;
  cursor: zoom-in;
  overflow: hidden;
}

.bcard__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}

.bcard:hover .bcard__img { transform: scale(1.03); }

.bcard__none {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

.bcard__stage:focus-visible .bcard__open { opacity: 1; transform: none; }

/* ============ video player ============
   object-fit: cover cropped the top and bottom off every clip. A player shows the whole
   frame; the letterbox is the point. */

.vmodal__player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #17101f;
}

.vmodal__none {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: 1.5rem;
  color: rgba(255, 255, 255, .82);
  text-align: center;
}

.vmodal__none p { margin: 0; font-size: .9rem; max-width: 32ch; }
