/* ═══════════════════════════════════════════════════════════════════════════
   BAHA'MED — Premium Design System
   Palette: White (#fff) | Brand Blue (#1565C0→#0D47A1) | Icy Blue (#E8F4FD)
            Navy (#0A1F44) | Slate (#546E7A) | Cyan (#00B4D8)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Vazirmatn @font-face ───────────────────────────────────────────────── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #1565C0;
  --blue-dark:  #0D47A1;
  --blue-deep:  #0A1F44;
  --blue-light: #E8F4FD;
  --blue-mid:   #1976D2;
  --cyan:       #00B4D8;
  --slate:      #546E7A;
  --slate-light:#78909C;
  --white:      #ffffff;
  --shadow-sm:  0 2px 8px rgba(21,101,192,.10);
  --shadow-md:  0 6px 24px rgba(21,101,192,.16);
  --shadow-lg:  0 16px 48px rgba(21,101,192,.20);
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --transition: .2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--slate);
  background: var(--white);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { color: var(--blue-deep); font-weight: 700; line-height: 1.4; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

.section-label {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: .8rem;
  font-weight: 600;
  padding: .25rem .9rem;
  border-radius: 100px;
  margin-bottom: .75rem;
  letter-spacing: .02em;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  width: min(100%, 1240px);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Vazirmatn', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  padding: .7rem 1.6rem;
  border-radius: 100px;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(21,101,192,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21,101,192,.45);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-outline:hover {
  background: var(--blue);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-white {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.btn-sm { padding: .5rem 1.1rem; font-size: .85rem; }

/* ── Announcement Bar ────────────────────────────────────────────────────── */
.announce-bar {
  background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue) 100%);
  color: var(--white);
  font-size: .82rem;
  font-weight: 500;
  padding: .5rem 0;
  text-align: right;
  letter-spacing: .01em;
}
.announce-bar .announce-inner { text-align: right; }
.announce-bar a { color: var(--cyan); text-decoration: underline; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(21,101,192,.10);
  padding: .9rem 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
}
.navbar-brand span { font-size: .65rem; font-weight: 500; color: var(--slate); letter-spacing: .08em; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}
.navbar-nav a {
  display: block;
  padding: .5rem .85rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--blue-deep);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--blue); background: var(--blue-light); }

.navbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--blue-deep);
  font-size: .88rem;
  font-weight: 500;
  padding: .45rem .8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.cart-btn:hover { background: var(--blue-light); color: var(--blue); }

.cart-badge {
  position: absolute;
  top: -.2rem;
  left: -.2rem;
  background: var(--cyan);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .25rem;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .4rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--blue-deep); border-radius: 2px; transition: all .3s; }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--white);
  z-index: 2000;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.mobile-menu-close {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border: none;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: .5rem; }
.mobile-menu nav a {
  display: block;
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--blue-deep);
  border-bottom: 1px solid var(--blue-light);
  transition: all var(--transition);
}
.mobile-menu nav a:hover { color: var(--blue); background: var(--blue-light); }
.mobile-menu .mobile-cta { margin-top: 1.5rem; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding: 4rem 0 5rem;
  background: var(--white);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: center;
}

.hero-content { order: 1; }
.hero-image   { order: 2; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--blue-light);
  color: var(--blue);
  font-size: .82rem;
  font-weight: 600;
  padding: .35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1.35;
  margin-bottom: 1rem;
}
.hero h1 .accent { color: var(--blue); }

.hero-sub {
  font-size: 1.05rem;
  color: var(--slate);
  line-height: 1.85;
  margin-bottom: 2rem;
  max-width: 45ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e8edf2;
}

.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}
.stat-label { font-size: .8rem; color: var(--slate); }

.hero-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-wrap::before {
  content: '';
  position: absolute;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(21,101,192,.18) 0%, transparent 70%);
  border-radius: 50%;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(30px);
}

.hero-image-wrap img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* ── Trust Bar ───────────────────────────────────────────────────────────── */
.trust-bar {
  background: var(--blue-light);
  padding: 1.5rem 0;
  border-top: 1px solid rgba(21,101,192,.08);
  border-bottom: 1px solid rgba(21,101,192,.08);
}

.trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--blue-deep);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

.trust-icon {
  width: 36px; height: 36px;
  background: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.trust-icon svg { width: 18px; height: 18px; color: var(--blue); }

/* ── Section Base ────────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-alt { background: var(--blue-light); }

.section-head { text-align: center; margin-bottom: 3rem; }
.section-head h2 { margin-bottom: .6rem; }
.section-head p { color: var(--slate); max-width: 55ch; margin-inline: auto; }

/* ── Features ────────────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid #e4eaf1;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(21,101,192,.2);
}

.feature-icon {
  width: 60px; height: 60px;
  background: var(--blue-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.feature-icon svg { width: 28px; height: 28px; color: var(--blue); }

.feature-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.feature-card p  { font-size: .88rem; line-height: 1.7; }

/* ── Comparison Table ────────────────────────────────────────────────────── */
.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.compare-table th {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  padding: 1.1rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
}
.compare-table th:first-child { text-align: right; }

.compare-table td {
  padding: .9rem 1.5rem;
  border-bottom: 1px solid #edf2f7;
  font-size: .9rem;
  text-align: center;
  color: var(--slate);
}
.compare-table td:first-child { text-align: right; font-weight: 500; color: var(--blue-deep); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:nth-child(even) td { background: #fafcff; }

.check-yes { color: #22C55E; font-size: 1.1rem; }
.check-no  { color: #E53E3E; font-size: 1.1rem; }

.highlight-col { background: rgba(21,101,192,.04); }

/* ── Products Grid ───────────────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border: 1px solid #e4eaf1;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.product-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--blue-light);
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-img img { transform: scale(1.06); }

.product-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-cat {
  font-size: .72rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}

.product-name {
  font-size: .92rem;
  font-weight: 600;
  color: var(--blue-deep);
  line-height: 1.5;
  margin-bottom: .6rem;
  flex: 1;
}

.product-stars { color: #F59E0B; font-size: .85rem; margin-bottom: .6rem; letter-spacing: .05em; }

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 1rem;
}

.product-card .btn { width: 100%; justify-content: center; }

/* ── Testimonials ────────────────────────────────────────────────────────── */
.testimonials-section {
  background: var(--blue-deep);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}
.testimonials-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(21,101,192,.3) 0%, transparent 70%);
  border-radius: 50%;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.testimonial-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 2rem;
  backdrop-filter: blur(8px);
  transition: all var(--transition);
}
.testimonial-card:hover {
  background: rgba(255,255,255,.1);
  transform: translateY(-4px);
}

.quote-mark {
  font-size: 4rem;
  line-height: .8;
  color: var(--cyan);
  font-family: serif;
  margin-bottom: .75rem;
  opacity: .7;
}

.testimonial-body {
  font-size: .92rem;
  line-height: 1.85;
  color: rgba(255,255,255,.85);
  margin-bottom: 1.25rem;
}

.testimonial-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.testimonial-meta strong { display: block; font-size: .9rem; color: var(--white); }
.testimonial-meta span   { font-size: .78rem; color: rgba(255,255,255,.55); }
.testimonial-stars       { color: #F59E0B; font-size: .8rem; margin-top: .15rem; }

/* ── Blog ────────────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.blog-img {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.blog-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.blog-card:hover .blog-img img { transform: scale(1.06); }

.blog-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.blog-date {
  font-size: .75rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: .6rem;
  background: var(--blue-light);
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 100px;
}

.blog-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1.5;
  margin-bottom: .6rem;
  flex: 1;
}

.blog-excerpt { font-size: .87rem; color: var(--slate); line-height: 1.7; margin-bottom: 1rem; }

.blog-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--blue);
  font-size: .87rem;
  font-weight: 600;
  transition: gap var(--transition);
}
.blog-link:hover { gap: .7rem; }

/* ── CTA Section ─────────────────────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.cta-section h2 { color: var(--white); margin-bottom: .75rem; }
.cta-section p  { color: rgba(255,255,255,.8); margin-bottom: 2rem; max-width: 50ch; margin-inline: auto; }
.cta-section .btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: var(--blue-deep);
  padding: 4rem 0 0;
  color: rgba(255,255,255,.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand .brand-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .3rem;
}
.footer-brand .brand-sub {
  font-size: .7rem;
  letter-spacing: .12em;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-brand p { font-size: .88rem; line-height: 1.8; max-width: 38ch; }

.footer h4 { color: var(--white); font-size: .95rem; margin-bottom: 1rem; }

.footer-links { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size: .88rem;
  color: rgba(255,255,255,.65);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.footer-links a::before { content: '›'; color: var(--cyan); font-size: 1.1rem; }
.footer-links a:hover   { color: var(--white); padding-right: .25rem; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .9rem;
  font-size: .88rem;
}
.contact-item svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: .25rem; color: var(--cyan); }
.contact-item .ltr { direction: ltr; unicode-bidi: embed; }

.footer-bottom {
  padding: 1.25rem 0;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
}

/* ── Page Sections (non-home stubs) ──────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 4rem 0;
  text-align: center;
  color: var(--white);
}
.page-hero h1 { color: var(--white); font-size: clamp(1.5rem, 3vw, 2.2rem); }
.page-hero p  { color: rgba(255,255,255,.8); margin-top: .5rem; }

.page-content { padding: 4rem 0; min-height: 40vh; }

/* ── Shop ────────────────────────────────────────────────────────────────── */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }

.shop-sidebar {
  background: var(--white);
  border: 1px solid #e4eaf1;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 5rem;
}
.shop-sidebar h3 { font-size: .95rem; margin-bottom: 1rem; }

.filter-group { margin-bottom: 1.5rem; }
.filter-group label { display: flex; align-items: center; gap: .5rem; font-size: .88rem; cursor: pointer; padding: .3rem 0; }
.filter-group input[type=radio], .filter-group input[type=checkbox] { accent-color: var(--blue); }

.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: .88rem;
  color: var(--slate);
}

/* ── Product Detail ──────────────────────────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.product-detail-img { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); }
.product-detail-body {}
.product-detail-price { font-size: 1.6rem; font-weight: 700; color: var(--blue); margin: 1rem 0; }

/* ── Cart ────────────────────────────────────────────────────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: right; padding: .75rem 1rem; border-bottom: 2px solid var(--blue-light); font-size: .88rem; }
.cart-table td { padding: .75rem 1rem; border-bottom: 1px solid #edf2f7; font-size: .9rem; vertical-align: middle; }
.cart-summary { background: var(--blue-light); border-radius: var(--radius-md); padding: 1.5rem; }
.cart-summary h3 { margin-bottom: 1rem; }
.cart-total { font-size: 1.2rem; font-weight: 700; color: var(--blue); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: .4rem; color: var(--blue-deep); }
.form-control {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid #d1dbe7;
  border-radius: var(--radius-sm);
  font-family: 'Vazirmatn', sans-serif;
  font-size: .95rem;
  color: var(--blue-deep);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21,101,192,.12);
}
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.gallery-item { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-item:hover img { transform: scale(1.06); }

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.faq-item {
  border-bottom: 1px solid #e4eaf1;
  padding: 1.25rem 0;
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  color: var(--blue-deep);
  font-size: .95rem;
}
.faq-answer {
  padding-top: .75rem;
  font-size: .9rem;
  line-height: 1.8;
  display: none;
}
.faq-item.open .faq-answer { display: block; }
.faq-chevron { transition: transform .3s; flex-shrink: 0; width: 18px; height: 18px; color: var(--blue); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  margin-top: .75rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,.7); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb .sep { opacity: .4; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-danger   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-info     { background: var(--blue-light); border: 1px solid rgba(21,101,192,.2); color: var(--blue); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2.5rem; }
.page-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid #d1dbe7;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem;
  color: var(--slate);
  transition: all var(--transition);
  cursor: pointer;
  background: var(--white);
}
.page-btn:hover, .page-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 0; min-height: calc(100vh - 120px); }
.admin-sidebar { background: var(--blue-deep); padding: 1.5rem 0; }
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.5rem;
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  transition: all var(--transition);
}
.admin-sidebar a:hover, .admin-sidebar a.active { color: var(--white); background: rgba(255,255,255,.08); }
.admin-main { padding: 2rem; }
.admin-main h2 { font-size: 1.3rem; margin-bottom: 1.5rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .features-grid   { grid-template-columns: repeat(2, 1fr); }
  .products-grid   { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .blog-grid       { grid-template-columns: repeat(2, 1fr); }
  .footer-grid     { grid-template-columns: 1fr 1fr; }
  .shop-layout     { grid-template-columns: 1fr; }
  .shop-sidebar    { position: static; }
}

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-content { order: 2; }
  .hero-image   { order: 1; }
  .hero-stats   { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .product-detail { grid-template-columns: 1fr; }
  .cart-layout    { grid-template-columns: 1fr; }
  .blog-grid      { grid-template-columns: 1fr; }
  .footer-grid    { grid-template-columns: 1fr; }
  .gallery-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .navbar-nav, .navbar-actions .btn { display: none; }
  .hamburger { display: flex; }
  .features-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; gap: 1rem; text-align: right; }
  .stat-item { display: flex; align-items: center; gap: 1rem; }
  .stat-num { font-size: 1.3rem; }
  .section { padding: 3rem 0; }
  .trust-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.2rem;
    align-items: center;
    justify-content: stretch;
  }
  .trust-item { justify-content: flex-start; white-space: normal; }
  .gallery-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

@media (max-width: 390px) {
  body { font-size: .95rem; }
  .container { padding-inline: 1rem; }
  .btn { padding: .6rem 1.2rem; font-size: .88rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-blue   { color: var(--blue); }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-0  { margin-bottom: 0; }
.ltr   { direction: ltr; unicode-bidi: embed; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.fw-700 { font-weight: 700; }
.c-blue { color: var(--blue); }
.c-slate{ color: var(--slate); }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* QA#168: no page-level horizontal overflow; cart table scrolls within itself on mobile */
html,body{ overflow-x:hidden; max-width:100%; }
@media (max-width:768px){ .cart-table{ display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; } }

/* QA#166/#167: stat numbers align to a fixed track (not content width) */
@media (max-width:640px){ .stat-item{ align-items:baseline !important; } .stat-num{ width:84px !important; flex-shrink:0; text-align:center; display:inline-block; } }

/* QA#203: product card action buttons stack full-width (side-by-side overflowed جزئیات on narrow grid cards) */
.product-card .product-body > div[style*="display:flex"]{ flex-direction:column !important; align-items:stretch !important; }
.product-card .product-body > div[style*="display:flex"] > form{ flex:none !important; }
.product-card .product-body > div[style*="display:flex"] .btn{ width:100% !important; }

/* QA#201: responsive cart table — card layout on mobile (5-col table overflowed; name column too narrow) */
@media (max-width:768px){
  .cart-table thead { display:none; }
  .cart-table, .cart-table tbody { display:block; width:100%; overflow:visible; }
  .cart-table tr { display:block; border:1px solid var(--blue-light); border-radius:var(--radius-md); margin-bottom:1rem; padding:.4rem .9rem; }
  .cart-table td { display:flex; justify-content:space-between; align-items:center; gap:1rem; width:100%; padding:.55rem .1rem; border:none; border-bottom:1px solid #eef3f8; white-space:normal !important; }
  .cart-table tr td:last-child { border-bottom:none; justify-content:flex-start; }
  .cart-table td[data-label]::before { content: attr(data-label); font-weight:600; color:var(--slate); font-size:.85rem; flex:0 0 auto; }
  .cart-table td:first-child { display:block; padding-bottom:.7rem; }
}

/* QA#202: add-to-cart toast */
.cart-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:#1a7a3a;color:#fff;padding:12px 22px;border-radius:10px;font-size:.95rem;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.2);opacity:0;pointer-events:none;transition:all .3s;z-index:99999;direction:rtl;max-width:90vw;text-align:center;}
.cart-toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
.cart-toast.err{background:#b91c1c;}
/* #B64 mobile-reachability fix 2026-09-03 */
@media (max-width:860px){
  main.adm-content,div.adm-wrap{min-width:0}
  div.adm-tw{overflow-x:auto;overflow-y:visible;max-width:100%}
}
