.header {
  @apply bg-white py-3.5;
  box-shadow: 0 4px 27px -12px rgba(0, 0, 0, 0.25);

  .dropdown-menu {
    @apply rounded-b-2xl z-60;
    box-shadow: 0 8px 12px 0 rgba(0, 0, 0, 0.25);

    & > ul > li {
      @apply cursor-pointer;
    }

    & > ul > li > button {
      @apply w-full flex items-center justify-between font-medium;
    }
  }
}

/* ——— سبد خرید هدر (اسلیپ ایران) ——— */
:root {
  --si-primary: #1e293b;
  --si-accent: #3b82f6;
  --si-accent-hover: #2563eb;
  --si-danger: #ef4444;
  --si-gray-50: #f8fafc;
  --si-gray-100: #f1f5f9;
  --si-gray-200: #e2e8f0;
  --si-gray-300: #cbd5e1;
  --si-gray-400: #94a3b8;
  --si-gray-500: #64748b;
  --si-gray-600: #475569;
  --si-gray-800: #1e293b;
  --si-white: #ffffff;
  --si-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --si-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.sleepiran-cart-wrapper {
  position: relative;
  display: inline-block;
  direction: rtl;
}

.sleepiran-cart-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--si-white);
  border: 1px solid var(--si-gray-100);
  border-radius: 8px;
  padding: 5px 10px 5px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  outline: none;
}

.sleepiran-cart-toggle:hover {
  border-color: #dbeafe;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.sleepiran-cart-icon-box {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--si-gray-50);
  color: var(--si-gray-600);
  border-radius: 12px;
  transition: all 0.3s ease;
  z-index: 2;
}

.sleepiran-cart-toggle:hover .sleepiran-cart-icon-box {
  background-color: var(--si-accent);
  color: var(--si-white);
  transform: scale(1.05);
}

.sleepiran-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--si-danger);
  color: var(--si-white);
  font-size: 10px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--si-white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sleepiran-cart-badge::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--si-danger);
  opacity: 0.4;
  animation: si-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes si-ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

.sleepiran-cart-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  z-index: 2;
}

.sleepiran-cart-info-label {
  font-size: 11px;
  color: var(--si-gray-400);
  margin-bottom: 2px;
  transition: color 0.3s ease;
}

.sleepiran-cart-toggle:hover .sleepiran-cart-info-label {
  color: var(--si-accent);
}

.sleepiran-cart-price-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sleepiran-cart-total-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--si-primary);
}

.sleepiran-cart-currency {
  font-size: 10px;
  color: var(--si-gray-400);
  font-weight: 300;
}

.sleepiran-cart-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 16px;
  width: 380px;
  background-color: var(--si-white);
  border-radius: 20px;
  border: 1px solid var(--si-gray-100);
  box-shadow: var(--si-shadow-lg);
  overflow: hidden;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top left;
}

.sleepiran-cart-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.sleepiran-free-shipping-bar {
  padding: 16px;
  background: linear-gradient(to right, #eff6ff, #eef2ff);
  border-bottom: 1px solid #dbeafe;
}

.sleepiran-fs-text {
  font-size: 12px;
  text-align: center;
  color: #1e40af;
  margin: 0 0 8px 0;
}

.sleepiran-fs-text b {
  color: var(--si-accent);
  font-weight: 800;
}

.sleepiran-progress-bg {
  width: 100%;
  background-color: #bfdbfe;
  min-height: 22px;
  height: 22px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(30, 64, 175, 0.12);
}

.sleepiran-progress-fill {
  height: 100%;
  min-width: 0;
  background: linear-gradient(
    90deg,
    #38bdf8 0%,
    var(--si-accent, #209aff) 55%,
    #1d74e8 100%
  );
  border-radius: 10px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.sleepiran-fs-bar--disabled {
  display: none !important;
}

.sleepiran-product-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 350px;
  overflow-y: auto;
}

.sleepiran-product-list::-webkit-scrollbar {
  width: 5px;
}
.sleepiran-product-list::-webkit-scrollbar-track {
  background: var(--si-gray-50);
}
.sleepiran-product-list::-webkit-scrollbar-thumb {
  background: var(--si-gray-300);
  border-radius: 10px;
}

.sleepiran-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  position: relative;
  transition: background 0.3s ease;
  border-bottom: 1px solid var(--si-gray-50);
}

.sleepiran-cart-item:hover {
  background-color: var(--si-gray-50);
}

.sleepiran-item-img-link {
  flex-shrink: 0;
  width: 78px;
  height: 78px;
  border-radius: 12px;
  border: 1px solid var(--si-gray-100);
  overflow: hidden;
  display: block;
}

.sleepiran-item-img-link img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.sleepiran-cart-item:hover .sleepiran-item-img-link img {
  transform: scale(1.08);
}

.sleepiran-item-details {
  flex: 1;
  min-width: 0;
}

.sleepiran-item-title {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--si-gray-800);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 14px;
}

