/*
 * Shop / Archive Page — minow-mango
 */

/* ═══════════════════════════════════════════════════
   PAGE LAYOUT
═══════════════════════════════════════════════════ */
.mm-shop {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: clamp(24px, 2.97vw, 57px);
  padding: clamp(24px, 1.67vw, 32px) clamp(16px, 5.83vw, 112px) clamp(48px, 4vw, 80px);
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
  background: var(--clr-bg, #fffbeb);
  min-height: 60vh;
  direction: rtl;
}

.mm-shop__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.67vw, 32px);
}

/* Topbar */
.mm-shop__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  min-height: 48px;
  flex-wrap: wrap;
  gap: 12px;
}

.mm-shop__title {
  font-size: clamp(16px, 1.04vw, 20px);
  font-weight: 700;
  color: #262626;
  letter-spacing: -0.03em;
  line-height: 1.4;
  margin: 0;
}

/* Sort tabs */
.mm-shop__sort {
  display: flex;
  align-items: center;
  direction: rtl;
  background: #f5f5f5;
  border-radius: 10px;
  padding: clamp(6px, 0.52vw, 10px) clamp(12px, 1.04vw, 20px);
  flex-wrap: wrap;
  gap: 0;
}

.mm-shop__sort-link {
  font-size: clamp(11px, 0.73vw, 14px);
  color: #737373;
  white-space: nowrap;
  padding: 0 clamp(8px, 0.83vw, 16px);
  letter-spacing: -0.03em;
  line-height: 28px;
  text-decoration: none;
  transition: color 0.15s;
  position: relative;
}

.mm-shop__sort-link + .mm-shop__sort-link::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: #d4d4d4;
}

.mm-shop__sort-link--active { color: #f58220; font-weight: 700; }
.mm-shop__sort-link:hover   { color: #f58220; }

/* Product grid */
.mm-shop__grid {
  display: grid;
  grid-template-columns: repeat( auto-fill, minmax( clamp(180px, 13.75vw, 264px), 1fr ) );
  gap: clamp(12px, 1.25vw, 24px) clamp(12px, 1.46vw, 28px);
  align-items: start;
}

.mm-shop__empty {
  color: #737373;
  text-align: center;
  padding: 48px 0;
  grid-column: 1 / -1;
  font-size: clamp(14px, 0.83vw, 16px);
}

/* ═══════════════════════════════════════════════════
   PAGINATION
   ───────────────────────────────────────────────────
   WooCommerce outputs:
     <nav class="woocommerce-pagination">
       <ul class="page-numbers">
         <li><a class="page-numbers prev"   href="…">«</a></li>
         <li><a class="page-numbers"        href="…">1</a></li>
         <li><span class="page-numbers current">2</span></li>
         <li><a class="page-numbers dots">…</a></li>
         <li><a class="page-numbers next"   href="…">»</a></li>
       </ul>
     </nav>
   
   Note: ul itself also carries class "page-numbers" — the old bug
   was that `.page-numbers { width:40px }` also matched the <ul>,
   squashing it to 40 px and stacking every <li> vertically. All
   box-model rules below are scoped to `a.page-numbers` /
   `span.page-numbers` only.
═══════════════════════════════════════════════════ */

/* Outer wrapper — spans the full grid width and centres the nav */
.mm-shop__pagination {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: clamp(32px, 3.33vw, 64px);
}

/* The <ul> — white pill card, matching sidebar panel visual language */
.mm-shop__pagination .woocommerce-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 0.42vw, 6px);
  list-style: none;
  margin: 0;
  padding: clamp(6px, 0.42vw, 8px);
  background: #ffffff;
  border-radius: clamp(14px, 1.04vw, 20px);
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.04);
  direction: rtl;
}

/* Each <li> is a flex item so it sizes tightly around its child */
.mm-shop__pagination .woocommerce-pagination ul.page-numbers li {
  display: flex;
}

