/* ============================================
   TECH4.ONE — Responsive Styles
   Font: Vazirmatn | RTL | Lime-Yellow Phosphorescent
   Breakpoints: 768px (tablet), 1024px (desktop)
   ============================================ */

:root {
  --lime:       #FF6A00;
  --lime-dk:    #F55E00;
  --lime-dkk:   #E85200;
  --lime-lt:    #FF8533;
  --lime-bg:    #FFF0E6;
  --lime-glow:  0 4px 20px rgba(255,106,0,0.38);

  --white:      #ffffff;
  --gray-lt:    #f5f5f5;
  --gray:       #e0e0e0;
  --gray-md:    #999999;
  --gray-dk:    #555555;
  --black:      #1a1a1a;
  --red:        #e53935;
  --orange:     #FF6600;

  --header-h:      58px;
  --header-h-desk: 68px;
  --catbar-h:      46px;
  --bottom-h:      62px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.12);
  --max-w:         1320px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  direction: rtl;
  background: #ebebeb;
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { border: none; cursor: pointer; background: none; font-family: inherit; }

/* ===== LAYOUT WRAPPER ===== */
.page-wrap {
  width: 100%;
  background: var(--white);
  min-height: 100vh;
  position: relative;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--lime);
  box-shadow: 0 2px 8px rgba(232,82,0,0.35);
}

/* Mobile header row */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 14px;
  gap: 10px;
}

/* آیکون‌های هدر روی پس‌زمینه نارنجی */
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 18px;
  border-radius: 8px;
  transition: background .2s;
  flex-shrink: 0;
}
.icon-btn:active, .icon-btn:hover { background: rgba(255,255,255,0.18); }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-glow {
  display: inline-block;
  line-height: 0;
}
.logo-img {
  height: 60px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(255,255,255,0.45));
}
.header-slogan {
  display: none;
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Desktop header extras (hidden on mobile) */
.header-desk-search { display: none; }
.header-desk-icons  { display: none; }

/* Search Bar (mobile dropdown) */
.search-bar {
  display: none;
  background: var(--lime-dk);
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.search-bar.open { display: block; }
.search-inner {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 24px;
  padding: 0 14px;
  gap: 10px;
}
.search-inner i { color: var(--gray-md); font-size: 14px; }
.search-inner input {
  flex: 1; border: none; outline: none;
  font-family: inherit; font-size: 14px;
  padding: 10px 0; background: transparent; direction: rtl;
}
.search-close { color: var(--gray-md); font-size: 16px; padding: 4px; }

/* Desktop Category Nav Bar */
.cat-nav-bar {
  display: none;
  background: var(--lime-dkk);
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative;
  z-index: 200;
}
.cat-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: var(--catbar-h);
  padding: 0 20px;
  gap: 4px;
  overflow-x: auto;
  overflow-y: visible;
  flex: 1;
  min-width: 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-scroll-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background .2s;
  padding: 0;
}
.cat-scroll-btn:hover { background: rgba(255,255,255,0.3); }
.cat-scroll-btn.visible { display: flex; }


.cat-nav-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}
.cat-nav-item {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 7px;
  color: rgba(255,255,255,0.9);
  font-size: 11.5px;
  white-space: nowrap;
  border-radius: 6px;
  transition: background .2s;
  flex-shrink: 0;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.cat-nav-item:hover,
.cat-nav-wrap:hover .cat-nav-item { background: rgba(255,255,255,0.15); color: var(--white); }
.cat-nav-item i { font-size: 12px; }
.cat-nav-arrow { font-size: 9px !important; opacity: 0.7; transition: transform .2s; margin-right: 2px; }
.cat-nav-wrap:hover .cat-nav-arrow { transform: rotate(180deg); }

/* ===== MEGA MENU DROPDOWN ===== */
.cat-nav-dropdown {
  display: none;
  position: fixed;


  width: 400px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  border-top: 3px solid var(--lime);
  padding: 14px;
  z-index: 9999;
  animation: megaFadeIn .18s ease;
}
@keyframes megaFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cat-nav-wrap:hover .cat-nav-dropdown,
.cat-nav-wrap.open .cat-nav-dropdown { display: block; }
.cat-nav-wrap.open .cat-nav-arrow { transform: rotate(180deg); }

/* "همه X" button at top */
.mega-all-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px; margin-bottom: 12px;
  background: var(--lime-bg); border: none; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--lime-dk); cursor: pointer; transition: all .2s;
  text-align: right;
}
.mega-all-btn:hover { background: var(--lime); color: var(--white); }
.mega-all-btn i { font-size: 14px; }

/* Grid of category cards */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Each card */
.mega-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 10px 6px 8px;
  border: 1.5px solid var(--gray); border-radius: 10px;
  background: none; font-family: inherit; cursor: pointer;
  transition: all .2s; text-align: center;
}
.mega-card:hover {
  border-color: var(--lime); background: var(--lime-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,106,0,0.15);
}

/* Card icon circle */
.mega-card-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--gray-lt);
  overflow: hidden; flex-shrink: 0;
}
.mega-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.mega-card-icon i { font-size: 22px; color: var(--lime); }
.mega-card:hover .mega-card-icon { background: rgba(255,106,0,0.12); }

/* Card label */
.mega-card-name {
  font-size: 11.5px; font-weight: 600; color: var(--black); line-height: 1.3;
}
.mega-card:hover .mega-card-name { color: var(--lime-dk); }

/* Grandchild sub-tags inside card */
.mega-card-subs {
  display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 2px;
}
.mega-sub-item {
  font-size: 10px; color: var(--gray-dk);
  background: var(--gray); border-radius: 4px;
  padding: 2px 6px; cursor: pointer; border: none;
  font-family: inherit; transition: all .15s;
}
.mega-sub-item:hover { background: var(--lime); color: var(--white); }

