/*
  Anayek Product Listing
  Part 8: product listing page only.
*/

.product-list-hero {
  position: relative;
}

.product-list-hero::before {
  content: "";
  position: absolute;
  inset-block-start: -160px;
  inset-inline-end: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow), transparent 68%);
  pointer-events: none;
}

.product-breadcrumb {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-8);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.product-breadcrumb a {
  color: var(--text-muted);
}

.product-breadcrumb a:hover {
  color: var(--primary);
}

.product-list-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  gap: var(--space-8);
}

.product-list-hero__content {
  display: grid;
  gap: var(--space-3);
}

.product-list-kicker {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 950;
}

.product-list-hero__content h1 {
  margin: 0;
}

.product-list-hero__content p {
  max-width: 720px;
  margin: 0;
}

.product-list-hero__summary {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  padding: var(--space-5);
  text-align: center;
}

.product-list-hero__summary span {
  color: var(--text-muted);
  font-weight: 800;
}

.product-list-hero__summary strong {
  color: var(--text-strong);
  font-family: var(--font-latin);
  font-size: 2.5rem;
  font-weight: 950;
  line-height: 1;
}

.product-listing__category-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-block-end: var(--space-5);
  margin-block-end: var(--space-5);
  border-bottom: 1px solid var(--border-soft);
  overflow-x: auto;
  scrollbar-width: thin;
}

.product-listing__category-row .chip {
  flex: 0 0 auto;
}

.product-listing__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-end: var(--space-6);
}

.product-listing__count {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--text-muted);
  font-weight: 800;
}

.product-listing__count strong {
  color: var(--text-strong);
  font-family: var(--font-latin);
  font-size: 1.2rem;
  font-weight: 950;
}

.product-sort-form {
  width: min(240px, 100%);
}

.product-sort-form .form-select {
  min-height: 42px;
  border-radius: var(--radius-pill);
}

.product-listing__layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-6);
}

.product-filter-sidebar {
  position: sticky;
  inset-block-start: calc(var(--header-height) + var(--space-5));
}

.product-filter-card {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.product-filter-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.product-filter-card__header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.product-listing__content {
  min-width: 0;
}

.product-listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.product-listing__empty {
  min-height: 420px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-block-start: var(--space-8);
}

.pagination__item {
  min-width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding-inline: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-latin);
  font-weight: 900;
}

.pagination__item:hover {
  border-color: var(--border-strong);
  color: var(--primary);
}

.pagination__item.is-active {
  border-color: transparent;
  background: var(--primary);
  color: var(--text-inverse);
}

html[data-theme="dark"] .pagination__item.is-active,
[data-theme="dark"] .pagination__item.is-active {
  color: #06172d;
}

.pagination__item.is-disabled {
  opacity: 0.52;
  pointer-events: none;
}

.product-filter-drawer .drawer__body {
  padding-block-end: calc(var(--mobile-bottom-nav-height) + var(--space-6));
}

@media (max-width: 1100px) {
  .product-listing__layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-4);
  }

  .product-listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .product-list-hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .product-list-hero__summary {
    justify-items: start;
    text-align: start;
  }

  .product-listing__toolbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .product-listing__count {
    justify-content: end;
  }

  .product-sort-form {
    grid-column: 1 / -1;
    width: 100%;
  }

  .product-listing__layout {
    display: block;
  }

  .product-listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination__item {
    min-width: 38px;
    height: 38px;
  }
}

@media (max-width: 420px) {
  .product-listing-grid {
    gap: var(--space-2);
  }

  .product-breadcrumb {
    margin-block-end: var(--space-5);
  }
}

/* ANAYEK FIX START: force-product-listing-flex-layout */

/* =========================================================
   Product listing final layout: flex rows, not masonry/grid
   ========================================================= */

.product-listing-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: var(--space-5) !important;
  direction: rtl !important;
  width: 100% !important;
  max-width: 100% !important;
}

