/* =========== sbc-mega.css =========== */
.nav__item--sbc {
  position: relative;
}

.nav__link--sbc {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 16px;
  color: #fff !important;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(111, 194, 130, 0.18);
  border: none;
  font-family: "Cairo", sans-serif;
  transition: background 0.2s;
  position: relative;
}

.nav__link--sbc:hover,
.nav__link--sbc.active {
  background: rgba(111, 194, 130, 0.32) !important;
}

.nav__link--sbc i:first-child {
  font-size: 0.8rem;
}

.sbc-trigger-arrow {
  font-size: 0.62rem !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sbc-trigger-arrow--open {
  transform: rotate(180deg);
}

.sbc-mega {
  position: fixed;
  inset: 0;
  z-index: 1995;
  pointer-events: none;
  visibility: hidden;
}

.sbc-mega--open {
  pointer-events: all;
  visibility: visible;
}

.sbc-mega__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 14, 40, 0.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sbc-mega--open .sbc-mega__overlay {
  opacity: 1;
}

.sbc-mega__container {
  position: absolute;
  top: calc(var(--topbar-h) + var(--header-h) + var(--nav-h));
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 12px 48px rgba(0, 14, 40, 0.22);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - var(--header-h) - var(--nav-h));
  transform: translateY(-12px);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  border-top: 3px solid var(--secondary);
}

.sbc-mega--open .sbc-mega__container {
  transform: translateY(0);
  opacity: 1;
}

.sbc-mega__body {
  display: grid;
  grid-template-columns: 230px 260px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.sbc-mega__col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border);
}

.sbc-mega__col:last-child {
  border-left: none;
}

.sbc-mega__col-label {
  padding: 10px 16px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
}

.sbc-mega__col--cats {
  background: var(--primary-dark);
}

.sbc-mega__col--cats .sbc-mega__col-label {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sbc-mega__cats-scroll {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sbc-mega__cats-scroll::-webkit-scrollbar {
  width: 4px;
}

.sbc-mega__cats-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

.sbc-mega__cat-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  text-align: right;
  border-right: 3px solid transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.15s ease;
}

.sbc-mega__cat-item:last-child {
  border-bottom: none;
}

.sbc-mega__cat-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sbc-mega__cat-item--active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.11) !important;
  border-right-color: var(--secondary) !important;
}

.sbc-mega__cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all 0.15s;
}

.sbc-mega__cat-item:hover .sbc-mega__cat-icon,
.sbc-mega__cat-item--active .sbc-mega__cat-icon {
  background: var(--secondary);
  color: #fff;
}

.sbc-mega__cat-label {
  flex: 1;
  line-height: 1.25;
}

.sbc-mega__cat-arrow {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  transition: color 0.15s;
}

.sbc-mega__cat-item:hover .sbc-mega__cat-arrow,
.sbc-mega__cat-item--active .sbc-mega__cat-arrow {
  color: var(--secondary);
}

.sbc-mega__col--subs {
  background: #f7f9fc;
}

.sbc-mega__subs-inner {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 6px 0;
}

.sbc-mega__subs-inner::-webkit-scrollbar {
  width: 4px;
}

.sbc-mega__subs-inner::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sbc-mega__hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 0.8rem;
  padding: 40px 20px;
  text-align: center;
  height: 100%;
  min-height: 120px;
}

.sbc-mega__hint i {
  font-size: 1.5rem;
  opacity: 0.35;
}

.sbc-mega__sub-all {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 0.83rem;
  font-weight: 800;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  text-align: right;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
  transition: all 0.14s;
}

.sbc-mega__sub-all:hover {
  background: rgba(0, 60, 119, 0.05);
}

.sbc-mega__sub-all i {
  color: var(--secondary);
  font-size: 0.75rem;
}

.sbc-mega__sub-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  text-align: right;
  border-right: 2.5px solid transparent;
  transition: all 0.14s;
}

.sbc-mega__sub-item:hover {
  color: var(--primary);
  background: rgba(0, 60, 119, 0.04);
  border-right-color: var(--secondary);
  padding-right: 20px;
}

.sbc-mega__sub-item--active {
  color: var(--primary) !important;
  background: rgba(0, 60, 119, 0.07) !important;
  border-right-color: var(--primary) !important;
}