.sleepiran-item-title:hover {
  color: var(--si-accent);
}

.sleepiran-item-meta {
  font-size: 12px;
  color: var(--si-gray-500);
  margin: 0 0 8px 0;
}

.sleepiran-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sleepiran-qty-badge {
  background-color: var(--si-gray-100);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--si-gray-600);
}

.sleepiran-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--si-primary);
}

.sleepiran-remove-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--si-gray-300);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 4px;
}

.sleepiran-remove-btn:hover {
  color: var(--si-danger);
  transform: rotate(90deg);
}

.sleepiran-dropdown-footer {
  padding: 20px;
  background-color: var(--si-white);
  border-top: 1px solid var(--si-gray-100);
  box-shadow: 0 -5px 15px rgba(0,0,0,0.02);
}

.sleepiran-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sleepiran-payable-label {
  color: var(--si-gray-500);
  font-size: 14px;
}

.sleepiran-grand-total {
  font-size: 18px;
  font-weight: 900;
  color: var(--si-primary);
}

.sleepiran-grand-total span {
  font-size: 12px;
  font-weight: 400;
}

.sleepiran-btn-group {
  display: flex;
  gap: 12px;
}

.sleepiran-btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sleepiran-btn-outline {
  background: var(--si-white);
  border: 2px solid var(--si-primary);
  color: var(--si-primary);
}

.sleepiran-btn-outline:hover {
  background: var(--si-primary);
  color: var(--si-white);
}

.sleepiran-btn-primary {
  background: var(--si-accent);
  color: var(--si-white);
  border: none;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.sleepiran-btn-primary:hover {
  background: var(--si-accent-hover);
  transform: translateY(-1px);
}

.sleepiran-btn-primary svg {
  transition: transform 0.3s ease;
}

.sleepiran-btn-primary:hover svg {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .sleepiran-cart-info,
  .sleepiran-cart-toggle > svg:last-child {
    display: none;
  }
  .sleepiran-cart-dropdown {
    width: 320px;
    left: -10px;
  }
}

/* لودر پنل جستجوی موبایل */
@keyframes search-panel-spin {
  to { transform: rotate(360deg); }
}
.search-panel-spinner {
  animation: search-panel-spin 0.8s linear infinite;
}

.mobile-header-logo {
  max-width: 150px;
  width: auto;
  height: auto;
  display: block;
}

.mobile-menu-phone-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #dbeafe;
}

.mobile-menu-phone-block__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  color: #209aff;
  box-shadow: 0 4px 14px rgba(32, 154, 255, 0.15);
}

.mobile-menu-phone-block__body {
  flex: 1;
  min-width: 0;
}

.mobile-menu-phone-block__title {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
}

.mobile-menu-phone-block__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu-phone-block__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mobile-menu-phone-block__item:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 18px rgba(32, 154, 255, 0.12);
  transform: translateY(-1px);
}

.mobile-menu-phone-block__number {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  color: #0f172a;
  direction: ltr;
  text-align: left;
}

.mobile-menu-phone-block__cta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #209aff;
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 10px;
}

.mobile-menu-phone-block--preview .mobile-menu-phone-block__item {
  pointer-events: none;
}

/* Menu link typography */
.primary-menu-nav,
.primary-menu-nav ul,
.primary-menu-nav ul li a,
#bottom-nav > nav > ul > li > a,
#bottom-nav .dropdown-menu summary,
#bottom-nav .dropdown-menu nav a,
#mobileMenu nav a:not(.text-xl),
#menuLevel2Content a:not(.text-xl),
#menuLevel3Content a:not(.text-xl) {
  font-size: 13px;
}

/* Header search popover */
.sleepiran-header-search-popover {
  position: fixed;
  left: -300px !important;
  width: 344px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  z-index: 1000;
}
