/* =====================================================================
   DigiSVG - رسپانسیو حرفه‌ای کامل (موبایل، تبلت، دسکتاپ)
   این فایل بعد از main.css بارگذاری می‌شود و آن را تکمیل/اصلاح می‌کند.
   مهندس رسولی
   ===================================================================== */

/* ---------- پایه: جلوگیری از سرریز افقی و کنترل کانتینر ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
* { min-width: 0; }
img, video, iframe, svg { max-width: 100%; height: auto; }
table { max-width: 100%; }

/* کانتینر واکنش‌گرا با عرض‌های استاندارد به‌جای max-width:100% ثابت */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 15px;
}
@media (max-width: 1280px) { .container { max-width: 1120px; } }
@media (max-width: 1140px) { .container { max-width: 960px; } }
@media (max-width: 992px)  { .container { max-width: 720px; } }
@media (max-width: 768px)  { .container { max-width: 100%; padding-inline: 14px; } }
@media (max-width: 480px)  { .container { padding-inline: 12px; } }

/* ============================================================
   تبلت بزرگ / لپ‌تاپ کوچک  (≤ 1140px)
   ============================================================ */
@media (max-width: 1140px) {
  .products-grid-5 { grid-template-columns: repeat(4, 1fr); }
  .woocommerce .products { grid-template-columns: repeat(4, 1fr) !important; }
  .trending-grid { grid-template-columns: repeat(4, 1fr); }
  .header-search { max-width: 460px; }
}

/* ============================================================
   تبلت  (≤ 992px)
   ============================================================ */
@media (max-width: 992px) {
  .products-grid-5,
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .woocommerce .products { grid-template-columns: repeat(3, 1fr) !important; }
  .special-products { grid-template-columns: repeat(3, 1fr); }
  .trending-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .banners-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero-anim-content { grid-template-columns: 1fr; text-align: center; }

  /* هدر: جستجو تمام‌عرض زیر لوگو */
  .header-main-inner { flex-wrap: wrap; gap: 12px; }
  .header-search { order: 3; width: 100%; max-width: 100%; margin: 6px 0 0; }

  /* سایدبار فروشگاه زیر محتوا */
  .shop-page-wrapper,
  .shop-container { grid-template-columns: 1fr !important; }
  .shop-sidebar { width: 100% !important; }
}

/* ============================================================
   موبایل بزرگ / تبلت کوچک  (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 13px; }

  /* نمایش/مخفی‌سازی اجزای ناوبری */
  .topbar { display: none; }
  .primary-menu { display: none; }
  .cat-menu-wrap { display: none; }
  .mobile-toggle { display: flex !important; }
  .mobile-bottom-bar { display: flex !important; }
  body { padding-bottom: 62px; }   /* فضا برای نوار پایین موبایل */

  /* هدر */
  .header-main { padding: 10px 0; }
  .header-main-inner { flex-wrap: wrap; gap: 10px; align-items: center; }
  .logo img { height: 38px; width: auto; }
  .header-search { order: 10; width: 100%; max-width: 100%; margin-top: 8px; }
  .search-wrap { height: 44px; border-radius: 8px; }
  .header-tools { gap: 8px; margin-inline-start: auto; }
  .header-bottom { display: none; }

  /* گریدهای محصول: دو ستونه */
  .products-grid-5,
  .products-grid,
  .woocommerce .products,
  .special-products,
  .trending-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .blog-grid { grid-template-columns: 1fr; gap: 12px; }
  .banners-grid { grid-template-columns: 1fr; gap: 10px; }

  /* اسلایدر (هیرو) */
  .hero-animated-wrapper,
  .hero-animated-wrapper .swiper { min-height: 300px; }
  .hero-anim-slide { min-height: 300px; padding: 18px 14px; }
  .hero-anim-content { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .hero-car-wrap { order: -1; }
  .hero-title { font-size: 18px; line-height: 1.5; }
  .hero-subtitle { font-size: 12px; }
  .hero-actions { justify-content: center; flex-wrap: wrap; }

  /* عناوین بخش‌ها و تب‌ها */
  .section { padding: 20px 0; }
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-header h2 { font-size: 14px; }
  .section-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; width: 100%; padding-bottom: 6px; }
  .section-arrows { display: none; }

  /* فیلتر */
  .filter-box { flex-direction: column; align-items: stretch; padding: 12px !important; }
  .filter-selects { flex-direction: column; }
  .filter-selects select,
  .filter-box select { width: 100%; }

  /* پیشنهاد ویژه */
  .special-inner { flex-direction: column; }
  .special-info { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; text-align: right; }

  /* فوتر */
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .footer-main { padding: 26px 0 16px; }
  .footer-bottom-inner,
  .footer-bottom-exclusive .footer-bottom-inner { flex-direction: column; text-align: center; gap: 12px; }
  .footer-newsletter { flex-direction: column; text-align: center; gap: 14px; }
  .newsletter-form { width: 100%; max-width: 100%; }
  .footer-logos, .footer-logos-exclusive { justify-content: center; flex-wrap: wrap; }

  /* محصول تکی */
  .single-product-main,
  .product-single-inner { grid-template-columns: 1fr !important; }
  .sticky-atc-inner { flex-direction: column; gap: 8px; }

  /* جداول ووکامرس (سبد خرید، حساب) قابل اسکرول */
  .woocommerce table.shop_table,
  .woocommerce-cart table.cart,
  .woocommerce table { display: block; overflow-x: auto; white-space: nowrap; }
  .woocommerce-cart .cart-collaterals,
  .woocommerce .cart-collaterals .cart_totals { width: 100% !important; float: none !important; }

  /* دکمه‌های تمام‌عرض در موبایل برای دسترسی بهتر */
  .btn-block-mobile { width: 100%; justify-content: center; }
}