/* ── All number / arrow / dots buttons ── */
.mm-shop__pagination a.page-numbers,
.mm-shop__pagination span.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(36px, 2.5vw, 44px);
  height: clamp(36px, 2.5vw, 44px);
  padding: 0 clamp(6px, 0.52vw, 10px);
  border-radius: clamp(8px, 0.63vw, 12px);
  /* AzarMehr FD renders digits as Persian numerals automatically */
  font-family: var(--wp--preset--font-family--azarmehr-fd), 'AzarMehr FD', var(--font-primary);
  font-size: clamp(13px, 0.83vw, 16px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #404040;
  background: transparent;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

/* ── Hover ── */
.mm-shop__pagination a.page-numbers:hover {
  background: #fff8ed;
  border-color: #ffd49c;
  color: #f58220;
}

/* ── Active / current page — orange pill, matching primary accent ── */
.mm-shop__pagination span.page-numbers.current {
  background: #f58220;
  border-color: #f58220;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 130, 32, 0.25);
  cursor: default;
}

/* ── Ellipsis dots — muted, non-interactive ── */
.mm-shop__pagination a.page-numbers.dots,
.mm-shop__pagination span.page-numbers.dots {
  color: #a1a1a1;
  background: transparent;
  border-color: transparent;
  pointer-events: none;
  min-width: 24px;
  letter-spacing: 0;
}

/* ── Prev / Next arrows — light gray pill so they feel distinct ── */
.mm-shop__pagination a.page-numbers.prev,
.mm-shop__pagination a.page-numbers.next {
  font-size: clamp(15px, 1.04vw, 18px);
  font-weight: 400;
  color: #737373;
  background: #f5f5f5;
  border-color: transparent;
}

.mm-shop__pagination a.page-numbers.prev:hover,
.mm-shop__pagination a.page-numbers.next:hover {
  background: #f58220;
  border-color: #f58220;
  color: #ffffff;
}

/* ═══════════════════════════════════════════════════
   PRODUCT CARD
═══════════════════════════════════════════════════ */
.mm-product-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #f5f5f5;
  border-radius: clamp(16px, 1.25vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 0.83vw, 16px);
  padding: clamp(24px, 2.08vw, 40px) clamp(16px, 1.67vw, 32px) clamp(20px, 1.67vw, 32px);
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  aspect-ratio: 286 / 406;
  width: 100%;
}

.mm-product-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.08); transform: translateY(-2px); }

.mm-product-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 286 406' fill='none'%3E%3Cpath d='M243 174.3C243 182 238.8 188.8 232.6 192.5C228.3 195 224.5 198.9 224.5 203.8C224.5 215.5 215 225 203.4 225L91 225C79.3 225 69.8 215.5 69.8 203.8L69.8 201.2C69.8 198 67.3 195.4 64.1 195.4C52.4 195.4 43 185.9 43 174.3L43 119.1C43 107.4 52.4 98 64.1 98C67.3 98 69.8 95.4 69.8 92.2L69.8 86.1C69.8 74.4 79.3 65 91 65L203.4 65C215 65 224.5 74.4 224.5 86.1C224.5 93 230.1 98.5 235.4 102.9C240 106.8 243 112.6 243 119.1L243 174.3Z' fill='%23FAFAFA'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.mm-product-card__img-wrap {
  position: relative;
  width: 69.2%; /* 198px / 286px */
  aspect-ratio: 198 / 200;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  flex-shrink: 0;
  margin-bottom: auto; /* Push content to bottom */
}

.mm-product-card__img,
.mm-product-card__img-wrap img {
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.mm-product-card__body {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.52vw, 10px);
  align-items: center;
  justify-content: center;
  width: 100%;
  z-index: 1;
}

/* Product name */
.mm-product-card__name {
  font-size: clamp(13px, 0.94vw, 18px);
  font-weight: 700;
  color: #262626;
  text-align: center;
  line-height: 1.4;
  letter-spacing: -0.03em;
  margin: 0;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── PRICE CONTAINER ──────────────────────────────
   Screenshot spec:
   • One single line: از ۷,۵۰۰,۰۰۰ تا ۵,۰۰۰,۰۰۰ ریال
   • Numbers: Persian digits (fa_IR locale via number_format_i18n)
   • Currency: word "ریال" at the END (not ﷼ symbol before)
   • Color: muted gray (#737373)
   • Centered, lighter weight than name
──────────────────────────────────────────────── */
.mm-product-card__price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.5vw, 8px);
  width: 100%;
  /* Single line — never wrap */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Range price: "از [min] تا [max] ریال" */
.mm-pc__price-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  direction: rtl;
  font-size: clamp(11px, 0.73vw, 14px);
  color: #262626;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-wrap: nowrap;
}

/* Single price: "[price] ریال" */
.mm-pc__price-single {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  direction: rtl;
  font-size: clamp(12px, 0.83vw, 16px);
  color: #262626;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* "از" and "تا" helper words — slightly muted */
.mm-pc__from,
.mm-pc__to {
  color: #262626;
  opacity: 0.5;
  font-weight: 400;
  font-size: clamp(10px, 0.63vw, 12px);
  flex-shrink: 0;
}

/* "ریال" currency word */
.mm-pc__currency {
  color: #262626;
  opacity: 0.5;
  font-weight: 400;
  font-size: clamp(10px, 0.63vw, 12px);
  flex-shrink: 0;
}

/* Sale row: old price + discount badge */
.mm-pc__price-sale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: rtl;
  white-space: nowrap;
}

