/* متجر المنتجات — أسلوب hub360 (تصنيفات · شبكة · بطاقات) */

.shop-page {
  max-width: none !important;
  width: 100%;
  padding-inline: 0.75rem;
  margin: 0 auto 80px;
  background: #fff;
}

.shop-top {
  padding: 28px 0 8px;
  text-align: center;
}

.shop-top h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 900;
  color: #1a1f28;
}

.shop-top p {
  margin: 0 auto 18px;
  max-width: 620px;
  color: #667080;
  font-weight: 600;
  line-height: 1.7;
}

.shop-search {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d9dee8;
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  box-shadow: 0 8px 22px rgba(12, 14, 17, 0.05);
}

.shop-search i {
  color: #d70000;
}

.shop-search input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-weight: 700;
  min-width: 0;
  background: transparent;
}

.shop-search button {
  border: 0;
  background: #d70000;
  color: #fff;
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
}

/* شريط التصنيفات الأفقي — زي hub360 */
.shop-cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  width: 100%;
  padding: 18px 4px 14px;
  border-bottom: 1px solid #e8ebf1;
  margin-bottom: 18px;
}

.shop-cat-chip span:last-child {
  max-width: 108px;
  text-align: center;
  line-height: 1.35;
}

.shop-cat-chip {
  flex: 0 0 auto;
  min-width: 92px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #4a5260;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  position: relative;
  border-bottom: 3px solid transparent;
}

.shop-cat-chip .thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #f3f5f9;
  border: 1px solid #e4e8f0;
  display: grid;
  place-items: center;
  color: #d70000;
  font-size: 22px;
  overflow: hidden;
}

.shop-cat-chip.is-active {
  color: #d70000;
  border-bottom-color: #d70000;
}

.shop-cat-chip.is-active .thumb {
  background: rgba(215, 0, 0, 0.08);
  border-color: rgba(215, 0, 0, 0.25);
}

.shop-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.shop-sidebar {
  background: #fff;
  border: 1px solid #e8ebf1;
  border-radius: 14px;
  padding: 16px 14px;
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
}

.shop-side-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: #d70000;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.shop-side-back:hover {
  background: #b91c1c;
}

.shop-side-nav {
  display: grid;
  gap: 4px;
}

.shop-side-nav h2,
.shop-side-classify h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 900;
  color: #1a1f28;
}

.shop-side-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #4a5260;
}

.shop-side-nav a,
.shop-sectors-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  color: #303848;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.shop-side-nav a:hover,
.shop-sectors-list a:hover {
  background: #f7f8fb;
  color: #d70000;
}

.shop-side-nav a i,
.shop-sectors-list a i {
  width: 16px;
  color: #d70000;
  text-align: center;
}

.shop-sectors-list {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow: auto;
}

.shop-side-classify {
  border: 1px solid #d70000;
  border-radius: 12px;
  padding: 12px 10px;
}

.shop-sidebar h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 900;
  color: #1a1f28;
}

.shop-side-list {
  display: grid;
  gap: 2px;
  max-height: min(46vh, 360px);
  overflow: auto;
}

.shop-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #303848;
}

.shop-side-item:hover {
  background: #f7f8fb;
}

.shop-side-item input {
  accent-color: #d70000;
  width: 16px;
  height: 16px;
}

.shop-side-item span {
  flex: 1;
}

.shop-side-item small {
  color: #8a93a3;
  font-weight: 700;
}

.shop-content,
.shop-main-head,
#shop-result-label {
  scroll-margin-top: 88px;
}

.shop-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.shop-main-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #303848;
}

.shop-view-toggle {
  display: flex;
  gap: 4px;
}

.shop-view-toggle button {
  width: 36px;
  height: 36px;
  border: 1px solid #dde2ea;
  background: #fff;
  border-radius: 8px;
  color: #7a8494;
  cursor: pointer;
}

.shop-view-toggle button.is-active {
  color: #d70000;
  border-color: #d70000;
  background: rgba(215, 0, 0, 0.06);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.shop-grid.is-list {
  grid-template-columns: 1fr;
}

.shop-card {
  background: #fff;
  border: 1px solid #eceff5;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.shop-card:hover {
  box-shadow: 0 14px 32px rgba(12, 14, 17, 0.1);
  transform: translateY(-3px);
}

.shop-card-media {
  aspect-ratio: 1 / 1;
  background: #f4f6fa;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.shop-card-media.has-face {
  background: #111;
}

.shop-card-media .shop-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.shop-card-media .shop-logo {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.shop-card-media .media-icon {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e6eaf2;
  display: grid;
  place-items: center;
  color: #d70000;
  font-size: 32px;
  box-shadow: 0 10px 24px rgba(12, 14, 17, 0.08);
}

.shop-card-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 20%, rgba(215, 0, 0, 0.1), transparent 45%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.4), transparent 50%);
  pointer-events: none;
}

.shop-card-body {
  padding: 12px 12px 14px;
  display: grid;
  gap: 8px;
}

.shop-card-body h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  color: #1a1f28;
  min-height: 2.9em;
}

.shop-card-meta {
  font-size: 12px;
  font-weight: 700;
  color: #8a93a3;
}

.shop-card-price {
  font-size: 16px;
  font-weight: 900;
  color: #d70000;
  direction: ltr;
  unicode-bidi: isolate;
}