/* ============================================================
   موبایل کوچک  (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .logo img { height: 34px; }
  .hero-title { font-size: 16px; }
  .section-header h2 { font-size: 13px; }

  /* کارت محصول جمع‌وجورتر ولی همچنان دو ستونه */
  .product-card .title,
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 11px; min-height: 34px; }
  .product-card .price,
  .woocommerce ul.products li.product .price { font-size: 12px; }

  /* برندها/استوری‌ها اسکرول افقی */
  .brands-grid, .stories-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ============================================================
   موبایل خیلی کوچک  (≤ 360px) - جلوگیری از خرد شدن گرید
   ============================================================ */
@media (max-width: 360px) {
  .products-grid-5,
  .products-grid,
  .woocommerce .products,
  .special-products,
  .trending-grid { gap: 8px !important; }
  .header-tools { gap: 6px; }
  .tool { width: 34px; height: 34px; }
}

/* ============================================================
   دسکتاپ بزرگ  (≥ 1400px) - کمی جادارتر
   ============================================================ */
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
}

/* دسترسی: ناحیه‌ی لمسی حداقلی برای عناصر تعاملی موبایل */
@media (max-width: 768px) {
  .tool, .mobile-tool, .floating-menu-btn, .mobile-toggle,
  .search-wrap button { min-width: 40px; min-height: 40px; }
}

/* =====================================================================
   بخش‌های «پیشنهاد ویژه شگفت‌انگیز» (top) و «تخفیف‌های ویژه امروز - بالای فوتر» (footer)
   پس‌زمینه جذاب و خوشگل یکسان
   (با !important تا استایل اینلاین شورت‌کد را بازنویسی کند)
   مهندس رسولی
   ===================================================================== */

.special-section.footer, .special-section.top{
  position:relative;
  /* گرادیان تیره‌ی چندلایه با ته‌رنگ برند */
  background:
    radial-gradient(1200px 340px at 88% -10%, rgba(227,180,101,.22), transparent 60%),
    radial-gradient(900px 300px at 5% 120%, rgba(230,138,0,.18), transparent 55%),
    linear-gradient(135deg, #241d13 0%, #1d1a17 40%, #14120f 100%) !important;
  background-size:200% 200%, 200% 200%, 100% 100% !important;
  animation:digisvgSpecialGlow 16s ease-in-out infinite !important;
  border-radius:18px !important;
  margin:22px 0 !important;
  padding:34px 0 46px !important;
  overflow:hidden !important;
  box-shadow:0 18px 50px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05) !important;
  border:1px solid rgba(227,180,101,.18) !important;
}