.product-listing-grid > .product-card,
.product-listing-grid > .product-card--component,
.product-listing-grid > article[data-product-card] {
  flex: 0 0 calc((100% - (var(--space-5) * 2)) / 3) !important;
  width: calc((100% - (var(--space-5) * 2)) / 3) !important;
  max-width: calc((100% - (var(--space-5) * 2)) / 3) !important;
  min-width: 0 !important;
  height: auto !important;
  align-self: flex-start !important;
  margin: 0 !important;
  transform: none !important;
}

.product-listing-grid > .product-card:hover,
.product-listing-grid > .product-card--component:hover,
.product-listing-grid > article[data-product-card]:hover {
  transform: translateY(-5px) !important;
}

.product-listing-grid .product-card__media {
  width: 100% !important;
  display: block !important;
}

.product-listing-grid .product-card__img,
.product-listing-grid .product-card__placeholder {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
}

@media (max-width: 1180px) {
  .product-listing-grid {
    gap: var(--space-4) !important;
  }

  .product-listing-grid > .product-card,
  .product-listing-grid > .product-card--component,
  .product-listing-grid > article[data-product-card] {
    flex-basis: calc((100% - var(--space-4)) / 2) !important;
    width: calc((100% - var(--space-4)) / 2) !important;
    max-width: calc((100% - var(--space-4)) / 2) !important;
  }
}

@media (max-width: 768px) {
  .product-listing-grid {
    gap: var(--space-3) !important;
  }

  .product-listing-grid > .product-card,
  .product-listing-grid > .product-card--component,
  .product-listing-grid > article[data-product-card] {
    flex-basis: calc((100% - var(--space-3)) / 2) !important;
    width: calc((100% - var(--space-3)) / 2) !important;
    max-width: calc((100% - var(--space-3)) / 2) !important;
  }
}

@media (max-width: 520px) {
  .product-listing-grid > .product-card,
  .product-listing-grid > .product-card--component,
  .product-listing-grid > article[data-product-card] {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ANAYEK FIX END: force-product-listing-flex-layout */

/* ANAYEK FIX START: click-only-product-category-tree */

/* Product category tree:
   - No hover opening
   - Opens only by click on circular arrow button
   - Same mobile-menu-like tree panel on desktop
*/
.product-category-treebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  overflow: visible !important;
  z-index: 80;
  direction: rtl;
}

.product-category-treebar__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: visible !important;
}

.product-category-treebar__item {
  position: relative;
  overflow: visible !important;
}

.product-category-treebar__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.product-category-treebar__all,
.product-category-treebar__link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(115, 201, 244, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.055),
    0 8px 20px rgba(0,0,0,0.08);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.product-category-treebar__all:hover,
.product-category-treebar__link:hover,
.product-category-treebar__all.is-active,
.product-category-treebar__link.is-active {
  color: var(--primary);
  border-color: rgba(115, 201, 244, 0.38);
  background: linear-gradient(135deg, rgba(115, 201, 244, 0.17), rgba(31, 95, 153, 0.10));
}

.product-category-treebar__icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(115, 201, 244, 0.18);
  background: var(--surface);
}

/* دکمه فلش، trigger اصلی */
.product-category-treebar__toggle {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(115, 201, 244, 0.12) !important;
  color: var(--primary) !important;
  line-height: 1 !important;
  font-size: 0.72rem !important;
  font-weight: 950 !important;
  text-align: center !important;
  cursor: pointer !important;
  transform: none !important;
  transition:
    background 180ms ease,
    transform 260ms cubic-bezier(.2,.8,.2,1);
}

.product-category-treebar__item.is-open > .product-category-treebar__row > .product-category-treebar__toggle {
  background: rgba(115, 201, 244, 0.20) !important;
  transform: rotate(180deg) !important;
}

.product-category-treebar__chevron {
  display: none !important;
}

