/* =========================================================
   Noor Shop - Shop Listing Page
   ========================================================= */
.ns-shop {
  padding: 48px 0 88px;
  background:
    radial-gradient(900px 260px at 0% 0%, rgba(136, 147, 70, 0.07), transparent 55%),
    #f7f9f8;
}

.ns-shop__layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.ns-shop__filters {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ns-shop__filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.ns-shop__filters-head h2 {
  margin: 0;
  color: var(--ns-ink);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.ns-shop__clear {
  color: var(--ns-green) !important;
  font-size: 13px;
  font-weight: 700;
}

.ns-shop__clear:hover {
  color: #1e360c !important;
}

.ns-shop__widget {
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(7, 28, 31, 0.06);
  box-shadow: 0 10px 28px rgba(7, 28, 31, 0.05);
}

.ns-shop__widget-title {
  margin: 0 0 14px;
  color: var(--ns-ink);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1rem;
  font-weight: 700;
}

/* Collapsible categories — mobile only */
.ns-shop__widget--cats summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  cursor: pointer;
  user-select: none;
}

.ns-shop__widget--cats summary::-webkit-details-marker {
  display: none;
}

.ns-shop__widget--cats:not([open]) summary {
  margin-bottom: 0;
}

.ns-shop__widget-chevron {
  flex-shrink: 0;
  color: var(--ns-muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.ns-shop__widget--cats[open] .ns-shop__widget-chevron {
  transform: rotate(180deg);
}

@media (min-width: 992px) {
  .ns-shop__widget--cats > .ns-shop__cats {
    display: block !important;
  }

  .ns-shop__widget--cats summary {
    pointer-events: none;
    cursor: default;
  }

  .ns-shop__widget--cats summary .ns-shop__widget-chevron {
    display: none;
  }
}

/* Top rated placement — desktop sidebar / mobile after products */
.ns-shop__top-mobile {
  display: none;
}

@media (min-width: 992px) {
  .ns-shop__top-mobile {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .ns-shop__top-desktop {
    display: none !important;
  }

  .ns-shop__top-mobile {
    display: block;
    margin-top: 24px;
  }
}

.ns-shop__search {
  position: relative;
  display: flex;
  align-items: center;
}

.ns-shop__search>i {
  position: absolute;
  inset-inline-start: 14px;
  color: var(--ns-muted);
  font-size: 13px;
  pointer-events: none;
}

.ns-shop__search input {
  width: 100%;
  height: 46px;
  margin: 0;
  border: 1px solid rgba(7, 28, 31, 0.1);
  border-radius: 12px;
  background: #f7f9f8;
  padding: 0 48px;
  font-size: 14px;
  color: var(--ns-ink);
  box-shadow: none;
}

.ns-shop__search input:focus {
  outline: none;
  border-color: rgba(42, 74, 17, 0.35);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(42, 74, 17, 0.08);
}

.ns-shop__search button {
  position: absolute;
  inset-inline-end: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #2a4a11 0%, #3d5f1c 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ns-shop__cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
}

.ns-shop__cats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ns-ink-soft) !important;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.ns-shop__cats a i {
  font-size: 11px;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ns-shop__cats a:hover,
.ns-shop__cats a.is-active {
  background: rgba(42, 74, 17, 0.08);
  color: var(--ns-green) !important;
}

.ns-shop__cats a.is-active i,
.ns-shop__cats a:hover i {
  opacity: 1;
}

.ns-shop__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ns-shop__price-row input {
  width: 100%;
  height: 44px;
  margin: 0;
  border: 1px solid rgba(7, 28, 31, 0.1);
  border-radius: 12px;
  background: #f7f9f8;
  padding: 0 12px;
  font-size: 14px;
  box-shadow: none;
}

.ns-shop__price-row input:focus {
  outline: none;
  border-color: rgba(42, 74, 17, 0.35);
  background: #fff;
}

.ns-shop__price-sep {
  color: var(--ns-muted);
  font-weight: 700;
}

.ns-shop__apply {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a4a11 0%, #3d5f1c 100%);
  color: #fff;
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.ns-shop__apply:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff;
}

.ns-shop__top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ns-shop__top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.ns-shop__top-item:hover {
  background: #f7f9f8;
}

.ns-shop__top-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  background: #f0f3f3;
}

.ns-shop__top-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ns-shop__top-name {
  color: var(--ns-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.ns-shop__top-price {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.ns-shop__top-price strong {
  color: var(--ns-green);
  font-weight: 700;
}

.ns-shop__top-price del {
  color: var(--ns-muted);
  font-size: 12px;
}

.ns-shop__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(7, 28, 31, 0.06);
  box-shadow: 0 8px 24px rgba(7, 28, 31, 0.04);
}

.ns-shop__showing {
  color: var(--ns-muted);
  font-size: 14px;
}

.ns-shop__showing strong {
  color: var(--ns-ink);
}

.ns-shop__sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ns-shop__sort label {
  margin: 0;
  color: var(--ns-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ns-shop__sort select {
  min-width: 210px;
  height: 42px;
  margin: 0;
  border: 1px solid rgba(7, 28, 31, 0.1);
  border-radius: 12px;
  background: #f7f9f8;
  padding: 0 36px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ns-ink);
  box-shadow: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7c7f' d='M1.4 0.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

html[lang="ar"] .ns-shop__sort select,
html[dir="rtl"] .ns-shop__sort select {
  background-position: left 14px center;
  padding: 0 14px 0 36px;
}

.ns-shop__sort select:focus {
  outline: none;
  border-color: rgba(42, 74, 17, 0.35);
  background-color: #fff;
}

.ns-shop__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ns-shop__card {
  min-width: 0;
}

.ns-shop__empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 64px 24px;
  border-radius: 20px;
  background: #fff;
  border: 1px dashed rgba(7, 28, 31, 0.12);
}

.ns-shop__empty-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(42, 74, 17, 0.1);
  color: var(--ns-green);
  font-size: 22px;
  margin-bottom: 8px;
}

.ns-shop__empty h3 {
  margin: 0;
  color: var(--ns-ink);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.ns-shop__empty p {
  margin: 0 0 12px;
  color: var(--ns-muted);
  max-width: 36ch;
}

.ns-shop__pagination {
  margin-top: 36px;
  display: flex;
  justify-content: center;
}

.ns-shop__pagination .pagination {
  gap: 6px;
}

.ns-shop__pagination .page-link {
  border-radius: 10px !important;
  border-color: rgba(7, 28, 31, 0.1);
  color: var(--ns-ink);
  min-width: 40px;
  text-align: center;
}

.ns-shop__pagination .page-item.active .page-link,
.ns-shop__pagination .page-link:hover {
  background: #2a4a11;
  border-color: #2a4a11;
  color: #fff;
}

/* Mobile filters drawer — hidden on desktop */
.ns-shop__filter-trigger,
.ns-shop__overlay,
.ns-shop__filters-close {
  display: none;
}

.ns-shop__overlay[hidden] {
  display: none !important;
}

.ns-shop__filters-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 1199px) {
  .ns-shop__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .ns-shop__layout {
    grid-template-columns: 1fr;
  }

  /* One-line trigger that opens the drawer */
  .ns-shop__filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid rgba(7, 28, 31, 0.08);
    border-radius: 14px;
    background: #fff;
    color: var(--ns-ink);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(7, 28, 31, 0.06);
    cursor: pointer;
  }

  .ns-shop__filter-trigger-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .ns-shop__filter-trigger-main i {
    color: var(--ns-green);
    font-size: 16px;
  }

  .ns-shop__filter-trigger-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(42, 74, 17, 0.1);
    color: var(--ns-green);
    font-size: 12px;
    font-weight: 700;
  }

  /* Backdrop */
  .ns-shop__overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(7, 28, 31, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .ns-shop__overlay.is-visible {
    opacity: 1;
  }

  /* Prevent the off-canvas drawer from creating horizontal scroll */
  html {
    overflow-x: hidden;
  }

  /* Sidebar becomes an off-canvas drawer (LTR: slides from the left) */
  .ns-shop__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 1100;
    width: min(88vw, 360px);
    height: 100dvh;
    max-height: 100vh;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    background: #f7f9f8;
    box-shadow: 0 24px 60px rgba(7, 28, 31, 0.28);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    visibility: hidden;
  }

  /* RTL / Arabic: slides from the right */
  html[dir="rtl"] .ns-shop__sidebar,
  html[lang="ar"] .ns-shop__sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }

  .ns-shop__sidebar.is-open {
    transform: translateX(0) !important;
    visibility: visible;
  }

  .ns-shop__filters {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .ns-shop__filters-head {
    position: sticky;
    top: -18px;
    z-index: 1;
    margin: -18px -16px 4px;
    padding: 16px;
    background: #f7f9f8;
    border-bottom: 1px solid rgba(7, 28, 31, 0.07);
  }

  .ns-shop__filters-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(7, 28, 31, 0.1);
    border-radius: 10px;
    background: #fff;
    color: var(--ns-ink);
    font-size: 15px;
    cursor: pointer;
  }

  .ns-shop__filters-close:hover {
    color: var(--ns-green);
    border-color: rgba(42, 74, 17, 0.3);
  }

  body.ns-shop-drawer-open {
    overflow: hidden;
  }
}

@media (max-width: 767px) {
  .ns-shop {
    padding: 32px 0 56px;
  }

  .ns-shop__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ns-shop__sort {
    width: 100%;
    justify-content: space-between;
  }

  .ns-shop__sort select {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 420px) {
  .ns-shop__grid {
    grid-template-columns: 1fr;
  }
}
