:root {
  --bg: #0b0f14;
  --bg-elev-1: #0f141b;
  --bg-elev-2: #141a22;
  --surface: rgba(22, 28, 36, 0.6);
  --text: #e6e9ef;
  --muted: #a0a7b4;
  --gold: #c8a062;
  --gold-strong: #d4af37;
  --accent: #5ea3ff;
  --danger: #ff6b6b;
  --shadow: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(200, 160, 98, 0.08), transparent),
              radial-gradient(800px 500px at 0% 100%, rgba(94, 163, 255, 0.06), transparent),
              var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  overflow-x: hidden;
}

/* Luxury scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold), var(--gold-strong)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--gold-strong), var(--gold)); }

img { max-width: 100%; display: block; }

.container {
  width: min(1120px, 90%);
  margin-inline: auto;
}

.section-title {
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem);
  margin: 0 0 1rem 0;
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-strong));
  border-radius: 2px;
}

.lead { color: var(--text); opacity: 0.9; }
.muted { color: var(--muted); }

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0.8rem 1.4rem;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-block;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}
.btn:hover::before { transform: translateX(100%); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.btn:active { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-strong));
  color: #111;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 12px 45px rgba(212, 175, 55, 0.4);
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
}

.btn-secondary {
  border: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,0.25);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}

.btn-ghost {
  border: 1px solid transparent;
  color: var(--gold);
  background: transparent;
}
.btn-ghost:hover { 
  color: var(--gold-strong); 
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(10, 14, 19, 0.85), rgba(10, 14, 19, 0.4));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: 0.6px; }
.brand-mark { display: none; }
.brand-logo { width: 120px; height: 28px; display: block; }
.brand, .brand:link, .brand:visited { color: inherit; text-decoration: none; }
.brand-name { font-family: Cinzel, Georgia, serif; color: var(--gold); }
.nav { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav-link:hover { color: var(--text); }
.nav .cta { color: var(--gold); }

.hero {
  position: relative;
  min-height: 86vh;
  display: grid;
  place-items: center;
  overflow: clip;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hero-media {
  position: absolute; inset: 0;
  background-image: linear-gradient(180deg, rgba(6,9,13,0.72), rgba(6,9,13,0.84)), url("assets/bg.jpg");
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: saturate(0.88) contrast(1.06);
  transform: scale(1.03);
}
.hero-content { position: relative; text-align: center; padding: 16vh 0 12vh; }
.headline {
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 4rem);
  margin: 0;
  background: linear-gradient(135deg, var(--text), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}
.subheadline { color: var(--muted); margin: 1rem auto 2rem; max-width: 56ch; }
.hero-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.products-section { padding: 6rem 0 3rem; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)); }
.product-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.2rem;
}
.product-card {
  grid-column: span 12;
  position: relative;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 25px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden;
  transition: all 320ms cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  height: fit-content;
}
.product-card:hover { 
  transform: translateY(-6px) scale(1.02); 
  border-color: rgba(212, 175, 55, 0.3); 
  box-shadow: 0 35px 100px rgba(0,0,0,0.6), 0 0 40px rgba(212, 175, 55, 0.15), inset 0 1px 0 rgba(255,255,255,0.15); 
}
.product-card:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.card-glow { position: absolute; inset: -40%; background: radial-gradient(600px 180px at 20% 10%, rgba(212,175,55,0.08), transparent 60%); pointer-events: none; }
.card-body { position: relative; padding: 1.4rem; }
.product-title { margin: 0 0 0.4rem; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.2px; }
.product-desc { margin: 0 0 0.8rem; color: var(--muted); }
.product-tags { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.product-tags li { 
  font-size: 0.75rem; 
  color: #000; 
  background: linear-gradient(135deg, var(--gold), var(--gold-strong)); 
  padding: 0.35rem 0.8rem; 
  border-radius: 20px; 
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 8px rgba(212, 175, 55, 0.3); 
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.card-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Carousel - بدون دکمه‌های چپ و راست */
.carousel { position: relative; margin-top: 1.2rem; }
.carousel-viewport { overflow: hidden; }
.product-track {
  display: flex;
  gap: 1.2rem;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.4rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: stretch;
}
.product-track::-webkit-scrollbar { 
  display: none; 
  height: 0; 
  width: 0; 
}
.product-card { scroll-snap-align: center; }