@media (min-width: 769px) {
  /* سطح اول: پنل زیر دکمه والد، فقط با کلاس is-open باز می‌شود */
  .product-category-treebar > .product-category-treebar__list > .product-category-treebar__item > .product-category-treebar__submenu {
    position: absolute !important;
    inset-inline-end: 0 !important;
    inset-inline-start: auto !important;
    inset-block-start: calc(100% + 8px) !important;
    inset-block-end: auto !important;

    width: max-content !important;
    min-width: 240px !important;
    max-width: min(82vw, 300px) !important;

    padding: 0.55rem !important;
    border: 1px solid rgba(115, 201, 244, 0.20) !important;
    border-radius: 20px !important;
    background:
      linear-gradient(145deg, rgba(9, 29, 52, 0.98), rgba(5, 19, 36, 0.96)) !important;
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.24),
      inset 0 1px 0 rgba(255,255,255,0.045) !important;
    backdrop-filter: blur(14px);

    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px) scale(0.98) !important;
    transition:
      opacity 300ms ease,
      transform 420ms cubic-bezier(.2,.8,.2,1),
      visibility 300ms ease !important;

    z-index: 97;
  }

  .product-category-treebar > .product-category-treebar__list > .product-category-treebar__item.is-open > .product-category-treebar__submenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
  }

  /* هیچ hoverای نباید پنل را باز کند */
  .product-category-treebar > .product-category-treebar__list > .product-category-treebar__item:not(.is-open):hover > .product-category-treebar__submenu,
  .product-category-treebar__submenu .product-category-treebar__item:not(.is-open):hover > .product-category-treebar__submenu,
  .product-category-treebar__item:not(.is-open):focus-within > .product-category-treebar__submenu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .product-category-treebar__submenu::before,
  .product-category-treebar__submenu::after,
  .product-category-treebar__item::after {
    content: none !important;
    display: none !important;
  }

  /* داخل پنل: فرم منوی موبایل، عمودی و تو‌رفته */
  .product-category-treebar__submenu .product-category-treebar__list--child {
    width: max-content !important;
    min-width: 0 !important;
    display: grid !important;
    gap: 0.42rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .product-category-treebar__submenu .product-category-treebar__item,
  .product-category-treebar__submenu .product-category-treebar__row {
    width: auto !important;
  }

  .product-category-treebar__submenu .product-category-treebar__link {
    width: auto !important;
    min-width: 150px !important;
    max-width: 220px !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.55rem !important;
    padding: 0.48rem 0.68rem !important;
    border: 1px solid rgba(115, 201, 244, 0.20) !important;
    border-radius: 999px !important;
    background:
      linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.045) !important;
    color: var(--text-strong) !important;
    font-size: 0.86rem !important;
    transform: none !important;
  }

  .product-category-treebar__submenu .product-category-treebar__link:hover,
  .product-category-treebar__submenu .product-category-treebar__link.is-active {
    color: var(--primary) !important;
    border-color: rgba(115, 201, 244, 0.34) !important;
    background:
      linear-gradient(135deg, rgba(115, 201, 244, 0.14), rgba(31, 95, 153, 0.10)) !important;
  }

  .product-category-treebar__submenu .product-category-treebar__icon {
    width: 17px !important;
    height: 17px !important;
    min-width: 17px !important;
    max-width: 17px !important;
  }

  .product-category-treebar__submenu .product-category-treebar__toggle {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 0.68rem !important;
  }

  /* زیرسطح‌ها: بسته تا وقتی خود دکمه کلیک شود */
  .product-category-treebar__submenu .product-category-treebar__submenu {
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;

    max-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
    transition:
      max-height 480ms cubic-bezier(.2,.8,.2,1),
      opacity 320ms ease,
      transform 380ms cubic-bezier(.2,.8,.2,1),
      visibility 320ms ease !important;
  }

  .product-category-treebar__submenu .product-category-treebar__item.is-open > .product-category-treebar__submenu {
    max-height: 900px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
    padding-block-start: 0.55rem !important;
  }

  .product-category-treebar__submenu .product-category-treebar__list--child .product-category-treebar__list--child {
    width: auto !important;
    margin-inline-start: 0.75rem !important;
    padding-inline-start: 0.65rem !important;
    border-inline-start: 1px solid rgba(115, 201, 244, 0.16) !important;
  }
}