.mm-pc__price-old {
  font-size: clamp(10px, 0.63vw, 12px);
  color: #262626;
  opacity: 0.5;
  text-decoration: line-through;
  font-weight: 400;
}

.mm-pc__discount-badge {
  background: #f58220;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0;
  direction: ltr;
  display: inline-block;
}

/* Featured badge */
.mm-product-card__badge {
  position: absolute;
  top: clamp(8px, 0.83vw, 12px);
  right: clamp(8px, 0.83vw, 12px);
  background: #f58220;
  color: #fff;
  font-size: clamp(10px, 0.73vw, 12px);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  z-index: 2;
  letter-spacing: -0.03em;
  white-space: nowrap;
  line-height: 20px;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════ */
.mm-shop__sidebar {
  flex: 0 0 clamp(200px, 14.58vw, 280px);
  position: sticky;
  top: clamp(16px, 1.04vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 0.83vw, 16px);
  direction: rtl;
}

.mm-bc-wrap { display: flex; align-items: center; min-height: 40px; }
.mm-bc { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; direction: rtl; }
.mm-bc__item, .mm-bc__item a { font-size: 12px; color: #a1a1a1; text-decoration: none; }
.mm-bc__item:last-child, .mm-bc__item:last-child a { color: #262626; font-weight: 600; }
.mm-bc__sep { color: #d4d4d4; font-size: 11px; margin: 0 2px; }

.mm-sidebar {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 0.83vw, 16px);
}

.mm-sidebar__panel {
  background: #ffffff;
  border-radius: clamp(12px, 0.83vw, 16px);
  border: none;
  overflow: hidden;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.02);
}

.mm-sidebar__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  gap: 8px;
  padding: clamp(20px, 1.25vw, 24px) clamp(16px, 1.25vw, 24px);
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
}

.mm-sidebar__head-text {
  font-size: clamp(13px, 0.83vw, 16px);
  font-weight: 700;
  color: #262626;
  letter-spacing: -0.03em;
  line-height: 32px;
}

.mm-sidebar__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-left: 2px solid #a1a1a1;
  border-bottom: 2px solid #a1a1a1;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  display: block;
}

.mm-sidebar__head[aria-expanded="false"] .mm-sidebar__chevron { transform: rotate(135deg); }

.mm-sidebar__body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}

.mm-sidebar__body--collapsed { max-height: 0 !important; opacity: 0; }

/* Category rows */
.mm-cat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  padding: clamp(10px, 0.63vw, 12px) clamp(16px, 1.25vw, 24px);
  border-bottom: none;
  gap: 8px;
  transition: background 0.15s;
}

