/* میزبما 2.2.0 | عرض کامل، هدر و جستجوی موبایل، استوری، کارت محصول، تسویه */

:root {
  --container: 1720px;
  --header-h: 78px;
}

.container {
  max-width: var(--container);
  width: 100%;
  padding-inline: clamp(14px, 2vw, 36px);
}

.header .container,
.mainnav .container,
.topbar .container,
.footer > .container,
.stories .container {
  max-width: 1760px;
}

/* اعداد قیمت: جلوگیری از چسبیدن تومان به رقم انگلیسی/فارسی */
.woocommerce-Price-amount,
.price .amount,
.price bdi,
.mz-money {
  unicode-bidi: isolate;
  direction: rtl;
}
.woocommerce-Price-amount bdi,
.price bdi {
  display: inline-flex !important;
  flex-direction: row;
  align-items: baseline;
  gap: 0.35em;
  direction: rtl;
  unicode-bidi: isolate;
}
.woocommerce-Price-currencySymbol {
  margin: 0;
  white-space: nowrap;
}

/* هدر عریض و پایدار در موبایل */
.header .header-bar,
.header > .container {
  gap: 14px;
}
.header .brand {
  display: flex !important;
}
@media (max-width: 980px) {
  .header {
    position: sticky;
    top: 0;
  }
  .header > .container,
  .header .header-bar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "burger logo actions"
      "search search search";
    align-items: center;
    height: auto !important;
    min-height: 64px;
    gap: 8px 10px;
    padding-top: 8px;
    padding-bottom: 10px;
  }
  .header .burger {
    grid-area: burger;
    display: flex !important;
  }
  .header .logo {
    grid-area: logo;
    min-width: 0;
  }
  .header .brand small {
    display: none;
  }
  .header .brand b {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header .head-actions {
    grid-area: actions;
    margin: 0 !important;
  }
  .header .search,
  .header .search form {
    grid-area: search;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    order: unset !important;
  }
  .header .search input,
  .header .search input[type="search"] {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    background: #fff;
    font-size: 14px;
  }
  .drawer-search {
    display: block;
    padding: 12px 14px 0;
  }
  .drawer-search input {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
  }
}

@media (min-width: 981px) {
  .drawer-search {
    display: none;
  }
}