@media (max-width: 768px) {
  .product-category-treebar {
    justify-content: flex-start;
  }

  .product-category-treebar__list {
    width: 100%;
    display: grid;
    gap: var(--space-2);
  }

  .product-category-treebar__all,
  .product-category-treebar__link {
    width: 100%;
    justify-content: flex-start;
  }

  .product-category-treebar__submenu {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    max-height: 0;
    overflow: hidden;
    transition:
      max-height 360ms cubic-bezier(.2,.8,.2,1),
      opacity 260ms ease,
      transform 300ms cubic-bezier(.2,.8,.2,1);
  }

  .product-category-treebar__item > .product-category-treebar__submenu {
    opacity: 0 !important;
    transform: translateY(-6px) !important;
  }

  .product-category-treebar__item.is-open > .product-category-treebar__submenu {
    max-height: 900px;
    opacity: 1 !important;
    transform: translateY(0) !important;
    padding-block-start: var(--space-2) !important;
  }

  .product-category-treebar__list--child {
    display: grid !important;
    gap: 0.55rem;
    margin-inline-start: var(--space-3);
    padding-inline-start: var(--space-3);
    border-inline-start: 1px solid var(--border-soft);
  }
}

/* ANAYEK FIX END: click-only-product-category-tree */

/* ANAYEK FIX START: connected-svg-category-toggle */

/* Connected SVG arrow button for product category tree */
.product-category-treebar__item.has-children > .product-category-treebar__row {
  gap: 0 !important;
  border: 1px solid rgba(115, 201, 244, 0.24) !important;
  border-radius: 999px !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.055),
    0 8px 20px rgba(0,0,0,0.08) !important;
  overflow: hidden !important;
}

.product-category-treebar__item.has-children > .product-category-treebar__row > .product-category-treebar__link {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.product-category-treebar__item.has-children > .product-category-treebar__row > .product-category-treebar__toggle {
  width: 40px !important;
  height: 42px !important;
  min-width: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-inline-start: 1px solid rgba(115, 201, 244, 0.16) !important;
  border-radius: 0 !important;
  background: rgba(115, 201, 244, 0.08) !important;
  color: var(--primary) !important;
  font-size: 0 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transform: none !important;
}

.product-category-treebar__item.has-children > .product-category-treebar__row > .product-category-treebar__toggle::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background: currentColor;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1);

  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.25 7.5L10 12.25L14.75 7.5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;

  mask-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.25 7.5L10 12.25L14.75 7.5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.product-category-treebar__item.is-open > .product-category-treebar__row > .product-category-treebar__toggle {
  background: rgba(115, 201, 244, 0.16) !important;
}

.product-category-treebar__item.is-open > .product-category-treebar__row > .product-category-treebar__toggle::before {
  transform: rotate(180deg);
}

.product-category-treebar__item.has-children > .product-category-treebar__row:hover {
  border-color: rgba(115, 201, 244, 0.38) !important;
  background:
    linear-gradient(135deg, rgba(115, 201, 244, 0.14), rgba(31, 95, 153, 0.10)) !important;
}

/* keep child rows compact after connecting the toggle */
.product-category-treebar__submenu .product-category-treebar__item.has-children > .product-category-treebar__row > .product-category-treebar__toggle {
  width: 36px !important;
  height: 40px !important;
  min-width: 36px !important;
}

/* ANAYEK FIX END: connected-svg-category-toggle */

/* ANAYEK FIX START: mobile-product-category-chip-size-fix */

