/* ============================================
   Design System - lmshop
   ============================================ */
:root {
  --color-primary: #0f4c81;
  --color-secondary: #1a9e8f;
  --color-bg: #f7f9fc;
  --color-text: #1b2733;
  --color-muted: #6b7a8a;
  --color-border: #e2e8f0;
  --color-success: #1f9d55;
  --color-warning: #d69e2e;
  --color-danger: #d64545;
  --color-white: #ffffff;
  --color-header: #ffffff;
  --shadow-sm: 0 1px 3px rgba(27,39,51,.08);
  --shadow-md: 0 4px 16px rgba(27,39,51,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Vazirmatn', Tahoma, sans-serif;
  --header-h: 72px;
  --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-secondary); }
button, input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 16px; flex-wrap: wrap;
  padding: 8px 0;
}
.header-logo a {
  display: inline-flex;
  align-items: center;
  transition: opacity .2s;
}
.header-logo a:hover { opacity: .85; }
.header-logo img { height: 56px; width: auto; object-fit: contain; }
.header-phone a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--color-primary); font-size: 15px;
  white-space: nowrap; direction: ltr;
  background: rgba(15,76,129,.06);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.header-phone a:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Nav Desktop */
.nav-desktop { display: none; flex: 1; justify-content: center; }
.nav-list {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 4px 8px; max-width: 100%;
}
.nav-item { position: relative; }
.nav-link {
  display: block; padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--color-text); font-weight: 500; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { background: rgba(15,76,129,.08); color: var(--color-primary); }
.nav-item.has-children > .nav-link::after { content: ' ▾'; font-size: .75em; }
.dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  min-width: 200px; background: #fff; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); border: 1px solid var(--color-border);
  padding: 8px 0; z-index: 50;
}
.nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown { display: block; }
.dropdown a {
  display: block; padding: 8px 16px; color: var(--color-text);
}
.dropdown a:hover { background: rgba(15,76,129,.06); color: var(--color-primary); }

.hamburger {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; border: none; background: transparent; cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm);
}
.hamburger span {
  display: block; height: 2px; background: var(--color-text); border-radius: 2px;
  transition: var(--transition);
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Drawer */
.nav-drawer {
  position: fixed; top: 0; right: -100%; width: min(320px, 90vw); height: 100%;
  background: #fff; z-index: 1100; box-shadow: var(--shadow-md);
  transition: right .3s ease; overflow-y: auto; padding: 20px 0;
}
.nav-drawer.open { right: 0; }
.nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1050;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.drawer-close {
  position: absolute; top: 12px; left: 12px; width: 36px; height: 36px;
  border: none; background: var(--color-bg); border-radius: 50%; cursor: pointer;
  font-size: 18px;
}
.drawer-nav a {
  display: block; padding: 12px 24px; color: var(--color-text); font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.drawer-nav .sub-toggle { width: 100%; text-align: right; background: none; border: none;
  padding: 12px 24px; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between;
  border-bottom: 1px solid var(--color-border); color: var(--color-text);
}
.drawer-sub { display: none; background: var(--color-bg); }
.drawer-sub.open { display: block; }
.drawer-sub a { padding-right: 40px; font-weight: 400; font-size: 14px; }

@media (min-width: 992px) {
  .nav-desktop { display: flex; }
  .hamburger { display: none; }
  .header-inner { flex-wrap: nowrap; }
}

/* ============================================
   Hero Slider — CSS-only Fade + JS اختیاری
   ============================================ */
.slider-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0a2d4d;
}

.slider-track {
  position: relative;
  width: 100%;
  aspect-ratio: 21/9;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transition: opacity .8s ease-in-out, visibility .8s ease-in-out;
}

/* حالت ۱: چرخش خودکار با CSS (وقتی JS نداری) */
.slider-section:not(.js-enabled) .slide {
  animation: slideFade calc(var(--slide-count, 1) * 5s) infinite;
  animation-delay: calc(var(--slide-index, 0) * 5s);
}
.slider-section:not(.js-enabled) .slide:first-child {
  opacity: 1;
  visibility: visible;
}

/* حالت ۲: چرخش با JS */
.slider-section.js-enabled .slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.slide a.slide-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(to top, rgba(10,30,50,.7) 0%, rgba(10,30,50,.2) 50%, rgba(10,30,50,.15) 100%);
  padding: 24px;
  color: #fff;
  pointer-events: none;
}