/* اندازه استوری: دایره خوانا + بیننده عمودی، نه کشیده تمام‌صفحه در دسکتاپ */
.stories {
  padding: 14px 0 12px;
}
.stories .story {
  width: 96px;
}
.stories .story .ring {
  width: 84px;
  height: 84px;
}
.stories .story span {
  font-size: 12px;
  margin-top: 7px;
}
.story-modal {
  padding: 18px;
  background: rgba(9, 7, 5, 0.94);
}
.story-modal .story-viewer {
  width: min(420px, calc(100vw - 28px)) !important;
  height: min(760px, calc(100dvh - 36px)) !important;
  max-width: 420px;
  border-radius: 22px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.story-viewer img,
.story-viewer video {
  object-fit: contain !important;
  background: #000;
}
@media (max-width: 760px) {
  .stories .story {
    width: 78px;
  }
  .stories .story .ring {
    width: 70px;
    height: 70px;
  }
  .story-modal {
    padding: 0;
  }
  .story-modal .story-viewer {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none;
    border-radius: 0 !important;
  }
  .story-viewer img,
  .story-viewer video {
    object-fit: cover !important;
  }
}

body.woocommerce-checkout .stories,
body.woocommerce-order-pay .stories,
body.woocommerce-order-received .stories {
  display: none !important;
}

/* کارت محصول: گرید قطعی، بدون float ووکامرس */
.woocommerce ul.products,
.woocommerce .products,
ul.products {
  display: grid !important;
  grid-template-columns: repeat(var(--mz-shop-columns, 4), minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: both !important;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after,
ul.products::before,
ul.products::after {
  display: none !important;
  content: none !important;
}
.woocommerce ul.products li.product,
ul.products li.product {
  width: auto !important;
  max-width: none !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.woocommerce ul.products li.product .price-row {
  align-items: flex-end;
  gap: 8px;
}
.woocommerce ul.products li.product .price {
  min-width: 0;
  flex: 1;
  line-height: 1.45;
}
.woocommerce ul.products li.product .button.product_type_simple,
.woocommerce ul.products li.product .button.product_type_external {
  font-size: 0 !important;
  position: relative;
}
.woocommerce ul.products li.product .button.product_type_simple::before,
.woocommerce ul.products li.product .button.product_type_external::before {
  content: "+";
  font-size: 22px;
  line-height: 1;
}
.mz-tag-special,
.badge-special {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}
.mz-special-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ivory);
  color: var(--gold-dark);
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* صفحه محصول بدون زوم و بدون به‌هم‌ریختگی ستون‌ها */
.woocommerce div.product {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px 36px;
  align-items: start;
}
.woocommerce div.product div.images,
.woocommerce div.product div.summary {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  min-width: 0;
}
.woocommerce div.product div.images {
  grid-column: 1;
  grid-row: 1;
}
.woocommerce div.product div.summary {
  grid-column: 2;
  grid-row: 1;
}
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related,
.woocommerce div.product .upsells,
.woocommerce div.product > .advice-box,
.woocommerce div.product > section,
.single-product .related.products,
.single-product .upsells.products,
.single-product .mizbama-related-products {
  grid-column: 1 / -1;
  width: 100% !important;
  float: none !important;
  clear: both !important;
}
.woocommerce-product-gallery .zoomImg,
.woocommerce-product-gallery__trigger {
  display: none !important;
}
.woocommerce-product-gallery__image,
.woocommerce div.product div.images img {
  cursor: default;
}
.woocommerce div.product div.images .flex-viewport,
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
  border-radius: 18px;
  overflow: hidden;
}
.woocommerce div.product div.images img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain;
  background: var(--ivory);
}

@media (max-width: 900px) {
  .woocommerce div.product {
    grid-template-columns: 1fr !important;
  }
  .woocommerce div.product div.images,
  .woocommerce div.product div.summary,
  .woocommerce div.product .woocommerce-tabs,
  .woocommerce div.product .related,
  .woocommerce div.product .upsells {
    grid-column: 1;
    grid-row: auto;
  }
  .woocommerce ul.products,
  .woocommerce .products,
  .single-product .related.products ul.products,
  .single-product .mizbama-related-products .mizbama-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* تسویه: یک آدرس، استان سپس شهر، خرید چکی */
.woocommerce-checkout #ship-to-different-address,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout #billing_address_2_field,
.woocommerce-checkout #shipping_address_2_field {
  display: none !important;
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
  display: flex;
  flex-direction: column;
}
.woocommerce-checkout #billing_country_field { order: 10; }
.woocommerce-checkout #billing_state_field { order: 20; }
.woocommerce-checkout #billing_city_field { order: 30; }
.woocommerce-checkout #billing_address_1_field { order: 40; }
.woocommerce-checkout #billing_postcode_field { order: 50; }
.woocommerce-checkout #billing_phone_field { order: 60; }
.woocommerce-checkout #billing_email_field { order: 70; }
.mz-check-upload {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--gold-light);
  border-radius: 12px;
  background: var(--ivory-soft);
}
.mz-check-upload label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--brown);
}
.mz-check-upload input[type="file"] {
  width: 100%;
  padding: 8px 0;
}
.mz-check-preview img {
  display: block;
  max-width: 220px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.mz-freight-note {
  font-weight: 400;
  opacity: 0.85;
}
.mz-sale-section .sec-head h2 {
  color: var(--gold-dark);
}

@media (min-width: 1500px) {
  .woocommerce ul.products {
    gap: 22px !important;
  }
}

/* آیکون‌های شناور: دایره کامل، بدون برش، بالای نوار موبایل، بدون پالس تند */
.fab-socials {
  left: 14px !important;
  right: auto !important;
  bottom: 18px !important;
  z-index: 70 !important;
  gap: 8px !important;
  align-items: flex-start;
}
.fab-social {
  width: auto !important;
  min-width: 46px;
  height: 46px !important;
  padding: 0 12px 0 10px;
  border-radius: 999px !important;
  overflow: visible !important;
  animation: none !important;
  color: #fff !important;
  display: inline-flex !important;
  flex-direction: row;
  direction: ltr;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  box-shadow: 0 8px 18px rgba(43, 33, 24, .18);
}
.fab-socials .fab-social::after {
  display: none !important;
}
.fab-social .social-icon,
.fab-social .social-icon svg,
.footer .socials .social-icon,
.footer .socials .social-icon svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  display: block !important;
  overflow: visible !important;
  flex: 0 0 22px;
}
.fab-label {
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.social-whatsapp { background: #25d366 !important; }
.social-instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7) !important; }
.social-telegram { background: #2aa1df !important; }
.social-bale { background: #43c465 !important; }
.social-rubika { background: #e4376c !important; }
@keyframes mz-fab-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .45); }
  70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.fab-social.social-whatsapp {
  animation: mz-fab-pulse 3.8s ease-out infinite !important;
}
@media (prefers-reduced-motion: reduce) {
  .fab-social,
  .fab-social.social-whatsapp {
    animation: none !important;
  }
}
@media (max-width: 980px) {
  .fab-socials {
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    z-index: 80 !important;
  }
  .fab-social {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    padding: 0 !important;
    justify-content: center;
  }
  .fab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .header,
  .mobile-bar {
    backdrop-filter: none;
  }
}
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}