/* ============================================================
   SIDE MENU (mobile)
   ============================================================ */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1100;
  backdrop-filter: blur(2px);
}
.overlay.open { display: block; }

.side-menu {
  position: fixed;
  top: 0; right: -110%;
  width: min(82vw, 320px);
  height: 100%;
  background: var(--white);
  z-index: 1200;
  overflow-y: auto;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
}
.side-menu.open { right: 0; }

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--lime-dkk), var(--lime));
  position: sticky; top: 0;
}
.logo-side { font-size: 17px; font-weight: 800; color: var(--white); letter-spacing: 1px; }
.close-menu { color: var(--white); font-size: 20px; padding: 4px 8px; }

.menu-list { padding: 6px 0; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--gray);
  cursor: pointer;
  font-size: 14px;
  color: var(--black);
  transition: background .15s;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}
.menu-item span, .menu-item i { -webkit-user-drag: none; }
.menu-item:active { background: var(--gray-lt); }
.menu-item i { color: var(--gray-md); font-size: 12px; transition: transform .2s; }
.menu-item.active i { transform: rotate(-90deg); color: var(--lime); }

.sub-menu { display: none; background: var(--gray-lt); }
.sub-menu.open { display: block; }
.sub-menu li a {
  display: block;
  padding: 10px 34px;
  font-size: 13px;
  color: var(--gray-dk);
  border-bottom: 1px solid var(--gray);
}
.sub-menu li:last-child a { border-bottom: none; }
.sub-menu li a:hover { background: var(--lime-bg); color: var(--lime); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content { background: var(--gray-lt); }

/* ============================================================
   HERO SLIDER
   ============================================================ */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--black);
  aspect-ratio: 1600 / 450;
  max-height: 600px;
  min-height: 120px;
  height: auto;
}
.hero-slider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, rgba(0,0,0,0.35));
  pointer-events: none;
  z-index: 5;
}

.slider-wrapper {
  display: flex;
  direction: ltr; /* force LTR so translateX(-N*100%) works correctly in RTL pages */
  height: 100%;
  transition: transform .45s ease;
}

.slide {
  direction: rtl; /* restore RTL for content inside each slide */
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}



.slide-content { flex: 1; z-index: 2; }
.slide-content h2 {
  font-size: 20px; font-weight: 700;
  color: var(--white); margin-bottom: 8px; line-height: 1.3;
}
.slide-content p {
  font-size: 13px; color: rgba(255,255,255,0.8); margin-bottom: 16px;
}
.slide-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--lime), var(--lime-lt));
  color: var(--white);
  padding: 9px 24px;
  border-radius: 22px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--lime-glow);
}

.slide-img {
  flex-shrink: 0; width: 130px; height: 130px;
  display: flex; align-items: center; justify-content: center;
}
.slide-img-placeholder { font-size: 68px; opacity: 0.6; }

.slider-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; z-index: 10;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.35); cursor: pointer; transition: all .2s;
}
.dot.active { background: var(--lime); width: 22px; border-radius: 4px; }

/* ============================================================
   QUICK CATEGORIES
   ============================================================ */
.quick-cats {
  background: var(--white);
  padding: 20px 16px;
  margin-bottom: 8px;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.cat-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.cat-icon {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--lime-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--lime);
  border: 2px solid rgba(255,106,0,0.25);
  transition: all .2s;
}
.cat-item:hover .cat-icon, .cat-item:active .cat-icon {
  background: var(--lime); color: var(--white);
  border-color: var(--lime); box-shadow: var(--lime-glow);
}
.cat-item span {
  font-size: 11.5px; color: var(--gray-dk);
  text-align: center; line-height: 1.3;
}

/* ============================================================
   BRANDS SECTION
   ============================================================ */
.brands-section {
  background: var(--white);
  padding: 0 0 16px;
  margin-bottom: 8px;
  overflow: hidden;
}

.verified-badge {
  background: linear-gradient(135deg, var(--lime-dkk), var(--lime));
  display: flex;
  align-items: center; justify-content: center;
  gap: 8px; padding: 14px;
  color: var(--white); font-size: 15px; font-weight: 600;
  margin-bottom: 16px;
}
.verified-badge i { font-size: 18px; }

.brands-scroll { overflow: hidden; padding: 0 16px; }
.brands-track {
  display: flex; gap: 14px;
  animation: brandScroll 20s linear infinite;
  width: max-content;
}
.brands-track:hover { animation-play-state: paused; }
@keyframes brandScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.brand-logo {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 12px; font-weight: 700;
  color: var(--gray-dk); white-space: nowrap;
  box-shadow: var(--shadow); min-width: 85px; text-align: center;
  transition: border-color .2s, color .2s;
}
.brand-logo:hover { border-color: var(--lime); color: var(--lime); }

/* ============================================================
   PRODUCTS SECTION
   ============================================================ */
.products-section {
  background: var(--white);
  padding: 18px 16px;
  margin-bottom: 8px;
}

.section-title {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; position: relative;
}
.section-title::before, .section-title::after {
  content: ''; flex: 1; height: 2px; background: var(--gray);
}
.section-title span {
  padding: 0 16px; font-size: 17px; font-weight: 700;
  color: var(--black); white-space: nowrap;
}
.section-title-line {
  display: flex; align-items: center;
  justify-content: center; margin-bottom: 6px;
}
.section-title-line span {
  font-size: 17px; font-weight: 700; color: var(--black);
  border-bottom: 3px solid var(--lime); padding-bottom: 5px;
}

.view-all {
  display: block; color: var(--lime);
  font-size: 13px; font-weight: 500; margin-bottom: 14px;
}