.slide-title {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  max-width: 900px;
}
.slide-sub {
  font-size: clamp(.9rem, 2vw, 1.15rem);
  opacity: .95;
  max-width: 600px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* انیمیشن fade برای حالت CSS-only */
@keyframes slideFade {
  0%   { opacity: 0; visibility: hidden; }
  1%   { opacity: 1; visibility: visible; }
  20%  { opacity: 1; visibility: visible; }
  21%  { opacity: 0; visibility: hidden; }
  100% { opacity: 0; visibility: hidden; }
}

/* دکمه‌های چپ/راست */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.85);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: #1a3a5c;
  transition: background .2s;
}
.slider-nav:hover { background: #fff; }
.slider-prev { right: 12px; }
.slider-next { left: 12px; }

/* dots */
.slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.slider-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background .2s;
}
.slider-dots button.active { background: #fff; }

/* احترام به prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .slider-section:not(.js-enabled) .slide { animation: none; }
  .slider-section:not(.js-enabled) .slide:first-child { opacity: 1; visibility: visible; }
}

/* فیلتر دستگاه */
@media (min-width: 992px) {
  .slide[data-desktop="0"] { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .slide[data-tablet="0"] { display: none !important; }
}
@media (max-width: 767px) {
  .slide[data-mobile="0"] { display: none !important; }
}

/* واکنش‌گرا */
@media (max-width: 991px) {
  .slider-track { aspect-ratio: 16/9; }
}
@media (max-width: 767px) {
  .slider-track { aspect-ratio: 16/10; }
  .slider-nav { width: 34px; height: 34px; font-size: 15px; }
  .slider-prev { right: 8px; }
  .slider-next { left: 8px; }
  .slider-dots { bottom: 12px; gap: 6px; }
  .slider-dots button { width: 9px; height: 9px; }
}

/* ============================================
   Services
   ============================================ */
.section { padding: 48px 0; }
.section-title {
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--color-text);
  position: relative;
  padding-bottom: 14px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}
.services-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 576px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }
.service-card {
  background: linear-gradient(#fff, #fff) padding-box,
              linear-gradient(135deg, #e8eef5, #f0f7f6) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column; height: 100%;
}
@media (hover: hover) {
  .service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
}
.service-card img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--color-border);
}
.service-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.service-body h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.service-body h3 a:hover { color: var(--color-primary); }
.service-body p { color: var(--color-muted); font-size: .9rem; flex: 1; }

/* ============================================
   Page content
   ============================================ */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a6bab 50%, var(--color-secondary) 100%);
  color: #fff;
  padding: 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,.12), transparent 50%);
  pointer-events: none;
}
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2rem); position: relative; z-index: 1; }
.page-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-sm);
  margin: 32px 0;
}
.page-content p { margin-bottom: 1em; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: linear-gradient(180deg, #0d2137 0%, #0a1929 100%);
  color: #c8d4e0;
  padding: 48px 0 24px;
  margin-top: 48px;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 32px;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1.2fr 1fr; }
}
.footer-col h4 {
  color: #fff; font-size: 1.05rem; margin-bottom: 16px; font-weight: 600;
}
.footer-contact li { margin-bottom: 10px; display: flex; align-items: flex-start; gap: 8px; }
.footer-contact a { color: #c8d4e0; }
.footer-contact a:hover { color: #fff; }
.footer-map {
  border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 16/10; background: #1a334d;
}
.footer-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.licenses-grid {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.licenses-grid a img {
  height: 105px;
  width: auto;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}
.licenses-intro { font-size: .85rem; margin-bottom: 12px; opacity: .9; }
.footer-bottom {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1);
  text-align: center; font-size: .85rem; opacity: .8;
}
.social-links { display: flex; gap: 12px; margin-top: 12px; }
.social-links a {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.social-links a:hover { background: var(--color-secondary); }

/* ============================================
   Chat Widget
   ============================================ */
.chat-fab {
  position: fixed; bottom: 24px; left: 24px; z-index: 2000;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--color-primary), #1a6bab);
  color: #fff; cursor: grab;
  box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center;
  font-size: 24px; touch-action: none; user-select: none;
  transition: transform .15s;
}
.chat-fab:active { cursor: grabbing; }
.chat-fab:hover { transform: scale(1.05); }
.chat-window {
  position: fixed; bottom: 90px; left: 24px; z-index: 2001;
  width: min(360px, calc(100vw - 32px)); height: min(480px, calc(100vh - 120px));
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(15,76,129,.2);
  display: none; flex-direction: column; overflow: hidden;
  border: none;
}
.chat-window.open { display: flex; }
.chat-header {
  background: linear-gradient(135deg, var(--color-primary), #1a6bab);
  color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.chat-header .status { font-size: .8rem; opacity: .9; }
.chat-header .status.online::before { content: '● '; color: #4ade80; }
.chat-header .status.offline::before { content: '● '; color: #fbbf24; }
.chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: #f0f4f8;
}
.chat-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .9rem;
  word-break: break-word;
}
.chat-bubble.visitor {
  align-self: flex-start; background: #fff; border: 1px solid var(--color-border);
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.chat-bubble.support {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-primary), #1a6bab);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.chat-bubble.system {
  align-self: center; background: transparent; color: var(--color-muted);
  font-size: .8rem; text-align: center;
}
.chat-meta { font-size: .7rem; opacity: .75; margin-top: 4px; }
.chat-support-info { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.chat-support-info img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.chat-input-area {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border); background: #fff;
}
.chat-input-area input, .chat-input-area textarea {
  flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 10px 12px; resize: none; outline: none;
}
.chat-input-area input:focus, .chat-input-area textarea:focus {
  border-color: var(--color-primary);
}
.chat-send {
  background: var(--color-primary); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 0 16px; cursor: pointer; font-weight: 600;
}
.chat-send:disabled { opacity: .6; cursor: not-allowed; }
.chat-phone-box {
  padding: 12px; background: #fff8e6; border-top: 1px solid #f0d78c;
  display: none; flex-direction: column; gap: 8px;
}
.chat-phone-box.show { display: flex; }
.chat-phone-box input {
  border: 1px solid #e0c060; border-radius: var(--radius-sm); padding: 8px 12px;
}

/* ============================================
   Utilities
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: none;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #1a6bab);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,76,129,.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(15,76,129,.35);
  transform: translateY(-1px);
  color: #fff;
}
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
}
.alert-success { background: #e6f9ef; color: #0d6b3a; border: 1px solid #a3e4c1; }
.alert-error { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5b5b5; }

/* Focus */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ============================================
   Responsive Header tweaks
   ============================================ */
@media (max-width: 991px) {
  .header-phone a span:last-child {
    /* keep number visible on mobile */
  }
}