.sbc-mega__sub-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(0, 60, 119, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: all 0.14s;
}

.sbc-mega__sub-item:hover .sbc-mega__sub-icon,
.sbc-mega__sub-item--active .sbc-mega__sub-icon {
  background: var(--secondary);
  color: #fff;
}

.sbc-mega__sub-count {
  font-size: 0.68rem;
  color: var(--text-light);
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: auto;
}

.sbc-mega__sub-arrow {
  font-size: 0.58rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.sbc-mega__col--preview {
  background: #fff;
}

.sbc-mega__preview-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sbc-mega__preview-inner::-webkit-scrollbar {
  width: 4px;
}

.sbc-mega__preview-inner::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sbc-mega__prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px;
  align-content: start;
}

.sbc-mega__prod-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.sbc-mega__prod-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(0, 60, 119, 0.13);
  transform: translateY(-3px);
}

.sbc-mega__prod-img-wrap {
  aspect-ratio: 1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.sbc-mega__prod-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.sbc-mega__prod-card:hover .sbc-mega__prod-img {
  transform: scale(1.06);
}

.sbc-mega__prod-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #e53935;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.sbc-mega__prod-stock {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.56rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid #b9e4c0;
}

.sbc-mega__prod-info {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sbc-mega__prod-brand {
  font-size: 0.6rem;
  color: var(--text-light);
  font-weight: 700;
  text-transform: uppercase;
}

.sbc-mega__prod-name {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sbc-mega__prod-price {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-top: auto;
}

.sbc-mega__preview-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafbfd;
}

.sbc-mega__preview-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sbc-mega__preview-count strong {
  color: var(--primary);
}

.sbc-mega__preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.sbc-mega__preview-link:hover {
  background: var(--secondary);
  color: #fff;
  transform: translateX(-3px);
}

@keyframes megaFadeSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sbc-mega__sub-item {
  animation: megaFadeSlide 0.16s ease both;
}

.sbc-mega__prod-card {
  animation: megaFadeSlide 0.2s ease both;
}

.sbc-mega__sub-item:nth-child(1) {
  animation-delay: 0.02s;
}

.sbc-mega__sub-item:nth-child(2) {
  animation-delay: 0.05s;
}

.sbc-mega__sub-item:nth-child(3) {
  animation-delay: 0.08s;
}

.sbc-mega__sub-item:nth-child(4) {
  animation-delay: 0.11s;
}

.sbc-mega__sub-item:nth-child(5) {
  animation-delay: 0.14s;
}

.sbc-mega__sub-item:nth-child(6) {
  animation-delay: 0.17s;
}

.sbc-mega__sub-item:nth-child(7) {
  animation-delay: 0.2s;
}

.sbc-mega__prod-card:nth-child(1) {
  animation-delay: 0.04s;
}

.sbc-mega__prod-card:nth-child(2) {
  animation-delay: 0.08s;
}

.sbc-mega__prod-card:nth-child(3) {
  animation-delay: 0.12s;
}

.sbc-mega__prod-card:nth-child(4) {
  animation-delay: 0.16s;
}

.sbc-mega__prod-card:nth-child(5) {
  animation-delay: 0.2s;
}

.sbc-mega__prod-card:nth-child(6) {
  animation-delay: 0.24s;
}

.sbc-mega__prod-card:nth-child(7) {
  animation-delay: 0.28s;
}

.sbc-mega__prod-card:nth-child(8) {
  animation-delay: 0.32s;
}

/* Mega Menu - تجاوبي */
@media (min-width: 901px) and (max-width: 1100px) {
  .sbc-mega__body {
    grid-template-columns: 210px 230px 1fr;
  }

  .sbc-mega__prod-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  .sbc-mega__body {
    grid-template-columns: 190px 1fr;
  }

  .sbc-mega__col--preview {
    display: none;
  }
}

@media (max-width: 767px) {
  .sbc-mega__container {
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
  }

  .sbc-mega__body {
    grid-template-columns: 1fr;
  }

  .sbc-mega__col--subs,
  .sbc-mega__col--preview {
    display: none;
  }

  .nav__item--sbc {
    display: none;
  }
}