/* Mobile product category chips: compact, centered, and not forced full width */
@media (max-width: 768px) {
  .product-listing__category-row.product-category-treebar,
  .product-category-treebar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.65rem !important;
  }

  .product-category-treebar__list {
    width: auto !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.65rem !important;
  }

  .product-category-treebar__item {
    width: auto !important;
    max-width: 100% !important;
  }

  .product-category-treebar__row {
    width: auto !important;
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .product-category-treebar__all,
  .product-category-treebar__link {
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 0.55rem 0.95rem !important;
    white-space: nowrap !important;
  }

  .product-category-treebar__item.has-children > .product-category-treebar__row {
    width: auto !important;
    max-width: 100% !important;
    min-height: 44px !important;
    display: inline-flex !important;
    gap: 0 !important;
  }

  .product-category-treebar__item.has-children > .product-category-treebar__row > .product-category-treebar__link {
    min-height: 44px !important;
    padding: 0.55rem 0.85rem !important;
  }

  .product-category-treebar__item.has-children > .product-category-treebar__row > .product-category-treebar__toggle {
    width: 40px !important;
    height: 44px !important;
    min-width: 40px !important;
  }

  .product-category-treebar__submenu {
    flex-basis: 100% !important;
  }

  .product-category-treebar__item.is-open > .product-category-treebar__submenu {
    width: min(100%, 300px) !important;
    margin-inline: auto !important;
  }

  .product-category-treebar__submenu .product-category-treebar__list--child {
    width: 100% !important;
    display: grid !important;
    justify-content: stretch !important;
  }

  .product-category-treebar__submenu .product-category-treebar__link {
    width: 100% !important;
    justify-content: flex-start !important;
    white-space: normal !important;
  }
}

/* ANAYEK FIX END: mobile-product-category-chip-size-fix */

/* ANAYEK FIX START: category-cms-description-sizing */

.product-list-hero__description.product-cms-content {
  line-height: 2;
  overflow-wrap: anywhere;
}

.product-list-hero__description.product-cms-content .cms-media {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
  gap: var(--space-2, 0.5rem);
  margin: 0.45rem 0.55rem;
}

.product-list-hero__description.product-cms-content .cms-media img,
.product-list-hero__description.product-cms-content .cms-media video {
  max-width: min(100%, 28rem);
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-xl, 1rem);
}

.product-list-hero__description.product-cms-content img[width] {
  height: auto;
  max-width: 100%;
}

@media (max-width: 760px) {
  .product-list-hero__description.product-cms-content .cms-media,
  .product-list-hero__description.product-cms-content .cms-media img,
  .product-list-hero__description.product-cms-content .cms-media video {
    max-width: 100%;
  }

  .product-list-hero__description.product-cms-content img[width] {
    width: 100%;
  }
}

/* ANAYEK FIX END: category-cms-description-sizing */


/* ANAYEK FIX START: tinymce-editor */