/* Products Grid — 2 col mobile → 3 tablet → 4 desktop */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  position: relative;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}
.product-card img { -webkit-user-drag: none; }
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-img-wrap { background: #fff; padding: 10px; position: relative; }
/* ===== Product card share button ===== */
.btn-card-share {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  font-size: 13px;
  color: #555;
  box-shadow: 0 1px 5px rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity .2s, background .2s, color .2s;
  padding: 0;
}
.product-img-wrap:hover .btn-card-share,
.btn-card-share:focus {
  opacity: 1;
}
@media (hover: none) {
  .btn-card-share { opacity: 1; }
}
.btn-card-share:hover {
  background: #3b82f6;
  color: #fff;
}

.product-img {
  aspect-ratio: 4/3;
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.product-img img { width: 100%; height: 100%; object-fit: contain; }

.product-info {
  padding: 10px 12px 12px; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}
.product-name {
  font-size: 12.5px; color: var(--gray-dk); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-price {
  display: flex; align-items: baseline;
  gap: 4px; flex-wrap: wrap; margin-top: auto;
}
.price-val  { font-size: 15px; font-weight: 700; color: var(--black); }
.price-cur  { font-size: 11px; color: var(--gray-md); }
.price-old  { font-size: 12px; color: var(--gray-md); text-decoration: line-through; }

.badge-new-tag {
  position: absolute; top: 6px; left: 6px;
  background: #22c55e; color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 8px; z-index: 3;
  white-space: nowrap; line-height: 1.4;
}

/* ============================================================
   BANNER CATEGORIES
   ============================================================ */
.banner-cats {
  padding: 0 0 8px;
  background: var(--gray-lt);
  display: flex; flex-direction: column; gap: 0;
}
.banner-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #ebebeb;
}
.banner-item {
  display: block;
  position: relative;
  padding: 0;
  background: #1a1a2e;
  overflow: hidden;
  border: 2px solid var(--white);
  transition: opacity .2s;
  min-height: 80px;           /* fallback when no image loaded */
}
.banner-item .banner-bg-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}
.banner-item:hover { opacity: 0.92; }
.banner-item.dark-blue  { background: linear-gradient(135deg, #0d1b4b, #1a3a8e); }
.banner-item.dark-img   { background: linear-gradient(135deg, #0a0a1a, #1a1a3e); }
.banner-item.pool-bg    { background: linear-gradient(135deg, #e8f4f8, #b3d9f0); }
.banner-item.motor-bg   { background: linear-gradient(135deg, #f5f0e8, #ffe0c0); }
.banner-item.banner-wide { }  /* Wide — natural ratio from image */

.banner-label {
  position: absolute; bottom: 16px; right: 16px;
  color: var(--white); font-size: 15px; font-weight: 700;
  line-height: 1.3; text-shadow: 0 1px 4px rgba(0,0,0,0.5); z-index: 2;
  max-width: 80%; pointer-events: none;
}
/* Position variants */
.banner-label[data-pos="top-right"]     { top: 16px; right: 16px; bottom: auto; left: auto; }
.banner-label[data-pos="top-center"]    { top: 16px; left: 50%; bottom: auto; right: auto; transform: translateX(-50%); text-align: center; }
.banner-label[data-pos="top-left"]      { top: 16px; left: 16px; bottom: auto; right: auto; }
.banner-label[data-pos="bottom-right"]  { bottom: 16px; right: 16px; top: auto; left: auto; }
.banner-label[data-pos="bottom-center"] { bottom: 16px; left: 50%; top: auto; right: auto; transform: translateX(-50%); text-align: center; }
.banner-label[data-pos="bottom-left"]   { bottom: 16px; left: 16px; top: auto; right: auto; }
/* Color variants */
.banner-label[data-color="black"]  { color: #1a1a1a; text-shadow: 0 1px 3px rgba(255,255,255,0.6); }
.banner-label[data-color="white"]  { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.55); }
.banner-label[data-color="orange"] { color: #FF6A00; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.banner-label[data-color="red"]    { color: #e53935; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.banner-label-lg { font-size: 20px; color: var(--lime); text-shadow: none; }
.pool-bg .banner-label-lg { color: var(--gray-dk); }
.motor-bg .banner-label-lg { color: var(--orange); }

.banner-img-placeholder {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  font-size: 52px; opacity: 0.6;
}

/* ============================================================
   SUBCATS GRID 2×2
   ============================================================ */
.subcats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.subcat-card {
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  overflow: hidden; background: var(--white);
  display: flex; flex-direction: column; align-items: center;
  transition: box-shadow .2s;
}
.subcat-card:hover { box-shadow: var(--shadow-md); }
.subcat-img {
  width: 100%; aspect-ratio: 4/3;
  overflow: hidden; background: var(--gray-lt);
}
.subcat-img.orange-bg { background: var(--lime); }
.subcat-img.dark-bg   { background: #222; }
.subcat-img img { width: 100%; height: 100%; object-fit: cover; }
.subcat-card span {
  font-size: 12px; color: var(--gray-dk);
  padding: 10px 8px; text-align: center; line-height: 1.4;
}

/* ============================================================
   FEATURED CATS (circles)
   ============================================================ */
.featured-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; padding: 4px 0;
}
.feat-cat {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.feat-cat-circle {
  /* Responsive: fills column width, capped at 97px */
  width: clamp(60px, calc((100vw - 64px) / 3), 97px);
  height: clamp(60px, calc((100vw - 64px) / 3), 97px);
  border-radius: 50%;
  background: var(--gray-lt);
  border: 2px solid var(--gray);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}
.feat-cat:hover .feat-cat-circle {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(255,106,0,0.18);
}
.feat-cat-circle img { width: 100%; height: 100%; object-fit: cover; }
.feat-cat-icon-bg { background: var(--lime-bg); }
.feat-cat-fa { font-size: 28px; color: var(--lime); }
.feat-cat span { font-size: 12px; color: var(--gray-dk); text-align: center; line-height: 1.3; }

/* ============================================================
   CATEGORY PRODUCTS SECTION
   ============================================================ */
.cat-section {
  background: var(--white);
  padding: 16px 16px 20px;
  margin-bottom: 8px;
}
.cat-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--lime);
}
.cat-section-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--lime);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--lime);
  border-radius: 20px;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.cat-section-back:hover { background: var(--lime); color: var(--white); }
.cat-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
}
.cat-section-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-md);
}
.cat-section-empty i { font-size: 40px; margin-bottom: 10px; display: block; }
.cat-section-empty p { font-size: 14px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: #0d0d1a;
  color: var(--white);
  padding: 28px 20px calc(var(--bottom-h) + 20px);
  text-align: center;
  margin-top: 8px;
}
.footer-logo {
  font-size: 24px; font-weight: 800;
  letter-spacing: 2px; margin-bottom: 10px;
  direction: ltr; display: block;
}
.fl-tech { color: #0A468E; }
.fl-four { color: #0A468E; }
.fl-one  { color: #FEC728; text-shadow: 0 0 18px rgba(254,199,40,0.85), 0 0 6px rgba(254,199,40,0.6); }
.footer-desc {
  font-size: 13px; color: rgba(255,255,255,0.65); margin-bottom: 18px;
}
.footer-links {
  display: flex; justify-content: center;
  flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px;
}
.footer-links a {
  font-size: 13px; color: rgba(255,255,255,0.75);
  transition: color .2s;
}
.footer-links a:hover { color: var(--lime); }
.footer-copy { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ============================================================
   BOTTOM NAV (mobile only)
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: linear-gradient(135deg, var(--lime-dk), var(--lime));
  border-top: none;
  display: flex; align-items: center;
  justify-content: space-around;
  z-index: 900;
  box-shadow: 0 -2px 16px rgba(255,106,0,0.35);
}
.bottom-nav-item {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px;
  color: rgba(255,255,255,0.85); font-size: 20px;
  border-radius: 50%; transition: all .2s;
}
.bottom-nav-item:hover, .bottom-nav-item:active {
  color: var(--white); background: rgba(255,255,255,0.18);
}
.bottom-nav-cart {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.cart-btn {
  width: 60px; height: 60px;
  background: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--lime-dk); font-size: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  margin-top: -22px;
  border: 3px solid var(--lime-lt);
  transition: transform .2s;
}
.cart-btn:active { transform: scale(0.94); }

.cart-badge {
  position: absolute; top: -2px; left: -2px;
  background: var(--red); color: var(--white);
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  border: 2px solid var(--white);
}
.cart-badge.show { display: flex; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--gray-lt); }
::-webkit-scrollbar-thumb { background: rgba(255,106,0,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--lime); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.products-section, .quick-cats, .brands-section, .banner-cats {
  animation: fadeUp .35s ease;
}

/* ============================================================
   TABLET — 768px+
   ============================================================ */
@media (min-width: 768px) {
  body { padding-bottom: 0; }

  /* Header: show inline search, hide mobile search toggle */
  .header-inner {
    height: var(--header-h-desk);
    padding: 0 24px;
    gap: 14px;
  }
  /* Hide mobile search toggle on desktop, show inline */
  #searchToggle { display: none; }

  /* لوگو سمت چپ در دسکتاپ (RTL: order بالاتر = سمت چپ) */
  .logo { order: 3; align-items: center; }
  .header-desk-search { order: 2; }
  .header-desk-icons  { order: 1; }

  .header-desk-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 28px;
    padding: 0 16px;
    gap: 10px;
    flex: 1;
    max-width: 520px;
    backdrop-filter: blur(4px);
  }
  .header-desk-search i { color: rgba(255,255,255,0.85); font-size: 15px; }
  .header-desk-search input {
    flex: 1; border: none; outline: none;
    background: transparent; color: var(--white);
    font-family: inherit; font-size: 14px;
    padding: 10px 0; direction: rtl;
  }
  .header-desk-search input::placeholder { color: rgba(255,255,255,0.65); }

  /* آیکون‌های دسکتاپ سمت راست */
  .header-desk-icons {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .desk-icons-row {
    display: flex; align-items: center; gap: 4px;
  }
  .header-slogan { display: block; }
  .header-desk-icons .icon-btn { color: var(--white); position: relative; }
  .header-desk-icons .icon-btn:hover { background: rgba(255,255,255,0.18); }
  .header-desk-icons .cart-count {
    position: absolute; top: 4px; left: 4px;
    background: var(--red); color: var(--white);
    font-size: 9px; font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: none;
    align-items: center; justify-content: center;
  }
  .header-desk-icons .cart-count.show { display: flex; }

  /* Show desktop category nav bar */
  .cat-nav-bar { display: flex; align-items: center; padding: 0 10px; }

  /* Hide mobile hamburger */
  #menuToggle { display: none; }

  /* Hide mobile bottom nav */
  .bottom-nav { display: none; }

  /* Mobile search bar */
  .search-bar { display: none !important; }

  .slide-content h2 { font-size: 26px; }
  .slide-img { width: 200px; height: 200px; }
  .slide-img-placeholder { font-size: 100px; }

  /* Categories: 6 per row */
  .cats-grid { grid-template-columns: repeat(6, 1fr); }

  /* Products: 3 columns */
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .subcats-grid  { grid-template-columns: repeat(4, 1fr); gap: 14px; }

  /* Featured cats: 6 per row */
  .featured-cats { grid-template-columns: repeat(6, 1fr); gap: 12px; }
  .feat-cat-circle {
    /* (viewport - 32px padding - 5×12px gaps) / 6 columns, capped at 109px */
    width: clamp(72px, calc((100vw - 92px) / 6), 109px);
    height: clamp(72px, calc((100vw - 92px) / 6), 109px);
  }

  /* Banner grid */
  .banner-grid-2 { grid-template-columns: 1fr 1fr; }
  /* banner-item: no fixed aspect-ratio — natural image ratio used */
  .banner-label { font-size: 17px; }
  .banner-label-lg { font-size: 24px; }

  /* Footer */
  .footer { padding: 40px 40px 28px; }
  .footer-links { gap: 8px 28px; }
}

/* ============================================================
   DESKTOP — 1024px+
   ============================================================ */
@media (min-width: 1024px) {
  /* Max width container */
  .page-wrap { box-shadow: none; }

  .header-inner { padding: 0 32px; }

  /* Logo larger */
  .logo-tech { font-size: 20px; }
  .logo-four { font-size: 22px; }
  .logo-one  { font-size: 20px; }

  .slide { padding: 40px 60px; }
  .slide-content h2 { font-size: 32px; margin-bottom: 12px; }
  .slide-content p  { font-size: 16px; margin-bottom: 22px; }
  .slide-btn { padding: 12px 32px; font-size: 15px; border-radius: 26px; }
  .slide-img { width: 260px; height: 260px; }
  .slide-img-placeholder { font-size: 130px; }

  /* Products: 4 columns */
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .product-name { font-size: 13px; }
  .price-val { font-size: 16px; }

  /* Subcats: 4 columns */
  .subcats-grid { grid-template-columns: repeat(4, 1fr); }

  /* Section titles larger */
  .section-title span  { font-size: 19px; }
  .section-title-line span { font-size: 19px; }

  /* Banner taller */
  /* banner 16/9 from 768px+ applies here too */
  /* banner-wide 16/5 from 768px+ applies here too */
  .banner-label-lg { font-size: 28px; }

  /* Brands track gap */
  .brands-track { gap: 18px; }
  .brand-logo { padding: 12px 22px; font-size: 13px; }

  /* Cat icons larger */
  .cat-icon { width: 72px; height: 72px; font-size: 28px; }
  .cat-item span { font-size: 13px; }

  /* Padding */
  .quick-cats    { padding: 28px 32px; }
  .products-section { padding: 24px 32px; }

  .footer { padding: 50px 60px 32px; }
  .footer-logo { font-size: 28px; }
}

/* ============================================================
   TABLET MEGA MENU — 768px–1023px
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .cat-nav-dropdown { width: 300px; padding: 10px; }
  .mega-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .mega-card { padding: 8px 4px 6px; }
  .mega-card-icon { width: 38px; height: 38px; }
  .mega-card-name { font-size: 11px; }
  .cat-nav-item { font-size: 11px; padding: 4px 6px; gap: 3px; }
  .cat-nav-inner { gap: 2px; }
}

/* ============================================================
   LARGE DESKTOP — 1280px+
   ============================================================ */
@media (min-width: 1280px) {
  .cats-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
  .featured-cats { grid-template-columns: repeat(6, 1fr); gap: 20px; }
  .feat-cat-circle { width: 121px; height: 121px; }
}

/* ============================================================
   SMALL MOBILE — 340px-
   ============================================================ */
@media (max-width: 340px) {
  .cats-grid { gap: 8px; }
  .cat-icon { width: 50px; height: 50px; font-size: 18px; }
  .feat-cat-circle { width: 70px; height: 70px; }
  .products-grid { gap: 8px; }
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.product-card-skeleton {
  background: var(--gray-lt);
  border-radius: var(--radius);
  height: 240px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Discount badge on product cards */
.product-discount-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 3;
  line-height: 1.4;
}
.price-old-api {
  font-size: 12px;
  color: var(--gray-md);
  text-decoration: line-through;
  margin-left: 4px;
}

/* ===== STOCK & CART ===== */
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 6px;
}
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.stock-in {
  background: #e8f5e9;
  color: #2e7d32;
}
.stock-out {
  background: #ffebee;
  color: #c62828;
}
.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--lime);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-add-cart:hover { background: var(--lime-dk); }
.btn-out-of-stock {
  background: var(--gray) !important;
  color: var(--gray-md) !important;
  cursor: not-allowed !important;
}
.product-out-of-stock .product-img { opacity: 0.55; }

/* ============================================================
   CART SIDEBAR
   ============================================================ */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1100; opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed; top: 0; left: -100%; width: 340px; max-width: 100vw;
  height: 100dvh; background: #fff; z-index: 1101;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transition: left .3s cubic-bezier(.4,0,.2,1);
}
.cart-sidebar.open { left: 0; }

.cart-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--gray);
  font-size: 16px; font-weight: 700; color: var(--black);
}
.cart-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--gray-dk);
  transition: background .2s;
}
.cart-close:hover { background: var(--gray-lt); }

.cart-items {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.cart-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: var(--gray-md); padding: 40px 0;
}
.cart-empty i { font-size: 48px; opacity: .4; }
.cart-empty p { font-size: 14px; }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--gray-lt); border-radius: var(--radius);
  padding: 10px; position: relative;
}
.cart-item-img {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 6px; background: var(--gray); flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 12px; font-weight: 600; color: var(--black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.cart-item-price { font-size: 12px; color: var(--lime); font-weight: 700; }
.cart-item-controls {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
}
.qty-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--black);
  cursor: pointer; transition: background .2s;
}
.qty-btn:hover { background: var(--lime); color: #fff; border-color: var(--lime); }
.qty-val { font-size: 13px; font-weight: 700; min-width: 20px; text-align: center; }
.cart-item-remove {
  position: absolute; top: 6px; left: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer;
}

.cart-footer {
  border-top: 1px solid var(--gray); padding: 14px;
}
.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 700; margin-bottom: 12px;
}
#cartTotal { color: var(--lime); font-size: 16px; }