.mm-cat__row:hover { background: #fafafa; }
.mm-cat__row--active { background: rgba(245,130,32,0.05); }

.mm-cat__link {
  font-size: clamp(13px, 0.83vw, 16px);
  font-weight: 700;
  color: #262626;
  text-decoration: none;
  flex: 1;
  text-align: right;
  letter-spacing: -0.03em;
  line-height: 28px;
  transition: color 0.15s;
}

.mm-cat__row--child .mm-cat__link { font-weight: 400; font-size: clamp(12px, 0.73vw, 14px); letter-spacing: -0.03em; color: #404040; }
.mm-cat__link:hover, .mm-cat__link--active { color: #f58220; }
.mm-cat__row--active .mm-cat__link { color: #f58220; font-weight: 700; }

.mm-cat__toggle { background: none; border: none; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; color: #a1a1a1; transition: color 0.15s; }
.mm-cat__toggle:hover { color: #f58220; }

.mm-cat__chevron { display: inline-block; width: 8px; height: 8px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s ease; }
.mm-cat__toggle[aria-expanded="false"] .mm-cat__chevron { transform: rotate(135deg); }

.mm-cat__chevron--leaf { width: 8px; height: 8px; border-left: 1.5px solid #d4d4d4; border-bottom: 1.5px solid #d4d4d4; transform: rotate(-45deg); display: inline-block; flex-shrink: 0; }

.mm-cat__row--child { padding-right: clamp(24px, 2.08vw, 40px); border-bottom: none; background: #ffffff; }
.mm-cat__row--child:hover { background: #fafafa; }

.mm-cat__children { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.mm-cat__children--open { max-height: 1500px; }
.mm-cat__children li { display: block; }

/* Price filter */
.mm-price { padding: clamp(12px, 0.83vw, 16px) clamp(16px, 1.25vw, 24px) clamp(20px, 1.25vw, 24px); display: flex; flex-direction: column; gap: clamp(16px, 1.04vw, 20px); direction: rtl; }
.mm-price__labels { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 0.42vw, 8px); direction: rtl; font-size: clamp(12px, 0.73vw, 14px); color: #262626; flex-wrap: nowrap; }
.mm-price__word { color: #a1a1a1; font-size: clamp(11px, 0.63vw, 12px); flex-shrink: 0; }
.mm-price__group { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.mm-price__currency { font-size: clamp(10px, 0.63vw, 12px); color: #a1a1a1; }
.mm-price__val { font-weight: 700; font-size: clamp(12px, 0.73vw, 14px); color: #262626; letter-spacing: -0.03em; }

.mm-price__slider { position: relative; height: 24px; display: flex; align-items: center; }
.mm-price__track { position: absolute; left: 0; right: 0; height: 6px; background: #f5f5f5; border-radius: 4px; pointer-events: none; }
.mm-price__fill { position: absolute; height: 100%; background: #f58220; border-radius: 4px; }
.mm-price__thumb { position: absolute; width: 100%; height: 6px; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; outline: none; direction: ltr; }
.mm-price__thumb::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #f58220; border: 4px solid #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); pointer-events: all; cursor: grab; transition: transform 0.15s; }
.mm-price__thumb::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.mm-price__thumb::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #f58220; border: 4px solid #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); pointer-events: all; cursor: grab; }

/* Checkboxes */
.mm-sidebar__panel--check { padding: 0; }
.mm-check { display: flex; align-items: center; justify-content: flex-start; direction: rtl; gap: clamp(8px, 0.63vw, 12px); padding: clamp(16px, 1.04vw, 20px) clamp(16px, 1.25vw, 24px); cursor: pointer; width: 100%; }
.mm-check__input { position: absolute; opacity: 0; width: 0; height: 0; }
.mm-check__box { width: 24px; height: 24px; border: 2px solid #e5e5e5; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; background: #ffffff; position: relative; }
.mm-check__text { font-size: clamp(12px, 0.73vw, 14px); color: #262626; letter-spacing: -0.03em; line-height: 32px; background: transparent !important; }
.mm-check__input:checked ~ .mm-check__box { background: #f58220; border-color: #f58220; }
.mm-check__input:checked ~ .mm-check__box::after { content: ''; display: block; width: 5px; height: 9px; border-right: 2px solid #ffffff; border-bottom: 2px solid #ffffff; transform: rotate(45deg) translate(-1px, -1px); }
.mm-check__input:focus-visible ~ .mm-check__box { outline: 2px solid #f58220; outline-offset: 2px; }

.mm-shop__mobile-filter-btn { display: none; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media ( max-width: 1100px ) {
  .mm-shop { flex-direction: column; }
  .mm-shop__sidebar { position: static; flex: none; width: 100%; order: -1; }
}

@media ( max-width: 768px ) {
  .mm-shop__grid { grid-template-columns: repeat(2, 1fr); }
  .mm-shop__topbar { flex-direction: column; align-items: stretch; height: auto; }
  
  .mm-shop__topbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 16px;
  }
  
  .mm-shop__mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #404040;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
  }
  .mm-shop__mobile-filter-btn[aria-expanded="true"] {
    background: #e6faf1;
    border-color: #0a946f;
    color: #004739;
  }

  .mm-shop__sidebar {
    display: none;
    margin-bottom: 24px;
  }
  .mm-shop__sidebar.is-active {
    display: block;
    animation: fadeIn 0.3s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Pagination — tighten up on mobile */
  .mm-shop__pagination .woocommerce-pagination ul.page-numbers {
    gap: 3px;
    padding: 5px;
    border-radius: 14px;
  }

  .mm-shop__pagination a.page-numbers,
  .mm-shop__pagination span.page-numbers {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
  }
}

@media ( max-width: 480px ) {
  .mm-shop__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .mm-product-card__img-wrap { height: clamp(140px, 35vw, 180px); }
  .mm-product-card__body { padding: 12px; }
  .mm-product-card__name { font-size: 13px; margin-bottom: 4px; }
  .mm-pc__price-single { font-size: 13px; }
  .mm-pc__currency-badge { height: 1em; }
}

/* typography overrides */
.mm-shop__title,
.mm-product-card__name,
.mm-sidebar__head-text,
.mm-cat__link {
  font-family: var(--font-secondary);
}
