/* ===== MOBILE FIX COMPLETE ===== */
html { -webkit-text-size-adjust: 100%; }
body {
  overflow-x: hidden !important;
  max-width: 100vw;
}
img, video, iframe, svg, canvas {
  max-width: 100% !important;
  height: auto;
}
.container, .nav-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: border-box; }

/* Header mobile */
@media (max-width: 992px) {
  header {
    padding: 10px 0 !important;
    background: rgba(255,255,255,.97) !important;
  }
  .nav-container {
    padding: 0 14px !important;
    gap: 10px;
  }
  header nav { display: none !important; }
  .hamburger {
    display: flex !important;
    z-index: 1100;
    margin-right: auto;
    margin-left: 0;
  }
  .logo-text { font-size: 1rem !important; color: #0f172a !important; }
  .logo-icon { width: 40px !important; height: 40px !important; min-width: 40px !important; }
  .cart-nav-link, .user-nav-wrap { display: none !important; }
}

/* Mobile drawer */
.mobile-menu {
  position: fixed !important;
  top: 0 !important;
  right: -100% !important;
  width: min(320px, 88vw) !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
  z-index: 1200 !important;
  padding: 80px 22px 30px !important;
  transition: right .3s ease !important;
  overflow-y: auto !important;
  box-shadow: -10px 0 40px rgba(15,23,42,.12);
}
.mobile-menu.active { right: 0 !important; }
.mobile-menu ul {
  list-style: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.mobile-menu a {
  display: block !important;
  color: #0f172a !important;
  text-decoration: none !important;
  padding: 14px 12px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
}
.mobile-menu a:hover, .mobile-menu a:active {
  background: rgba(22,163,74,.12) !important;
  color: #16a34a !important;
}
.overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.55) !important;
  z-index: 1150 !important;
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}
.overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Hero */
@media (max-width: 992px) {
  .hero {
    min-height: auto !important;
    padding: 110px 16px 50px !important;
  }
  .hero-content, .hero-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
  }
  .hero-title, .page-hero-title {
    font-size: clamp(1.4rem, 6vw, 2rem) !important;
    line-height: 1.35 !important;
  }
  .hero-subtitle, .page-hero-subtitle {
    font-size: .95rem !important;
    line-height: 1.8 !important;
  }
  .hero-btns {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .hero-btns .btn { width: 100% !important; justify-content: center; }
  .page-hero { padding: 100px 16px 36px !important; }
}

/* Grids */
@media (max-width: 992px) {
  .products-grid,
  .pkg-grid,
  .services-grid,
  .awards-grid,
  .vid-grid,
  .warranty-grid,
  .cat-cards,
  .portfolio-photo-grid,
  .trust-row,
  .advantages-grid,
  .brand-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  .section { padding: 40px 0 !important; }
  .section-title { font-size: 1.35rem !important; }
  .container { padding-left: 14px !important; padding-right: 14px !important; }
}

@media (max-width: 640px) {
  .products-grid,
  .pkg-grid,
  .services-grid,
  .awards-grid,
  .vid-grid,
  .warranty-grid,
  .cat-cards,
  .portfolio-photo-grid,
  .trust-row,
  .advantages-grid,
  .brand-row {
    grid-template-columns: 1fr !important;
  }
  .product-card, .pkg-card, .service-card {
    max-width: 100% !important;
  }
  .filter-bar, .products-toolbar, .brand-filter-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .filter-bar select,
  .filter-bar input,
  .v5-search {
    width: 100% !important;
    max-width: 100% !important;
  }
  .footer-grid, .checkout-grid {
    grid-template-columns: 1fr !important;
  }
  .cta-box { padding: 24px 16px !important; text-align: center; }
  .btn { min-height: 44px; }
  table { display: block; overflow-x: auto; width: 100%; }
}

/* Product detail */
@media (max-width: 768px) {
  .pd-grid, .product-detail-grid {
    grid-template-columns: 1fr !important;
  }
  .pd-gallery img { max-height: 280px; object-fit: contain; }
}

/* Float buttons not covering content */
.whatsapp-float, .float-contact {
  bottom: 18px !important;
  left: 12px !important;
  right: auto !important;
  z-index: 900 !important;
}
#compareBar {
  left: 10px !important;
  right: 10px !important;
  width: auto !important;
}

/* Forms */
input, select, textarea, button {
  font-size: 16px !important; /* prevent iOS zoom */
  max-width: 100%;
}
.auth-box {
  margin: 16px !important;
  padding: 18px !important;
}