.payment-info-box {
  background: #fff8f0; border: 1px solid #ffd6a0;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px;
}
.payment-info-title {
  font-size: 13px; font-weight: 700; color: var(--lime-dk);
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.payment-card-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; margin-bottom: 6px; flex-wrap: wrap;
}
.payment-card-label { color: var(--gray-dk); white-space: nowrap; }
.payment-card-num {
  font-family: monospace; font-size: 14px; font-weight: 700;
  letter-spacing: 1px; color: #1a1a1a; direction: ltr;
}
.payment-card-owner { font-weight: 600; color: #1a1a1a; }
.payment-copy-btn {
  background: var(--lime); color: #fff; border: none; border-radius: 6px;
  padding: 3px 8px; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  transition: background .2s; margin-right: auto;
}
.payment-copy-btn:active { background: var(--lime-dk); }
.payment-notice {
  font-size: 12px; color: #c05000; line-height: 1.7;
  margin: 8px 0 0; display: flex; gap: 5px; align-items: flex-start;
}
.payment-notice i { margin-top: 3px; flex-shrink: 0; }

.checkout-input {
  width: 100%; border: 1px solid var(--gray); border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 13px; direction: rtl; margin-bottom: 8px; outline: none;
  transition: border-color .2s;
}
.checkout-input:focus { border-color: var(--lime); }
textarea.checkout-input { resize: none; }

.checkout-btn {
  width: 100%; background: var(--lime); color: #fff;
  border-radius: var(--radius); padding: 12px;
  font-size: 14px; font-weight: 700; font-family: Vazirmatn, Tahoma, sans-serif;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 6px; transition: background .2s;
}
.checkout-btn:hover { background: var(--lime-dk); }
.checkout-btn:disabled { background: var(--gray-md); cursor: not-allowed; }

/* ============================================================
   ACCOUNT MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1200; opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.account-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -60%);
  width: 340px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  z-index: 1201; opacity: 0; pointer-events: none;
  transition: transform .3s, opacity .3s;
}
.account-modal.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%);
}

.account-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--gray);
  font-size: 15px; font-weight: 700;
}
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--gray-dk); transition: background .2s;
}
.modal-close:hover { background: var(--gray-lt); }

.auth-tabs {
  display: flex; border-bottom: 1px solid var(--gray);
}
.auth-tab {
  flex: 1; padding: 12px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--gray-md);
  border-bottom: 2px solid transparent; transition: all .2s;
  font-family: Vazirmatn, Tahoma, sans-serif;
}
.auth-tab.active { color: var(--lime); border-bottom-color: var(--lime); }

.auth-form-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.auth-input {
  width: 100%; border: 1px solid var(--gray); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 13px; direction: rtl; outline: none; transition: border-color .2s;
}
.auth-input:focus { border-color: var(--lime); }
.auth-error { color: var(--red); font-size: 12px; min-height: 16px; }
.auth-btn {
  width: 100%; background: var(--lime); color: #fff;
  border-radius: var(--radius); padding: 11px;
  font-size: 14px; font-weight: 700; font-family: Vazirmatn, Tahoma, sans-serif;
  cursor: pointer; transition: background .2s;
}
.auth-btn:hover { background: var(--lime-dk); }
.auth-btn-outline {
  background: transparent; color: var(--red);
  border: 1px solid var(--red);
}
.auth-btn-outline:hover { background: #ffebee; }

.logged-in-body {
  padding: 24px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.logged-avatar { font-size: 56px; color: var(--lime); }
.logged-phone { font-size: 12px; color: var(--gray-md); }

/* Order history in account modal */
.orders-section { width: 100%; text-align: right; }
.orders-title { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 8px; border-bottom: 1px solid #f0f0f0; padding-bottom: 6px; }
.orders-title i { margin-left: 6px; }
.orders-list { max-height: 200px; overflow-y: auto; }
.order-item { background: #f8f8f8; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; font-size: 12px; }
.order-item-row { display: flex; justify-content: space-between; align-items: center; }
.order-item-id { font-weight: 700; color: #444; }
.order-item-total { color: var(--red); font-weight: 700; }
.order-item-date { color: #999; font-size: 11px; margin-top: 3px; }
.order-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.order-status-pending    { background: #fff3e0; color: #e65100; }
.order-status-processing { background: #e3f2fd; color: #1565c0; }
.order-status-shipped    { background: #f3e5f5; color: #6a1b9a; }
.order-status-delivered  { background: #e8f5e9; color: #2e7d32; }
.order-status-cancelled  { background: #ffebee; color: #c62828; }
.orders-empty { text-align: center; color: #aaa; padding: 16px; font-size: 12px; }
.orders-loading { text-align: center; color: #aaa; padding: 16px; font-size: 12px; }

/* Phone number text in desktop header */
.phone-btn-desk { display: flex; flex-direction: row; align-items: center; height: 40px !important; width: auto !important; padding: 0 10px; gap: 6px; }
.phone-num-desk { font-size: 12px; font-weight: 700; direction: ltr; letter-spacing: 0.5px; color: var(--white); white-space: nowrap; }

/* Bale messenger button */
.bale-btn-desk { display: flex; flex-direction: row; align-items: center; height: 40px !important; width: auto !important; padding: 0 10px; gap: 6px; }
.bale-svg-icon { width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; }
.bottom-nav .bale-svg-icon { width: 26px; height: 26px; }

/* Product Detail Modal */
.product-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -60%) scale(0.95);
  width: min(620px, 95vw); max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 18px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.2);
  z-index: 1201; opacity: 0; pointer-events: none;
  transition: transform .3s, opacity .3s;
}
.product-modal.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.product-modal-header {
  display: flex; justify-content: flex-start;
  padding: 14px 16px; border-bottom: 1px solid #f0f0f0;
}
.product-modal-body {
  display: flex; gap: 20px; padding: 20px; flex-wrap: wrap;
}
.pm-img-wrap { flex: 0 0 200px; max-width: 200px; }
.pm-img-wrap img { width: 100%; border-radius: 12px; object-fit: contain; max-height: 200px; }
.pm-info { flex: 1; min-width: 180px; }
.pm-info h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #1a1a1a; line-height: 1.6; }
.pm-price { font-size: 18px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.pm-price .pm-old-price { font-size: 12px; color: #aaa; text-decoration: line-through; margin-left: 8px; font-weight: 400; }
.pm-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
  margin: 10px 0;
}
.pm-desc.collapsed {
  max-height: 96px; /* ~4 lines at 13px x 1.8 */
  overflow: hidden;
}
.pm-desc-more {
  background: none;
  border: none;
  color: var(--primary, #FF6A00);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pm-stock-badge { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px; margin-bottom: 8px; }
.pm-stock-in { background: #e8f5e9; color: #2e7d32; }
.pm-stock-out { background: #ffebee; color: #c62828; }
.pm-cart-btn {
  width: 100%; padding: 12px; background: #ff6a00; color: #fff;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 12px; font-family: Vazirmatn, Tahoma, sans-serif;
  transition: background .2s;
}
.pm-cart-btn:hover { background: #e55e00; }
.pm-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 0;
  margin-top: 8px;
  background: transparent;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  border-radius: 10px;
  font-size: 14px;
  font-family: Vazirmatn, Tahoma, sans-serif;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.pm-share-btn:hover {
  background: #3b82f6;
  color: #fff;
}

.pm-cart-btn:disabled { background: #ccc; cursor: not-allowed; }
@media (max-width: 480px) {
  .hero-slider { aspect-ratio: auto; height: 180px; }
  .product-modal-body { flex-direction: column; }
  .pm-img-wrap { max-width: 100%; flex: 0 0 auto; width: 100%; }
  .pm-img-wrap img { max-height: 180px; }
}

/* ============================================================
   === COMPREHENSIVE MOBILE RESPONSIVE ===
   ============================================================ */

/* ---- Product card: compact on narrow 2-col grid (< 400px) ---- */
@media (max-width: 400px) {
  .product-img-wrap { padding: 6px; }
  .product-info { padding: 7px 8px 10px; gap: 5px; }
  .product-name { font-size: 11px; }
  .price-val { font-size: 13px; }
  .btn-add-cart { padding: 5px 7px; font-size: 11px; gap: 3px; }
  .btn-contact-only { padding: 5px 7px !important; font-size: 11px !important; gap: 3px !important; }
  .stock-badge { font-size: 10px; padding: 2px 5px; }
}

/* ---- Product footer: wrap on narrow screens ---- */
@media (max-width: 360px) {
  .product-footer { flex-wrap: wrap; gap: 4px; }
  .btn-add-cart { width: 100%; justify-content: center; }
  .btn-contact-only { width: 100% !important; justify-content: center !important; }
  .cart-sidebar { width: 100vw; }
}

/* ---- Product modal: full-width centered on mobile ---- */
@media (max-width: 540px) {
  .product-modal {
    width: calc(100vw - 16px);
    max-height: 88vh;
    overflow-y: auto;
  }
  .product-modal-body { padding: 14px; gap: 12px; }
  .pm-info h2 { font-size: 14px; }
  .pm-price { font-size: 16px; }
  .pm-cart-btn, .pm-share-btn { padding: 11px; }
}

/* ---- Banner labels: smaller on mobile ---- */
@media (max-width: 480px) {
  .banner-label { font-size: 12px; bottom: 8px; right: 8px; line-height: 1.4; }
  .banner-label-lg { font-size: 14px; }
}

/* ---- Section spacing: tighter on mobile ---- */
@media (max-width: 480px) {
  .products-section { padding: 14px 12px 16px; }
  .quick-cats { padding: 14px 12px; }
  .cat-section { padding: 12px 12px 16px; }
  .cat-section-title { font-size: 15px; }
  .section-title { margin-bottom: 10px; }
  .section-title span { font-size: 14px; }
  .section-title-line span { font-size: 14px; }
}

/* ---- Checkout form: ensure full-width inputs ---- */
.checkout-input { box-sizing: border-box; width: 100%; }

/* ---- Product card share btn: smaller on mobile ---- */
@media (max-width: 400px) {
  .btn-card-share { width: 28px; height: 28px; font-size: 11px; top: 5px; right: 5px; }
}

/* ---- Hero slider: very small phones ---- */
@media (max-width: 360px) {
  .hero-slider { height: 150px; }
  .slide { padding: 12px 14px; }
  .slide-content h2 { font-size: 15px; }
  .slide-content p { display: none; }
  .slide-img { display: none; }
}

/* ---- Cat nav bar: hide on very small ---- */
@media (max-width: 400px) {
  .cat-nav-item { font-size: 10.5px; padding: 3px 5px; }
}

/* ---- Featured cats + quick cats: 4-col on slightly wider mobile ---- */
@media (min-width: 420px) and (max-width: 767px) {
  .featured-cats { grid-template-columns: repeat(4, 1fr); }
  .cats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Contact Only: تماس بگیرید ---- */
.price-contact {
  color: #FF6A00;
  font-weight: 700;
  font-size: 14px;
}
.btn-contact-only {
  background: linear-gradient(135deg, #FF6A00, #e85200) !important;
  color: #fff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-contact-only:hover { opacity: 0.9; }
.pm-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #FF6A00, #e85200);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 10px;
}
.pm-contact-btn:hover { opacity: 0.9; }

/* ===== AUTH NEW STYLES (Phase 2) ===== */
.auth-link { color: var(--primary, #FF6A00); font-size: 12px; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-hint { color: #666; font-size: 12px; line-height: 1.6; margin-bottom: 10px; background: #f8f8f8; padding: 8px 10px; border-radius: 8px; }
.auth-success { color: #2e7d32; font-size: 12px; min-height: 16px; }

/* Invoice link in order list */
.order-invoice-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary, #FF6A00); font-size: 11px; text-decoration: none;
  background: #fff3e0; padding: 3px 10px; border-radius: 20px;
}
.order-invoice-btn:hover { background: #ffe0b2; }
.order-invoice-btn i { font-size: 10px; }

/* Checkout login gate */
.checkout-login-gate {
  text-align: center; padding: 20px 16px;
  background: #f8f8f8; border-radius: 10px; margin-bottom: 12px;
}
.checkout-login-gate p { color: #555; font-size: 14px; margin-bottom: 12px; }

/* ===== SIDE MENU FOOTER ===== */
.side-menu-footer {
  border-top: 2px solid var(--gray);
  background: #fafafa;
  padding-bottom: 16px;
}

/* Account block */
.smf-account {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--gray);
}
.smf-login-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, var(--lime-dkk), var(--lime));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: Vazirmatn, sans-serif;
}
.smf-login-btn i { font-size: 18px; }
.smf-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.smf-user-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--lime-dkk), var(--lime));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.smf-user-info { flex: 1; min-width: 0; }
.smf-user-name { font-size: 14px; font-weight: 700; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smf-user-sub { font-size: 11px; color: #FF6A00; margin-top: 2px; }

/* Contact section */
.smf-section { padding: 12px 16px 4px; }
.smf-section-title {
  font-size: 11px; font-weight: 700; color: #999;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.smf-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--gray);
  color: #333; font-size: 13px; text-decoration: none;
  transition: color .15s;
}
.smf-link:last-child { border-bottom: none; }
.smf-link:active { color: var(--lime); }
.smf-link-icon {
  width: 30px; height: 30px;
  background: #f0f0f0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.smf-link-icon i { color: var(--lime); font-size: 13px; }
.smf-bale-link .smf-link-icon { background: #e8f5e9; }
.smf-bale-icon { width: 18px; height: 18px; object-fit: contain; }
/* Telegram icon */
.telegram-icon-btn { color: #29b6f6; }
.telegram-icon-btn i { font-size: 22px; }
.smf-telegram-link .smf-link-icon { background: #e3f2fd; }
.smf-telegram-link .smf-link-icon i { color: #29b6f6 !important; font-size: 16px; }


.smf-copy {
  text-align: center; font-size: 10px; color: #bbb;
  padding: 12px 16px 0;
}

/* ===== ACCOUNT MODAL — REDESIGN (Phase 3) ===== */

/* Desktop: 50% wider */
@media (min-width: 768px) {
  .account-modal {
    width: 500px;
  }
}

/* Logged-in header: avatar right, info left */
.logged-in-body {
  padding: 0;
  text-align: right;
  align-items: stretch;
  gap: 0;
}
.li-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--gray);
  direction: rtl;
}
.li-avatar {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--lime-dkk), var(--lime));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff; font-size: 28px;
}
.li-info { flex: 1; min-width: 0; }
.li-name-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.li-name { font-size: 15px; font-weight: 700; color: #222; }
.li-edit-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--gray-lt); color: var(--gray-dk);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.li-edit-btn:hover { background: var(--lime-bg); color: var(--lime); }
.li-edit-form {
  display: flex; gap: 6px; margin-bottom: 4px;
}
.li-edit-form .auth-input {
  flex: 1; padding: 6px 10px; font-size: 13px;
}
.li-save-btn {
  background: var(--lime); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  font-family: Vazirmatn, sans-serif; cursor: pointer; white-space: nowrap;
}
.li-phone { font-size: 12px; color: var(--gray-md); direction: ltr; text-align: right; margin-bottom: 4px; }
.li-email-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px;
}
.li-email-icon { font-size: 11px; color: var(--gray-md); }
.li-email {
  font-size: 12px; color: var(--gray-md);
  direction: ltr; text-align: right;
  flex: 1;
}


/* Orders section inside logged-in panel */
.li-orders-section { padding: 0 18px 0; }
.li-orders-section .orders-title { padding: 12px 0 8px; }
.orders-list { max-height: 260px; }
.li-footer { padding: 10px 18px 18px; }

/* ===== Receipt Upload (customer orders) ===== */
.order-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-family: inherit;
  cursor: pointer; transition: background .2s;
}
.order-upload-btn:hover { background: var(--primary-dark, #cc5500); }
.order-upload-btn:disabled { opacity: .6; cursor: not-allowed; }
.order-receipt-done {
  display: inline-flex; align-items: center; gap: 5px;
  color: #15803d; font-size: 13px; font-weight: 600;
  background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 8px; padding: 5px 12px;
}
.order-receipt-done i { color: #22c55e; }

/* ===== Receipt Image (admin order detail) ===== */
.receipt-img-row { align-items: flex-start !important; gap: 10px; }
.receipt-thumb-link { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; }
.receipt-thumb {
  width: 120px; height: 90px; object-fit: cover;
  border-radius: 8px; border: 2px solid #e2e8f0;
  cursor: pointer; transition: transform .2s;
}
.receipt-thumb:hover { transform: scale(1.05); border-color: var(--primary); }
.receipt-thumb-label { font-size: 11px; color: var(--primary); }

/* ===== Receipt upload label (cart checkout form) ===== */
.receipt-upload-label {
  display: flex; align-items: center; gap: 8px;
  background: #f8f8f8; border: 1.5px dashed #ccc;
  border-radius: 8px; padding: 11px 14px;
  cursor: pointer; font-size: 13px; color: #888;
  transition: border-color .2s, background .2s, color .2s;
  width: 100%; box-sizing: border-box;
}
.receipt-upload-label:hover { border-color: var(--primary); background: #fff8f4; color: var(--primary); }
.receipt-upload-label.has-file { border-color: #22c55e; background: #f0fdf4; color: #15803d; border-style: solid; }
.receipt-upload-label i { font-size: 15px; flex-shrink: 0; }