/* 3-per-view on desktop, 2 on tablets, 1 on mobile */
@media (min-width: 1040px) {
  .product-card { flex: 0 0 calc((100% - 2 * 1.2rem) / 3); }
}
@media (min-width: 720px) and (max-width: 1039.98px) {
  .product-card { flex: 0 0 calc((100% - 1.2rem) / 2); }
}
@media (max-width: 719.98px) {
  .product-card { flex: 0 0 100%; }
}

@media (min-width: 720px) {
  .product-card { grid-column: span 6; }
}
@media (min-width: 1040px) {
  .product-card { grid-column: span 4; }
}

.about-section { padding: 5rem 0; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02)); }
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.stat { font-family: Cinzel, Georgia, serif; font-size: clamp(1.6rem, 1.2rem + 2vw, 3rem); color: var(--gold); }
.label { color: var(--muted); display: block; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}

.contact-section { padding: 5rem 0 6rem; }
.contact-inner { text-align: center; }
.contact-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

/* فوتر بهبود یافته - حذف تکرار نام شرکت و حل overlap */
.site-footer { 
  border-top: 1px solid rgba(255,255,255,0.06); 
  background: linear-gradient(180deg, rgba(10,14,19,0.8), rgba(10,14,19,0.95)); 
  padding: 1.5rem 0;
  margin-top: 3rem;
  clear: both;
}
.footer-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-inner .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

@media (max-width: 600px) {
  .footer-inner { 
    flex-direction: column; 
    text-align: center; 
    gap: 0.8rem; 
  }
}

/* Modals */
.modal::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal { 
  border: 1px solid rgba(212, 175, 55, 0.2); 
  background: linear-gradient(135deg, rgba(22,28,36,0.98), rgba(15,20,26,0.95)); 
  color: var(--text); 
  border-radius: 16px; 
  width: min(720px, 92%); 
  box-shadow: 0 40px 120px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.1); 
  backdrop-filter: blur(16px);
}
.modal-title { font-family: Cinzel, Georgia, serif; margin: 0; padding: 1.2rem 1.2rem 0.4rem; }
.modal-content { padding: 0 1.2rem 1.2rem; }
.modal-list { margin: 0.6rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.modal-close { position: absolute; right: 0.8rem; top: 0.6rem; border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }

/* Utilities */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Vertical products (used on products.html) */
.product-vertical-list { display: grid; gap: 2rem; padding: 3rem 0 6rem; }
.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 20px 60px var(--shadow);
}
.product-media { aspect-ratio: 16/10; background: #0e141b; }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; object-position: 50% 50%; }
.product-content { padding: 1.2rem 1.2rem 1.4rem; }
.product-content .product-title { font-size: 1.5rem; margin: 0 0 0.4rem; }
.product-content .product-desc { color: var(--muted); margin: 0 0 0.6rem; }
.applications { margin: 0.6rem 0 1rem; padding-left: 1.1rem; color: var(--muted); }
.spec-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; }
  .product-media { aspect-ratio: 16/9; }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  border: none;
  border-radius: 50%;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(200, 160, 98, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(200, 160, 98, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px);
}

/* Mobile hamburger - بهبود یافته */
.hamburger { 
  display: none; 
  border: 0; 
  background: transparent; 
  padding: 0.6rem; 
  cursor: pointer; 
  position: relative;
  z-index: 1002;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.hamburger:hover {
  background: rgba(200, 160, 98, 0.1);
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  transform-origin: center;
}

/* Hamburger animation when open */
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  background: var(--gold-strong);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
  background: var(--gold-strong);
}

.mobile-backdrop { 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.7); 
  backdrop-filter: blur(12px); 
  opacity: 0; 
  visibility: hidden;
  pointer-events: none; 
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
  z-index: 1000; 
}
.mobile-backdrop.open { 
  opacity: 1; 
  visibility: visible;
  pointer-events: auto; 
}