/* Hide preloader faster feel on mobile */
@media (max-width: 768px) {
  .preloader { transition: opacity .2s !important; }
}


/* FORCE PRODUCT VISIBLE */
.product-card, .product-card.reveal {
  opacity: 1 !important;
  transform: none !important;
}
.product-card.is-hidden {
  display: none !important;
}
#productsGrid {
  display: grid !important;
  min-height: 100px;
}
.preloader, .preloader.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.about-content,.about-image,.reveal-left,.reveal-right,.reveal{opacity:1!important;transform:none!important;visibility:visible!important}


.hamburger{display:none;cursor:pointer;padding:10px;z-index:1300;position:relative}
@media(max-width:992px){
  .hamburger{display:flex!important;flex-direction:column;gap:5px}
  .hamburger span{display:block;width:24px;height:2px;background:#0f172a;border-radius:2px}
  header nav{display:none!important}
}
.mobile-menu{z-index:1400!important}
.overlay{z-index:1350!important}
.mobile-menu.active{right:0!important}


/* MENU ALWAYS WORKS */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  z-index: 2000 !important;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #0f172a !important;
  border-radius: 2px;
}
@media (max-width: 992px) {
  header .nav-container nav { display: none !important; }
  .hamburger { display: flex !important; }
}
.mobile-menu {
  position: fixed !important;
  top: 0 !important;
  right: -110% !important;
  width: min(300px, 85vw) !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
  z-index: 2100 !important;
  padding: 70px 18px 24px !important;
  transition: right .28s ease !important;
  overflow-y: auto !important;
}
.mobile-menu.active { right: 0 !important; }
.overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.5) !important;
  z-index: 2050 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: .2s;
}
.overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
body.menu-open { overflow: hidden !important; }


/* DIGIKALA CARDS */
.products-grid, #homeProductsGrid, #productsGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
@media (min-width: 900px) {
  .products-grid, #homeProductsGrid, #productsGrid {
    grid-template-columns: repeat(var(--product-cols, 3), minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}
.product-card, .dk-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 12px rgba(15,23,42,.06) !important;
  flex-direction: column !important;
  opacity: 1 !important;
  transform: none !important;
  position: relative;
}
.product-card:not(.is-hidden), .dk-card:not(.is-hidden) {
  display: flex !important;
}
.product-card.is-hidden, .dk-card.is-hidden {
  display: none !important;
}
.dk-card a.dk-link { text-decoration: none; color: inherit; display: block; flex: 1; }
.dk-img {
  height: 140px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  overflow: hidden;
}
.dk-img img { width: 100%; height: 100%; object-fit: contain; }
.dk-body { padding: 10px 10px 8px; }
.dk-title {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.55;
  height: 2.6em;
  overflow: hidden;
  color: #0f172a;
  margin: 0 0 8px;
}
.dk-price {
  font-size: .95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}
.dk-price small { font-size: .75rem; font-weight: 600; color: #64748b; }
.dk-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef394e;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  z-index: 2;
}
.dk-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}
.dk-actions .btn {
  flex: 1;
  padding: 8px 6px !important;
  font-size: .78rem !important;
  min-height: 36px;
  border-radius: 8px !important;
}
.dk-cart-btn {
  background: #16a34a !important;
  color: #fff !important;
  border: 0 !important;
}
@media (max-width: 640px) {
  .dk-img { height: 120px; }
  .dk-title { font-size: .78rem; }
  .section { padding: 28px 0 !important; }
  .hero { padding-bottom: 30px !important; }
}