.shop-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.shop-card-actions a,
.shop-card-actions button {
  flex: 1;
  text-align: center;
  border: 1px solid #e2e6ef;
  background: #fff;
  color: #303848;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  border-radius: 8px;
  padding: 8px;
  text-decoration: none;
  cursor: pointer;
}

.shop-card-actions a.primary,
.shop-card-actions button.primary {
  background: #d70000;
  border-color: #d70000;
  color: #fff;
}

.shop-grid.is-list .shop-card {
  flex-direction: row;
  align-items: stretch;
}

.shop-grid.is-list .shop-card-media {
  width: 160px;
  flex: 0 0 160px;
  aspect-ratio: auto;
  min-height: 140px;
}

.shop-grid.is-list .shop-card-body {
  flex: 1;
  align-content: center;
}

.shop-grid.is-list .shop-card-body h3 {
  min-height: 0;
  font-size: 16px;
}

.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: #7a8494;
  font-weight: 800;
  background: #f7f8fb;
  border-radius: 12px;
}

@media (max-width: 1100px) {
  .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
  }

  .shop-side-list {
    max-height: 220px;
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shop-page {
    padding-inline: 0.75rem;
    margin-bottom: 64px;
  }

  .shop-top {
    padding: 18px 0 4px;
  }

  .shop-top h1 {
    font-size: clamp(22px, 7vw, 30px);
  }

  .shop-top p {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .shop-search {
    border-radius: 16px;
    padding: 6px 6px 6px 12px;
    gap: 6px;
  }

  .shop-search button {
    padding: 10px 14px;
    min-height: 44px;
  }

  .shop-cat-strip {
    padding: 12px 2px 10px;
    margin-bottom: 12px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .shop-cat-chip {
    min-width: 76px;
    font-size: 11px;
    padding: 6px 6px 10px;
  }

  .shop-cat-chip .thumb {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .shop-sidebar {
    padding: 12px;
  }

  .shop-side-list {
    max-height: 160px;
  }

  .shop-main-head h2 {
    font-size: 14px;
    line-height: 1.5;
  }

  .shop-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .shop-card-body h3 {
    min-height: 0;
    font-size: 15px;
  }

  .shop-card-actions a,
  .shop-card-actions button {
    min-height: 42px;
    font-size: 13px;
  }

  .shop-grid.is-list .shop-card {
    flex-direction: column;
  }

  .shop-grid.is-list .shop-card-media {
    width: 100%;
  }
}

/* —— إدارة التصنيفات —— */
.shop-side-classify-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

.shop-side-classify-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #1a1f28;
}

.shop-cat-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: #d70000;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 12px;
}

.shop-cat-add-btn:hover {
  background: #b91c1c;
}

.shop-side-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.shop-side-item-row.is-inactive .shop-side-item span {
  color: #94a3b8;
}

.shop-cat-menu {
  position: relative;
}

.shop-cat-menu-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.shop-cat-menu-btn:hover,
.shop-cat-menu-btn[aria-expanded='true'] {
  background: #f1f5f9;
  color: #0f172a;
}

.shop-cat-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 170px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.shop-cat-menu-panel button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.shop-cat-menu-panel button:hover {
  background: #f8fafc;
}

.shop-cat-menu-panel button.is-danger {
  color: #b91c1c;
}

.shop-filters-open {
  display: none;
}

.shop-sidebar-sheet-head {
  display: none;
}

.shop-filters-backdrop {
  display: none;
}

.shop-cat-modal[hidden] {
  display: none !important;
}

.shop-cat-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.shop-cat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.shop-cat-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.shop-cat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.shop-cat-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

.shop-cat-modal-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}

.shop-cat-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.shop-cat-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #1f2937;
}

.shop-cat-form label em {
  color: #d70000;
  font-style: normal;
}

.shop-cat-form input,
.shop-cat-form textarea,
.shop-cat-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  background: #fff;
}

.shop-cat-status {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.shop-cat-status legend {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #1f2937;
}

.shop-cat-status label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.shop-cat-form-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
}

.shop-cat-replace-msg {
  margin: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.shop-cat-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.shop-cat-btn-cancel,
.shop-cat-btn-save {
  min-height: 42px;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}

.shop-cat-btn-cancel {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #334155;
}

.shop-cat-btn-save {
  border: 0;
  background: #d70000;
  color: #fff;
}

@media (max-width: 900px) {
  .shop-filters-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fff;
    color: #b91c1c;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }

  .shop-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: min(360px, 92vw);
    max-width: 100%;
    z-index: 11000;
    transform: translateX(110%);
    transition: transform 0.25s ease;
    background: #fff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
    overflow: auto;
    padding: 16px;
  }

  body.shop-filters-open .shop-sidebar {
    transform: translateX(0);
  }

  .shop-sidebar-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }

  .shop-sidebar-sheet-head strong {
    font-size: 15px;
    font-weight: 900;
  }

  .shop-filters-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    cursor: pointer;
  }

  .shop-filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10900;
    background: rgba(15, 23, 42, 0.45);
  }

  .shop-filters-backdrop[hidden] {
    display: none !important;
  }

  .shop-side-list {
    max-height: min(42vh, 320px);
  }
}

