/* DigiBlu — brand logo */
.digiblu-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.digiblu-logo:hover {
  opacity: 0.9;
}
.digiblu-logo__mark {
  position: relative;
  flex-shrink: 0;
  width: 2.875rem;
  height: 2.875rem;
  border-radius: 0.8rem;
  background: hsl(var(--primary));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  overflow: hidden;
}
.digiblu-logo__mark::before,
.digiblu-logo__mark::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.575rem;
  border-radius: 999px;
  background: #fff;
}
.digiblu-logo__mark::before {
  left: 0.55rem;
  opacity: 0.95;
}
.digiblu-logo__mark::after {
  right: 0.55rem;
  left: auto;
  opacity: 0.45;
}
.digiblu-logo__mark svg {
  display: none;
}
.digiblu-logo__word {
  font-family: IRANYekan, Tahoma, sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  user-select: none;
}
.digiblu-logo__digi {
  color: hsl(var(--text) / 0.92);
}
.digiblu-logo__blu {
  color: hsl(var(--primary));
}
.digiblu-logo--sm .digiblu-logo__mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
}
.digiblu-logo--sm .digiblu-logo__mark::before,
.digiblu-logo--sm .digiblu-logo__mark::after {
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
}
.digiblu-logo--sm .digiblu-logo__mark::before {
  left: 0.48rem;
}
.digiblu-logo--sm .digiblu-logo__mark::after {
  right: 0.48rem;
}
.digiblu-logo--sm .digiblu-logo__word {
  font-size: 1.25rem;
}

header .digiblu-logo {
  max-height: 3rem;
}
header img[src*="logo.svg"] {
  width: auto !important;
  height: 2.5rem !important;
  max-width: 11rem;
  object-fit: contain;
}

header .flex.gap-x-4 {
  flex-shrink: 0;
  align-items: center;
}
header [data-digiblu="login-btn"] {
  white-space: nowrap;
}

/* Allow dropdowns to escape the fixed header */
header,
header > .fixed {
  overflow: visible !important;
}

/*
 * CRITICAL: never set display:flex on these IDs unconditionally —
 * it overrides Tailwind .hidden and leaves menus always visible.
 */
#dropdownAccountDesktop.hidden,
#dropdownBasketDesktop.hidden {
  display: none !important;
}

#dropdownAccountDesktop:not(.hidden),
#dropdownBasketDesktop:not(.hidden) {
  display: flex !important;
  flex-direction: column;
}

#dropdownAccountDesktop,
#dropdownBasketDesktop {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  z-index: 80;
  overflow: hidden;
  border-radius: 0.75rem;
  background: hsl(var(--muted));
  box-shadow:
    0 12px 40px rgb(0 0 0 / 0.18),
    0 2px 10px rgb(0 0 0 / 0.08);
}

#dropdownAccountDesktop {
  width: 15rem;
}

#dropdownBasketDesktop {
  width: min(25rem, calc(100vw - 1.5rem));
}

#dropdownBasketDesktop [data-digiblu-cart-head] {
  padding: 1.25rem 1.25rem 0.75rem !important;
}

#dropdownAccountDesktop a,
#dropdownBasketDesktop a {
  text-decoration: none;
}

#dropdownBasketDesktop > [data-digiblu-cart-scroll] {
  flex: 1 1 auto;
  min-height: 0;
  /* ~3 cart rows visible; overflow scrolls on this box (not a clipped child) */
  max-height: 20rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0.5rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 132, 196, 0.4) transparent;
}

#dropdownBasketDesktop > [data-digiblu-cart-scroll]::-webkit-scrollbar {
  width: 6px;
}

#dropdownBasketDesktop > [data-digiblu-cart-scroll]::-webkit-scrollbar-thumb {
  background: rgba(43, 132, 196, 0.4);
  border-radius: 999px;
}

#dropdownBasketDesktop [data-digiblu="cart-list"] {
  max-height: none;
  overflow: visible;
  padding: 0.25rem 0.75rem;
}

#user-basket-drawer-navigation ul.main-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: 100%;
  padding: 0.5rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 132, 196, 0.4) transparent;
}

#user-basket-drawer-navigation ul.main-scroll::-webkit-scrollbar {
  width: 6px;
}

#user-basket-drawer-navigation ul.main-scroll::-webkit-scrollbar-thumb {
  background: rgba(43, 132, 196, 0.4);
  border-radius: 999px;
}

#dropdownBasketDesktop .digiblu-cart-item > .flex {
  align-items: flex-start;
  gap: 0.75rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

#dropdownBasketDesktop .digiblu-cart-item img,
#user-basket-drawer-navigation .digiblu-cart-item img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.5rem;
}

#dropdownBasketDesktop .digiblu-cart-price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
}

#dropdownBasketDesktop .border-t {
  flex-shrink: 0;
  gap: 0.75rem;
}

#dropdownBasketDesktop .border-t .btn-primary {
  white-space: nowrap;
  flex-shrink: 0;
}

#dropdownDefaultButton,
#dropdownBasketButton {
  outline: none !important;
  box-shadow: none !important;
}

/* ── Live slot loading (inline skeleton) ── */
@keyframes db-live-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes db-live-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/*
 * Host is a fixed-size spacer; shimmer paints on ::after so
 * siblings never merge and flex/line-clamp cannot collapse them.
 */