.admin-tinymce-lazy-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-block-start: 0.65rem;
  padding: 0.48rem 0.9rem;
  border: 1px solid rgba(115, 201, 244, 0.26);
  border-radius: var(--radius-pill, 999px);
  background: rgba(115, 201, 244, 0.10);
  color: var(--primary, #2563eb);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.admin-tinymce-lazy-button:hover,
.admin-tinymce-lazy-button.is-active {
  background: rgba(115, 201, 244, 0.18);
}

.tox.tox-tinymce {
  width: 100% !important;
  border-color: rgba(115, 201, 244, 0.22) !important;
  border-radius: var(--radius-xl, 1rem) !important;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18) !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary,
.tox .tox-statusbar {
  background: #071626 !important;
}

.tox .tox-statusbar {
  border-top-color: rgba(115, 201, 244, 0.16) !important;
}

.tox .tox-edit-area__iframe {
  background: #071626;
}

.product-cms-content img,
.product-list-hero__description img,
.content-detail__body img,
.content-body img,
.cms-content img {
  max-width: 100%;
  height: auto;
}

.product-cms-content p:has(> img:only-child),
.product-list-hero__description p:has(> img:only-child),
.content-detail__body p:has(> img:only-child),
.content-body p:has(> img:only-child),
.cms-content p:has(> img:only-child),
.product-cms-content figure.image,
.product-list-hero__description figure.image,
.content-detail__body figure.image,
.content-body figure.image,
.cms-content figure.image {
  display: inline-block;
  max-width: 100%;
  margin: 0.7rem 0.55rem;
  vertical-align: top;
}

.product-cms-content p:has(> img:only-child) img,
.product-list-hero__description p:has(> img:only-child) img,
.content-detail__body p:has(> img:only-child) img,
.content-body p:has(> img:only-child) img,
.cms-content p:has(> img:only-child) img,
.product-cms-content figure.image img,
.product-list-hero__description figure.image img,
.content-detail__body figure.image img,
.content-body figure.image img,
.cms-content figure.image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.product-cms-content p:has(> img:only-child) + p:not(:has(> img:only-child)),
.product-list-hero__description p:has(> img:only-child) + p:not(:has(> img:only-child)),
.content-detail__body p:has(> img:only-child) + p:not(:has(> img:only-child)),
.content-body p:has(> img:only-child) + p:not(:has(> img:only-child)),
.cms-content p:has(> img:only-child) + p:not(:has(> img:only-child)) {
  display: block;
  clear: both;
}

@media (max-width: 760px) {
  .product-cms-content p:has(> img:only-child),
  .product-list-hero__description p:has(> img:only-child),
  .content-detail__body p:has(> img:only-child),
  .content-body p:has(> img:only-child),
  .cms-content p:has(> img:only-child),
  .product-cms-content figure.image,
  .product-list-hero__description figure.image,
  .content-detail__body figure.image,
  .content-body figure.image,
  .cms-content figure.image {
    display: block;
    width: 100%;
    margin: 0.85rem 0;
  }
}

/* ANAYEK FIX END: tinymce-editor */


/* ANAYEK FIX START: cms-editor-public-parity */

.content-detail__body,
.content-body,
.cms-content,
.product-cms-content,
.product-list-hero__description.product-cms-content {
  direction: rtl;
  text-align: right;
  line-height: 2.05;
  overflow-wrap: anywhere;
}

.content-detail__body *,
.content-body *,
.cms-content *,
.product-cms-content *,
.product-list-hero__description.product-cms-content * {
  box-sizing: border-box;
}

.content-detail__body p,
.content-body p,
.cms-content p,
.product-cms-content p,
.product-list-hero__description.product-cms-content p {
  margin: 0 0 1rem;
  line-height: 2.05;
  text-align: right;
}

.content-detail__body h1,
.content-detail__body h2,
.content-detail__body h3,
.content-detail__body h4,
.content-detail__body h5,
.content-detail__body h6,
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6,
.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5,
.cms-content h6,
.product-cms-content h1,
.product-cms-content h2,
.product-cms-content h3,
.product-cms-content h4,
.product-cms-content h5,
.product-cms-content h6 {
  margin: 1.25rem 0 0.75rem;
  line-height: 1.7;
  text-align: right;
}

.content-detail__body img,
.content-detail__body video,
.content-body img,
.content-body video,
.cms-content img,
.cms-content video,
.product-cms-content img,
.product-cms-content video,
.product-list-hero__description.product-cms-content img,
.product-list-hero__description.product-cms-content video {
  max-width: 100%;
  height: auto;
}

.content-detail__body p:has(> img:only-child),
.content-detail__body p:has(> video:only-child),
.content-detail__body figure,
.content-detail__body figure.image,
.content-body p:has(> img:only-child),
.content-body p:has(> video:only-child),
.content-body figure,
.content-body figure.image,
.cms-content p:has(> img:only-child),
.cms-content p:has(> video:only-child),
.cms-content figure,
.cms-content figure.image,
.product-cms-content p:has(> img:only-child),
.product-cms-content p:has(> video:only-child),
.product-cms-content figure,
.product-cms-content figure.image,
.product-list-hero__description.product-cms-content p:has(> img:only-child),
.product-list-hero__description.product-cms-content p:has(> video:only-child),
.product-list-hero__description.product-cms-content figure,
.product-list-hero__description.product-cms-content figure.image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 1rem 0 !important;
  text-align: right !important;
  clear: both !important;
}

.content-detail__body p:has(> img:only-child) img,
.content-detail__body p:has(> video:only-child) video,
.content-detail__body figure img,
.content-detail__body figure video,
.content-body p:has(> img:only-child) img,
.content-body p:has(> video:only-child) video,
.content-body figure img,
.content-body figure video,
.cms-content p:has(> img:only-child) img,
.cms-content p:has(> video:only-child) video,
.cms-content figure img,
.cms-content figure video,
.product-cms-content p:has(> img:only-child) img,
.product-cms-content p:has(> video:only-child) video,
.product-cms-content figure img,
.product-cms-content figure video,
.product-list-hero__description.product-cms-content p:has(> img:only-child) img,
.product-list-hero__description.product-cms-content p:has(> video:only-child) video,
.product-list-hero__description.product-cms-content figure img,
.product-list-hero__description.product-cms-content figure video {
  display: inline-block !important;
  max-width: 100% !important;
  height: auto !important;
  vertical-align: top !important;
}