.mobile-menu { 
  position: fixed; 
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: rgba(11, 15, 20, 0.98); 
  backdrop-filter: blur(30px);
  border-left: 1px solid rgba(200, 160, 98, 0.3); 
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
  z-index: 1001; 
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}
.mobile-menu.open { 
  right: 0; 
}

.mobile-menu-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 1.5rem; 
  border-bottom: 1px solid rgba(200, 160, 98, 0.2); 
  background: rgba(200, 160, 98, 0.05);
}
.mobile-menu-title { 
  font-family: Cinzel, Georgia, serif; 
  color: var(--gold); 
  font-size: 1.2rem; 
  font-weight: 700;
  letter-spacing: 0.5px;
}

.mobile-menu-links { 
  display: flex;
  flex-direction: column;
  gap: 0; 
  padding: 1.5rem 0; 
}
.mobile-menu-links a { 
  color: var(--text); 
  text-decoration: none; 
  padding: 1.2rem 1.5rem; 
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mobile-menu-links a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(200, 160, 98, 0.1), transparent);
  transition: width 0.3s ease;
}
.mobile-menu-links a:hover { 
  color: var(--gold);
  border-left-color: var(--gold);
  padding-left: 2rem;
  background: rgba(200, 160, 98, 0.05);
}
.mobile-menu-links a:hover::before {
  width: 100%;
}

.mobile-menu-close { 
  border: 0; 
  background: rgba(255, 255, 255, 0.05);
  color: var(--text); 
  font-size: 1.8rem; 
  cursor: pointer; 
  padding: 0.5rem;
  border-radius: 4px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.mobile-menu-close:hover {
  color: var(--gold);
  background: rgba(200, 160, 98, 0.1);
  transform: rotate(90deg);
}

/* Responsive breakpoints */
@media (max-width: 900px) {
  .nav { display: none; }
  .hamburger { display: flex; }
}

/* Phone Sales Dropdown */
.phone-sales-dropdown {
  position: relative;
  display: inline-block;
}

.phone-sales-btn {
  position: relative;
  cursor: pointer;
}

.phone-sales-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 220px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  margin-top: 8px;
  backdrop-filter: blur(10px);
  overflow: visible;
}

.phone-sales-dropdown:hover .phone-sales-menu,
.phone-sales-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.phone-option {
  display: block;
  padding: 1rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 160, 98, 0.2);
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.phone-option:last-child {
  border-bottom: none;
}

.phone-option:hover {
  background: rgba(200, 160, 98, 0.15);
  color: var(--gold);
  padding-left: 1.8rem;
}

/* Mobile dropdown adjustments */
@media (max-width: 768px) {
  .phone-sales-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    min-width: 280px;
    margin-top: 0;
    z-index: 99999;
  }
  
  .phone-sales-dropdown:hover .phone-sales-menu,
  .phone-sales-menu.open {
    transform: translateX(-50%) translateY(-50%);
  }
  
  .phone-option {
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    text-align: center;
  }
  
  /* Ensure dropdown is always visible on mobile */
  .phone-sales-dropdown {
    position: relative;
  }
}

/* Mobile fine-tuning */
@media (max-width: 600px) {
  .container { width: min(100%, 92%); }
  .brand-logo { width: 96px; height: 24px; }
  .brand-name { font-size: 0.95rem; }
  .headline { font-size: 2rem; }
  .subheadline { font-size: 0.95rem; }
  .hero-content { padding: 12vh 0 8vh; }
  .section-title { font-size: 1.4rem; }
  .btn { padding: 0.65rem 1.1rem; border-radius: 2px; font-size: 0.8rem; }
  .product-card .product-title, .product-content .product-title { font-size: 1.2rem; }
  .product-desc { font-size: 0.95rem; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  
  /* Mobile menu adjustments */
  .mobile-menu { width: 280px; right: -280px; }
  .mobile-menu-links a { font-size: 1rem; padding: 1rem 1.2rem; }
  .mobile-menu-header { padding: 1.2rem; }
}