/* صفحه محصول دیجی‌کالاوار */
.pd-reviews { margin-top: 28px; background:#fff; border-radius:16px; padding:18px; border:1px solid #eee; }
.pd-reviews h3 { margin:0 0 14px; font-size:1.05rem; }
.rev-item { border-bottom:1px solid #f1f5f9; padding:12px 0; }
.rev-item:last-child { border-bottom:0; }
.rev-stars { color:#f59e0b; letter-spacing:1px; margin-bottom:6px; }
.rev-name { font-weight:700; font-size:.9rem; }
.rev-text { color:#475569; font-size:.9rem; line-height:1.8; margin-top:6px; }
.pd-score-box { display:flex; gap:16px; align-items:center; background:#f8fafc; border-radius:12px; padding:14px; margin-bottom:14px; }
.pd-score-num { font-size:2rem; font-weight:900; color:#0f172a; }


/* ===== PRO POLISH (Digikala + Faragostar inspired) ===== */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 8px;
}
.trust-strip .t {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  font-size: .82rem;
  font-weight: 700;
  color: #0f172a;
}
.trust-strip .t span { display:block; font-size:1.4rem; margin-bottom:6px; }
.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 6px;
}
.brand-chips a {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1800;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0,0,0,.08);
}
.mobile-tabbar a {
  text-decoration: none;
  color: #64748b;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  padding: 6px 2px;
}
.mobile-tabbar a .i { display:block; font-size:1.15rem; margin-bottom:2px; }
.mobile-tabbar a.active { color: #0f172a; }
body.has-tabbar { padding-bottom: 72px; }
@media (max-width: 992px) {
  .mobile-tabbar { display: grid; }
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .whatsapp-float, .float-contact { bottom: 78px !important; }
}
@media (min-width: 993px) {
  .mobile-tabbar { display: none !important; }
  body.has-tabbar { padding-bottom: 0; }
}
.section-soft { background: #f8fafc; }
.pro-divider { height: 1px; background: #eef2f7; margin: 8px 0; }

/* HEADER_MOBILE_LIGHT */
@media (max-width: 992px) {
  header, header.scrolled {
    background: rgba(255,255,255,.97) !important;
  }
  header .logo-text { color: #0f172a !important; }
}


/* ===== MOBILE HEADER NUCLEAR FIX ===== */
html, body {
  background: #f8fafc !important;
}
body > header,
header,
header.scrolled,
header.scrolled.scrolled {
  background: rgba(255,255,255,.97) !important;
  background-color: rgba(255,255,255,.97) !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(226,232,240,.9) !important;
  box-shadow: 0 4px 20px rgba(15,23,42,.08) !important;
  color: #0f172a !important;
}
header .nav-container {
  background: transparent !important;
  position: relative !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
}
header .logo-text,
header.scrolled .logo-text,
header .logo-text span {
  color: #0f172a !important;
}
header nav a {
  color: #1e293b !important;
}
header nav a.active {
  color: #16a34a !important;
}
header .hamburger {
  position: relative !important;
  z-index: 3010 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  padding: 8px !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}
header .hamburger span {
  background: #0f172a !important;
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  border-radius: 2px !important;
}
header .cart-nav-link,
header .user-nav-btn,
header .user-nav-label {
  color: #0f172a !important;
}

/* فاصله محتوا زیر هدر ثابت — همه صفحات (نه فقط hero) */
.hero, .page-hero {
  padding-top: 88px !important;
}
@media (max-width: 992px) {
  header {
    padding: 8px 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 3000 !important;
    min-height: 56px !important;
  }
  /* صفحات بدون hero مثل ثبت‌نام / ورود / سبد */
  main,
  main.section,
  body > .section,
  body > main {
    padding-top: 72px !important;
  }
  .section {
    padding-top: 72px !important;
    padding-bottom: 40px !important;
  }
  /* باکس‌های ورود و ثبت‌نام */
  .auth-box {
    margin: 12px auto 24px !important;
    padding: 22px 18px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .auth-box h1 {
    font-size: 1.35rem !important;
    line-height: 1.4 !important;
    margin: 0 0 10px !important;
    color: #0f172a !important;
    position: relative !important;
    z-index: 1 !important;
  }
  .logo-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: #ffffff !important;
  }
  .logo-text {
    font-size: .95rem !important;
    max-width: 42vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .mobile-tabbar {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
  }
}

/* دسکتاپ / ویندوز: فاصله کافی زیر هدر ثابت */
@media (min-width: 993px) {
  main.section,
  body > main,
  body > .section {
    padding-top: 100px !important;
  }
  .auth-box {
    margin-top: 20px !important;
  }
}


/* تماس شناور همیشه روی موبایل دیده شود */
.float-contact {
  position: fixed !important;
  left: 12px !important;
  bottom: 78px !important;
  z-index: 9700 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  pointer-events: auto !important;
}
.float-btn {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.35rem !important;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.28) !important;
}
.float-btn.call { background: #0f172a !important; color: #fff !important; }
.float-btn.wa { background: #25d366 !important; color: #fff !important; }
#aiFab { bottom: 200px !important; z-index: 9800 !important; }
#aiPanel { bottom: 260px !important; z-index: 9801 !important; }
@media (min-width: 993px) {
  .float-contact { bottom: 18px !important; }
  #aiFab { bottom: 150px !important; }
  #aiPanel { bottom: 210px !important; }
}