/* حذف روکش تیره‌ی قدیمی که همه‌چیز را صاف می‌کرد */
.special-section.footer::before, .special-section.top::before{
  content:'' !important;
  position:absolute !important;
  inset:0 !important;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 2px, transparent 2px 22px) !important;
  z-index:1 !important;
  opacity:.6;
  pointer-events:none;
}

/* نوار درخشان مورب پایین + هاله‌ی نور */
.special-section.footer::after, .special-section.top::after{
  content:'' !important;
  position:absolute;
  top:-60px; left:-40px;
  width:260px; height:260px;
  background:radial-gradient(circle, rgba(227,180,101,.35), transparent 70%);
  filter:blur(28px);
  border-radius:50%;
  z-index:1;
  pointer-events:none;
  animation:digisvgFloat 9s ease-in-out infinite;
}

.special-section.footer .container, .special-section.top .container{position:relative;z-index:3 !important}

/* نوار نازک درخشان لبه‌ی بالایی */
.special-section.footer .special-inner, .special-section.top .special-inner{position:relative}

/* کارت عنوان (سمت راست) - شیشه‌ای و درخشان */
.special-section.footer .special-info, .special-section.top .special-info{
  background:linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)) !important;
  border:1px solid rgba(227,180,101,.25);
  border-radius:16px;
  padding:22px 18px !important;
  backdrop-filter:blur(6px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}