.db-live[data-loading='1'] {
  position: relative;
  box-sizing: border-box;
  display: block !important;
  flex: 0 0 auto !important;
  align-self: flex-start;
  width: 6.5rem;
  max-width: 100%;
  height: 1.15em;
  margin-block: 0.2em;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 0.35rem;
  color: transparent !important;
  font-size: inherit;
  line-height: 1;
  white-space: nowrap;
  text-indent: -9999px;
  user-select: none;
  pointer-events: none;
  background: transparent !important;
  box-shadow: none !important;
  /* kill Tailwind line-clamp / webkit-box while loading */
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
}

.db-live[data-loading='1']::before {
  content: none !important;
  display: none !important;
}

.db-live[data-loading='1']::after {
  content: '' !important;
  position: absolute;
  inset: 0;
  display: block !important;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      hsl(var(--text) / 0.07) 0%,
      hsl(var(--text) / 0.12) 35%,
      hsl(var(--primary) / 0.16) 50%,
      hsl(var(--text) / 0.12) 65%,
      hsl(var(--text) / 0.07) 100%
    );
  background-size: 220% 100%;
  animation: db-live-shimmer 1.15s ease-in-out infinite;
  pointer-events: none;
}

.db-live:not([data-loading='1']) {
  animation: db-live-fade-in 0.28s ease both;
}

/* Inline contexts (next to تومان / labels) */
span.db-live[data-loading='1'] {
  display: inline-block !important;
  vertical-align: middle;
  width: 4.75rem;
  height: 1em;
  margin-block: 0;
  margin-inline: 0.15rem;
}

/* Stacked name + phone: keep clear gap */
.db-live[data-loading='1'] + .db-live[data-loading='1'],
.db-live[data-loading='1'] + .db-live {
  margin-top: 0.45em;
}

/* Compact badge / count chips */
.db-live--badge[data-loading='1'],
.db-live--sm[data-loading='1'] {
  width: 1.25rem !important;
  min-width: 1.25rem !important;
  max-width: 1.25rem !important;
  height: 1.25rem !important;
  margin: 0 !important;
  border-radius: 999px;
}

.db-live--sm[data-loading='1'] {
  width: 1.5rem !important;
  min-width: 1.5rem !important;
  max-width: 1.5rem !important;
  height: 0.95em !important;
  border-radius: 0.3rem;
}

.db-live--on-dark[data-loading='1']::after {
  background:
    linear-gradient(
      90deg,
      rgb(255 255 255 / 0.16) 0%,
      rgb(255 255 255 / 0.32) 45%,
      rgb(255 255 255 / 0.5) 50%,
      rgb(255 255 255 / 0.32) 55%,
      rgb(255 255 255 / 0.16) 100%
    );
  background-size: 220% 100%;
}

/* Circular skeleton for home category rail */
.db-live.h-25.w-25[data-loading='1'] {
  width: 6.25rem !important;
  min-width: 6.25rem !important;
  max-width: 6.25rem !important;
  height: 6.25rem !important;
  margin-block: 0 !important;
  border-radius: 999px !important;
}

.category-slider .swiper-slide {
  height: auto;
}
html[data-route-pending='1'] main {
  opacity: 0.42;
  filter: saturate(0.92);
  transition:
    opacity 0.18s ease,
    filter 0.18s ease;
  pointer-events: none;
}

html:not([data-route-pending='1']) main {
  transition:
    opacity 0.28s ease,
    filter 0.28s ease;
}

/* DigiBlu toast */
.db-toast-host {
  position: fixed;
  z-index: 10050;
  inset-inline: 0;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  padding-inline: 1rem;
}

.db-toast {
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 1.1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.14);
  opacity: 0;
  transform: translateY(0.75rem);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.db-toast--show {
  opacity: 1;
  transform: translateY(0);
}

.db-toast--hide {
  opacity: 0;
  transform: translateY(0.5rem);
}

.db-toast--success {
  color: #fff;
  background: hsl(var(--primary));
}

.db-toast--error {
  color: #fff;
  background: #dc2626;
}

.db-toast--info {
  color: hsl(var(--text));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}

/* DigiBlu confirm modal */
.db-confirm-host {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.db-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.db-confirm-backdrop--show {
  opacity: 1;
}

.db-confirm-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  opacity: 0;
  transform: translateY(0.5rem) scale(0.98);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.db-confirm-dialog--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.db-confirm-panel {
  overflow: hidden;
  border-radius: 0.75rem;
  background: hsl(var(--muted));
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.18);
  border: 1px solid hsl(var(--border) / 0.6);
}

.db-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

@media (min-width: 640px) {
  .db-confirm-head {
    padding-inline: 1.5rem;
  }
}

.db-confirm-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--text));
}

@media (min-width: 768px) {
  .db-confirm-title {
    font-size: 1.125rem;
  }
}

.db-confirm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--text) / 0.7);
}

.db-confirm-close:hover {
  color: hsl(var(--text));
}

.db-confirm-body {
  padding: 1.25rem 1rem;
}

@media (min-width: 640px) {
  .db-confirm-body {
    padding: 1.5rem;
  }
}

.db-confirm-message {
  color: hsl(var(--text) / 0.9);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.db-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