.content-detail__body figcaption,
.content-body figcaption,
.cms-content figcaption,
.product-cms-content figcaption {
  margin-top: 0.4rem;
  color: rgba(234, 247, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.8;
}

.content-detail__body table,
.content-body table,
.cms-content table,
.product-cms-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.content-detail__body td,
.content-detail__body th,
.content-body td,
.content-body th,
.cms-content td,
.cms-content th,
.product-cms-content td,
.product-cms-content th {
  border: 1px solid rgba(115, 201, 244, 0.24);
  padding: 0.5rem;
  vertical-align: top;
}

.content-detail__body blockquote,
.content-body blockquote,
.cms-content blockquote,
.product-cms-content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-right: 3px solid #73c9f4;
  background: rgba(115, 201, 244, 0.08);
  border-radius: 0.75rem;
}

/* ANAYEK FIX END: cms-editor-public-parity */


/* ANAYEK FIX START: cms-image-text-wrap-parity */

.content-detail__body img.cms-image-float-right,
.content-body img.cms-image-float-right,
.cms-content img.cms-image-float-right,
.product-cms-content img.cms-image-float-right {
  float: right !important;
  width: auto !important;
  max-width: min(48%, 360px) !important;
  height: auto !important;
  margin: 0.25rem 0 1rem 1.25rem !important;
  display: block !important;
  clear: none !important;
}

.content-detail__body img.cms-image-float-left,
.content-body img.cms-image-float-left,
.cms-content img.cms-image-float-left,
.product-cms-content img.cms-image-float-left {
  float: left !important;
  width: auto !important;
  max-width: min(48%, 360px) !important;
  height: auto !important;
  margin: 0.25rem 1.25rem 1rem 0 !important;
  display: block !important;
  clear: none !important;
}

.content-detail__body img.cms-image-block,
.content-body img.cms-image-block,
.cms-content img.cms-image-block,
.product-cms-content img.cms-image-block {
  float: none !important;
  display: block !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 1rem auto !important;
  clear: both !important;
}

.content-detail__body p:has(> img.cms-image-float-right:only-child),
.content-detail__body p:has(> img.cms-image-float-left:only-child),
.content-body p:has(> img.cms-image-float-right:only-child),
.content-body p:has(> img.cms-image-float-left:only-child),
.cms-content p:has(> img.cms-image-float-right:only-child),
.cms-content p:has(> img.cms-image-float-left:only-child),
.product-cms-content p:has(> img.cms-image-float-right:only-child),
.product-cms-content p:has(> img.cms-image-float-left:only-child) {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  clear: none !important;
  text-align: inherit !important;
}

.content-detail__body p:has(> img.cms-image-block:only-child),
.content-body p:has(> img.cms-image-block:only-child),
.cms-content p:has(> img.cms-image-block:only-child),
.product-cms-content p:has(> img.cms-image-block:only-child) {
  display: block !important;
  width: 100% !important;
  margin: 1rem 0 !important;
  clear: both !important;
  text-align: center !important;
}

.content-detail__body::after,
.content-body::after,
.cms-content::after,
.product-cms-content::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 760px) {
  .content-detail__body img.cms-image-float-right,
  .content-detail__body img.cms-image-float-left,
  .content-body img.cms-image-float-right,
  .content-body img.cms-image-float-left,
  .cms-content img.cms-image-float-right,
  .cms-content img.cms-image-float-left,
  .product-cms-content img.cms-image-float-right,
  .product-cms-content img.cms-image-float-left {
    float: none !important;
    display: block !important;
    max-width: 100% !important;
    margin: 1rem auto !important;
    clear: both !important;
  }
}

/* ANAYEK FIX END: cms-image-text-wrap-parity */