.special-section.footer .special-info h3, .special-section.top .special-info h3{
  background:linear-gradient(90deg,#ffe9c2,#e3b465 55%,#eccd96);
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;
  text-shadow:0 2px 18px rgba(227,180,101,.25);
  font-weight:900 !important;
}
.special-section.footer .special-info p, .special-section.top .special-info p{color:#cfc4b2 !important}
.special-section.footer .special-info .btn-outline, .special-section.top .special-info .btn-outline{
  border:1px solid rgba(227,180,101,.6) !important;
  background:linear-gradient(135deg, rgba(227,180,101,.15), transparent) !important;
  color:#ffe9c2 !important;
  font-weight:700;
  transition:.25s !important;
}
.special-section.footer .special-info .btn-outline:hover, .special-section.top .special-info .btn-outline:hover{
  background:linear-gradient(135deg,#e3b465,#c99a4e) !important;
  color:#241d13 !important;
  border-color:#e3b465 !important;
  box-shadow:0 6px 18px rgba(227,180,101,.35) !important;
  transform:translateY(-2px);
}

/* کارت‌های محصول کمی برجسته‌تر روی زمینه‌ی جدید */
.special-section.footer .product-card-dark, .special-section.top .product-card-dark{
  box-shadow:0 6px 18px rgba(0,0,0,.25) !important;
  border:1px solid rgba(255,255,255,.04) !important;
}
.special-section.footer .product-card-dark:hover, .special-section.top .product-card-dark:hover{
  box-shadow:0 12px 28px rgba(227,180,101,.22) !important;
}
.special-section.footer .product-card-dark .badge, .special-section.top .product-card-dark .badge{
  background:linear-gradient(135deg,#ff5a5a,#e63946) !important;
  box-shadow:0 3px 10px rgba(230,57,70,.4);
}

@keyframes digisvgSpecialGlow{
  0%,100%{background-position:0% 50%, 100% 50%, 0 0}
  50%{background-position:100% 50%, 0% 50%, 0 0}
}
@keyframes digisvgFloat{
  0%,100%{transform:translateY(0) scale(1);opacity:.85}
  50%{transform:translateY(22px) scale(1.08);opacity:1}
}

/* روی موبایل سبک‌تر تا کارایی حفظ شود */
@media(max-width:768px){
  .special-section.footer, .special-section.top{padding:24px 0 34px !important;margin:16px 0 !important;border-radius:14px !important}
  .special-section.footer .special-info, .special-section.top .special-info{padding:14px 14px !important}
}
@media(prefers-reduced-motion:reduce){
  .special-section.footer, .special-section.top{animation:none !important}
  .special-section.footer::after, .special-section.top::after{animation:none !important}
}

/* رفع خط تزیینی که روی زیرنویس عنوان بخش‌ها می‌افتاد (section-header pro) */
.section-header.pro h2::after,
.section-header.pro h2::before,
.section-header.pro .section-title-wrap h2::after{
  display:none !important;
  content:none !important;
  background:none !important;
}

/* =====================================================================
   رفع دو مشکل: ۱) افتادن پاپ‌آپ سبد خرید پشت اسلایدر  ۲) هدر چسبان هنگام اسکرول
   مهندس رسولی
   ===================================================================== */

/* --- ۱) پاپ‌آپ مینی‌سبد بالای همه‌چیز --- */
/* هدر یک استکینگ‌کانتکست بالا بگیرد تا اجزای داخلش روی اسلایدر بیایند */
.header-main{position:relative;z-index:1001}
.header-tools{position:relative;z-index:1002}
.header-tools .cart-tool{position:relative;z-index:1003}
.mini-cart-dropdown{z-index:9999 !important}
/* دراپ‌داون نتایج جستجو هم روی اسلایدر */
.ajax-results{z-index:1500}
/* اسلایدر پایین‌تر از هدر بماند */
.hero-animated-wrapper,.hero-slider-section,.hero,.hero-animated-swiper,.hero-animated-wrapper .swiper{z-index:0}

/* --- ۲) هدر چسبان (fixed) تمیز و کامل --- */
.header-main.fixed{
  position:fixed;top:0;right:0;left:0;
  z-index:1001 !important;
  background:#fff !important;           /* پس‌زمینه‌ی تمام و مات به‌جای شفافِ محو */
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
  box-shadow:0 4px 20px rgba(0,0,0,.10) !important;
  padding:8px 0 !important;             /* کمی جمع‌وجورتر در حالت چسبان */
  will-change:transform;
}
.header-bottom.fixed{
  position:fixed;right:0;left:0;
  z-index:1000 !important;
  background:var(--secondary) !important;
  box-shadow:0 6px 18px rgba(0,0,0,.12) !important;
}
/* انیمیشن ورود فقط یک‌بار و نرم، بدون پرش هنگام اسکرول */
.header-main.fixed{animation:digisvgStickyDown .35s cubic-bezier(.22,.61,.36,1)}
@keyframes digisvgStickyDown{from{transform:translateY(-100%);opacity:.4}to{transform:translateY(0);opacity:1}}

/* روی موبایل هدرِ پایین مخفی است؛ نوار چسبان ساده بماند */
@media(max-width:768px){
  .header-bottom.fixed{display:none !important}
  .header-main.fixed{padding:8px 0 !important}
}
@media(prefers-reduced-motion:reduce){
  .header-main.fixed{animation:none !important}
}

/* =====================================================================
   اسلایدر تمام‌عرض (۱۰۰٪ عرض صفحه) - بدون حاشیه و گوشه‌ی گرد
   مهندس رسولی
   ===================================================================== */
.hero-section > .container{
  max-width:100% !important;
  width:100% !important;
  padding-inline:0 !important;
}
.hero-section .hero-animated-wrapper,
.hero-section .hero-animated-wrapper.simple{
  border-radius:0 !important;
  margin:0 !important;
  box-shadow:none !important;
  width:100% !important;
}
/* اسلایدها هم تمام‌عرض */
.hero-section .hero-anim-slide,
.hero-section .hero-anim-slide.simple{width:100% !important}
/* محتوای داخل اسلاید در یک عرض استاندارد وسط بماند تا متن به لبه نچسبد */
.hero-section .hero-anim-content,
.hero-section .hero-anim-content.simple{
  max-width:1240px;
  margin-inline:auto;
  padding-inline:20px;
}
@media(max-width:768px){
  .hero-section .hero-anim-content,
  .hero-section .hero-anim-content.simple{padding-inline:14px}
}

/* برنامه‌نویسی اختصاصی - مهندس رسولی */
