/*
 * face-detector/css/style.css
 * استایل مدرن، شیشه‌ای (Glassmorphism) و لوکس برای ابزار تشخیص فرم صورت
 * Version 2.0 – Enhanced with Steps, SVGs, Live Guide, FAQ, Upload
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&family=Outfit:wght@400;500;700;900&display=swap');

:root {
  --primary: #d39d4e;
  --primary-color: var(--primary);
  --primary-hover: #b8853d;
  --bg-dark: #0d0d0f;
  --bg-card: rgba(22, 22, 26, 0.7);
  --border-glass: rgba(255, 255, 255, 0.09);
  --text-light: #ffffff;
  --text-muted: #b5b5c0;
  --success-color: #2e7d32;
  --shadow-glow: rgba(211, 157, 78, 0.25);
  --danger: #c62828;
  --info: #1e88e5;
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Vazirmatn', 'Outfit', sans-serif;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  padding: 35px 20px;
  line-height: 1.6;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(211, 157, 78, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 45%);
}

.back-btn-container {
  max-width: 1100px;
  margin: 0 auto 24px auto;
  text-align: left;
}

.back-btn {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 13px;
  padding: 10px 22px;
  border: 1px solid var(--border-glass);
  text-decoration: none;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.back-btn:hover {
  background: rgba(211, 157, 78, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(211, 157, 78, 0.15);
  transform: translateX(-4px);
}

.container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.header,
.steps-section,
.detector-grid,
.faq-section {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   هدر صفحه
   ========================================================================== */
.header {
  text-align: center;
  margin-bottom: 20px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(211, 157, 78, 0.08);
  border: 1px solid rgba(211, 157, 78, 0.15);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

.header h1 {
  font-size: 36px;
  font-weight: 900;
  color: var(--text-light);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header h1 span {
  background: linear-gradient(135deg, #f5c842 30%, #d39d4e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(211, 157, 78, 0.3));
}

.header p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ==========================================================================
   بخش مراحل (Steps Section)
   ========================================================================== */
.steps-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 20px;
}

.step-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
  flex: 1;
  max-width: 240px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.55;
}

.step-item.active {
  opacity: 1;
  border-color: rgba(211, 157, 78, 0.25);
  background: rgba(211, 157, 78, 0.06);
  box-shadow: 0 8px 30px rgba(211, 157, 78, 0.08);
  transform: translateY(-2px);
}

.step-item.completed {
  opacity: 0.8;
  border-color: rgba(46, 125, 50, 0.3);
}

.step-number {
  position: absolute;
  top: -10px;
  right: -6px;
  width: 26px;
  height: 26px;
  background: var(--primary-color);
  color: #121214;
  font-size: 13px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--shadow-glow);
  transition: all 0.3s ease;
}

.step-item.completed .step-number {
  background: #4caf50;
}

.step-icon {
  margin-bottom: 10px;
}

.step-icon i {
  font-size: 26px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-item.active .step-icon i {
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--shadow-glow);
}

.step-item.completed .step-icon i {
  color: #4caf50;
}

.step-item h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 5px;
}

.step-item p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-connector {
  color: rgba(255, 255, 255, 0.15);
  font-size: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   شبکه بندی اصلی دو ستونه
   ========================================================================== */
.detector-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: start;
}

/* ==========================================================================
   جعبه دوربین (Camera Box)
   ========================================================================== */
.camera-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 25px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #050506;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* نوار پیشرفت اسکن طلایی نئونی */
.scan-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 5px;
  background: linear-gradient(90deg, #d39d4e, #f5c842, #d39d4e);
  box-shadow: 0 0 12px var(--shadow-glow);
  z-index: 10;
  transition: width 0.1s linear;
}
.scan-progress-bar.hidden {
  display: none;
}

/* نکات پیشرفت اسکن شناور */
.scan-tips {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(13, 13, 15, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(211, 157, 78, 0.3);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 90%;
  width: max-content;
  text-align: center;
  box-sizing: border-box;
}
.scan-tips.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}
.text-gold {
  color: #d39d4e;
}

/* اسکنر لیزری متحرک */
.scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent 5%, var(--primary-color) 50%, transparent 95%);
  box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scanner-line.active {
  opacity: 1;
  animation: laserScan 3s linear infinite;
}

@keyframes laserScan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* میرور کردن وبکم برای حس طبیعی‌تر */
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  object-fit: cover; /* انطباق دقیق مقیاس بوم لندمارک با ویدیو */
  transform: scaleX(-1); /* میرور کردن لندمارک‌ها منطبق با وبکم */
  pointer-events: none;
}

/* ==========================================================================
   راهنمای زنده (Live Guide)
   ========================================================================== */
.live-guide {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  max-width: 90%;
  width: max-content;
  text-align: center;
  animation: guideSlideUp 0.3s ease;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.live-guide.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

.live-guide i {
  font-size: 16px;
}

.live-guide.guide-warning {
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffd54f;
}

.live-guide.guide-success {
  border-color: rgba(76, 175, 80, 0.3);
  color: #81c784;
}

.live-guide.guide-error {
  border-color: rgba(244, 67, 54, 0.3);
  color: #ef5350;
}

@keyframes guideSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(15px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* لایه وضعیت روی دوربین */
.status-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 20, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 8;
  padding: 30px;
}

.status-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.status-icon {
  font-size: 40px;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--shadow-glow);
}

.status-overlay p {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 20px;
  font-weight: 700;
  text-align: center;
}

/* نشانگر اسکن ذخیره‌شده چهره */
.saved-scan-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  background: rgba(18, 18, 20, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: savedBadgeSlideDown 0.3s ease;
}

.saved-scan-indicator i {
  font-size: 17px;
  color: #4ade80;
}

@keyframes savedBadgeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* اسپینر لودینگ نئونی */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(211, 157, 78, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  box-shadow: 0 0 15px var(--shadow-glow);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   دکمه‌های کنترل
   ========================================================================== */
.control-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: #121214;
  box-shadow: 0 4px 15px var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 157, 78, 0.35);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: #c62828;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(198, 40, 40, 0.2);
}

.btn-secondary:hover {
  background: #b71c1c;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 40, 40, 0.35);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   بخش آپلود عکس (Upload Section)
   ========================================================================== */
.upload-section {
  margin-top: 20px;
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}

.upload-divider span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.upload-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .upload-options-grid {
    grid-template-columns: 1fr;
  }
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  color: var(--text-light);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-sizing: border-box;
}

.btn-upload-camera {
  background: rgba(211, 157, 78, 0.09);
  border: 1.5px solid rgba(211, 157, 78, 0.35);
  color: #ffffff;
}

.btn-upload-camera:hover {
  background: rgba(211, 157, 78, 0.18);
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(211, 157, 78, 0.2);
  transform: translateY(-2px);
}

.btn-upload-gallery {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
}

.btn-upload-gallery:hover {
  background: rgba(211, 157, 78, 0.08);
  border-color: rgba(211, 157, 78, 0.3);
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(211, 157, 78, 0.08);
  transform: translateY(-2px);
}

.btn-upload i {
  font-size: 17px;
  color: var(--primary-color);
}

.upload-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 8px;
  text-align: center;
}

/* ==========================================================================
   بخش نتایج (Results Section)
   ========================================================================== */
.results-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 30px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  height: 100%;
  transition: all 0.5s ease;
}

.results-box.hidden {
  opacity: 0;
  transform: translateY(20px);
}

.result-header-label {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

/* انیمیشن و ظاهر آیکون فرم‌های صورت (SVG) */
.shape-icons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

/* بخش نوار اطمینان */
.confidence-section {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.confidence-value {
  font-weight: 900;
  font-size: 14px;
  color: var(--primary-color);
}

.confidence-track {
  margin-top: 8px;
  height: 8px;
}

.confidence-fill {
  background: linear-gradient(90deg, #d39d4e, #f5c842, #d39d4e);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.shape-result-icon {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 14px 6px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* استایل آیکون‌های FontAwesome (برای سازگاری عقب‌گرد) */
.shape-result-icon i {
  font-size: 22px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

/* استایل SVGهای فرم صورت */
.shape-result-icon svg {
  width: 24px;
  height: 30px;
  fill: currentColor;
  color: var(--text-muted);
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 0 transparent);
}

/* هایلایت نئونی فرم صورت فعال */
.shape-result-icon.active {
  background: rgba(211, 157, 78, 0.12);
  border-color: var(--primary-color);
  color: var(--text-light);
  box-shadow: 0 0 25px rgba(211, 157, 78, 0.2);
  transform: translateY(-4px) scale(1.05);
}

.shape-result-icon.active i {
  color: var(--primary-color);
  text-shadow: 0 0 12px var(--shadow-glow);
  transform: scale(1.1);
}

.shape-result-icon.active svg {
  color: var(--primary-color);
  filter: drop-shadow(0 0 10px var(--shadow-glow));
  transform: scale(1.15);
}

.shape-pct {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.3s ease;
}

.shape-result-icon.active .shape-pct {
  background: rgba(211, 157, 78, 0.25);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(211, 157, 78, 0.2);
}

/* نمایش فکت‌های فرم چهره */
.shape-details-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 25px;
}

.shape-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.shape-details-card h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 0;
}

.hybrid-shape-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(211, 157, 78, 0.12);
  border: 1px solid rgba(211, 157, 78, 0.3);
  color: #f5c842;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(211, 157, 78, 0.2); }
  50% { box-shadow: 0 0 15px rgba(211, 157, 78, 0.4); }
}

.hybrid-shape-box {
  background: rgba(211, 157, 78, 0.06);
  border: 1px dashed rgba(211, 157, 78, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.hybrid-shape-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #f5c842;
  font-weight: 800;
  margin-bottom: 6px;
}

.hybrid-shape-box p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-bottom: 0;
}

.shape-details-card p {
  font-size: 13.5px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 15px;
}

/* بخش ویژگی‌های کلیدی نسبت لندمارک‌ها */
.metrics-section {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 20px;
  margin-bottom: 25px;
}

.metrics-section h3 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.ratio-item {
  margin-bottom: 15px;
}

.ratio-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-light);
}

.ratio-label {
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--shadow-glow);
}

/* لیست فریم‌های پیشنهادی */
.rec-frame-list-wrapper {
  margin-bottom: 25px;
}

.rec-frame-list-wrapper h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rec-frame-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rec-frame-list li {
  background: rgba(46, 125, 50, 0.08);
  border: 1px solid rgba(46, 125, 50, 0.2);
  color: #81c784;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rec-avoid-box {
  background: rgba(198, 40, 40, 0.05);
  border: 1px dashed rgba(198, 40, 40, 0.2);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 12.5px;
  color: #ef5350;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rec-avoid-box i {
  margin-top: 3px;
}

/* ==========================================================================
   دکمه‌های عملیات نتایج (Lock + Screenshot)
   ========================================================================== */
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 5px;
}

.btn-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-lock {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}

.btn-lock:hover {
  background: rgba(211, 157, 78, 0.1);
  border-color: rgba(211, 157, 78, 0.25);
  color: var(--primary-color);
}

.btn-lock.locked {
  background: rgba(211, 157, 78, 0.15);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 12px rgba(211, 157, 78, 0.12);
}

.btn-lock.locked i {
  animation: lockPulse 1.5s ease-in-out infinite;
}

@keyframes lockPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.btn-screenshot {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}

.btn-screenshot:hover {
  background: rgba(30, 136, 229, 0.1);
  border-color: rgba(30, 136, 229, 0.3);
  color: var(--info);
}

.btn-screenshot.saving {
  pointer-events: none;
  opacity: 0.6;
}

/* ==========================================================================
   بخش محصولات پیشنهادی (Recommended Glasses)
   ========================================================================== */
.recommended-glasses {
  margin-top: 45px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 40px;
}

.rec-header-wrapper {
  text-align: center;
  margin-bottom: 30px;
}

.recommended-glasses h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text-light);
}

.recommended-glasses h2 span {
  color: var(--primary-color);
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rec-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

/* کنترل‌های فیلتر هوشمند: نوع عینک + جنسیت */
.rec-filters-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

/* ردیف نوع عینک (همه / طبی / آفتابی) */
.rec-type-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border-glass);
}

.rec-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rec-type-btn i {
  font-size: 13px;
}

.rec-type-btn:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
}

.rec-type-btn.active {
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  color: #121214;
  box-shadow: 0 4px 15px rgba(211, 157, 78, 0.3);
}

/* ردیف تفکیک جنسیت (چیپ‌های سریع) */
.rec-gender-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.rec-gender-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
}

.rec-gender-btn i {
  font-size: 11px;
}

.rec-gender-btn:hover {
  color: var(--text-light);
  border-color: rgba(211, 157, 78, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.rec-gender-btn.active {
  background: rgba(211, 157, 78, 0.15);
  color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(211, 157, 78, 0.15);
}

/* شبکه کارت‌های محصولات */
.glasses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 24px;
}

.glass-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.glass-product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(211, 157, 78, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 25px rgba(211, 157, 78, 0.12);
}

.glass-product-image {
  background: #ffffff;
  padding: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.glass-badges-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.glass-brand-badge {
  background: rgba(18, 18, 20, 0.9);
  color: #e5b56e;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 7px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  border: 1px solid rgba(229, 181, 110, 0.2);
}

.glass-meta-badge {
  background: rgba(240, 240, 245, 0.95);
  color: #222;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.glass-product-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transform: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-product-card:hover .glass-product-image img {
  transform: scale(1.03);
}

.glass-product-info {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.glass-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.glass-style-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(211, 157, 78, 0.1);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(211, 157, 78, 0.25);
}

/* باکس هوشمند دلیل پیشنهاد (The Why Factor) */
.glass-why-box {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: linear-gradient(135deg, rgba(211, 157, 78, 0.08) 0%, rgba(30, 136, 229, 0.05) 100%);
  border: 1px dashed rgba(211, 157, 78, 0.3);
  padding: 8px 10px;
  border-radius: 9px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.glass-why-box i {
  color: var(--primary-color);
  font-size: 11.5px;
  margin-top: 2px;
  flex-shrink: 0;
}

.glass-why-box span {
  font-size: 11.5px;
  font-weight: 700;
  color: #e0d0b8;
}

.glass-product-info h3 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-light);
  margin: 0 0 6px 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 42px;
}

.glass-sku-code {
  font-size: 11.5px;
  color: var(--text-muted);
}

.glass-sku-code span {
  color: #bbb;
  font-family: monospace;
}

/* قیمت‌ها */
.glass-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.glass-price-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.glass-price-old {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.glass-price-old del {
  color: #777;
}

.glass-discount-badge {
  background: rgba(239, 83, 80, 0.18);
  color: #ff6b6b;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(239, 83, 80, 0.35);
}

.glass-price-current {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary-color);
  letter-spacing: -0.2px;
}

/* دکمه‌های کارت */
.glass-card-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.glass-buy-btn i {
  font-size: 12px;
  transition: transform 0.25s ease;
}

.glass-product-card:hover .glass-buy-btn {
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  color: #121214;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(211, 157, 78, 0.3);
}

.glass-buy-btn:hover i,
.glass-product-card:hover .glass-buy-btn i {
  transform: translateX(-4px);
}

/* بنر هوشمند خروجی به فروشگاه و مشاهده همه مدل‌ها */
.rec-more-wrapper {
  margin-top: 40px;
}

.rec-more-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(211, 157, 78, 0.06) 100%);
  border: 1px solid rgba(211, 157, 78, 0.3);
  border-radius: 20px;
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  flex-wrap: wrap;
}

.rec-more-info {
  flex: 1;
  min-width: 260px;
  text-align: right;
}

.rec-more-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(211, 157, 78, 0.15);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.rec-more-info h3 {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-light);
  margin: 0 0 6px 0;
}

.rec-more-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.rec-browse-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  color: #121214;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(211, 157, 78, 0.25);
  white-space: nowrap;
}

.rec-browse-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(211, 157, 78, 0.4);
}

.rec-browse-all-btn i {
  transition: transform 0.25s ease;
}

.rec-browse-all-btn:hover i {
  transform: translateX(-4px);
}

/* چیپ‌های اختصاصی فرم‌های فریم داخل بنر */
.rec-shape-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.rec-shape-pills-title {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-left: 4px;
}

.rec-shape-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(211, 157, 78, 0.25);
  color: #e5b56e;
  padding: 5px 12px;
  border-radius: 18px;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.25s ease;
}

.rec-shape-pill:hover {
  background: rgba(211, 157, 78, 0.18);
  border-color: var(--primary-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(211, 157, 78, 0.15);
}

.rec-shape-pill i {
  font-size: 10px;
  color: var(--primary-color);
}

/* استایل اسکلت بارگذاری (Skeleton Loading) */
.skeleton-card {
  pointer-events: none;
  opacity: 0.7;
}

.skeleton-box,
.skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-weight: 700;
  border: 1.5px dashed var(--border-glass);
  border-radius: 16px;
}

/* ==========================================================================
   بخش سوالات متداول (FAQ)
   ========================================================================== */
.faq-section {
  margin-top: 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 40px;
  padding-bottom: 30px;
}

.faq-section h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(211, 157, 78, 0.15);
}

.faq-item[open] {
  border-color: rgba(211, 157, 78, 0.2);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.faq-item summary {
  padding: 18px 22px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::marker {
  display: none;
  content: '';
}

.faq-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-right: auto;
  margin-left: 0;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.faq-item summary:hover {
  color: var(--primary-color);
}

.faq-answer {
  padding: 0 22px 18px 22px;
  animation: faqFadeIn 0.3s ease;
}

.faq-answer p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.8;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 15px;
}

@keyframes faqFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ریسپانسیو دسکتاپ و موبایل (Mobile & Tablet Experience)
   ========================================================================== */

/* بهینه‌سازی تاچ و دکمه‌ها برای موبایل */
button, a, .shape-result-icon, .faq-item summary, .btn-upload, .rec-type-btn, .rec-gender-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:active, 
.btn-primary:active, 
.btn-secondary:active, 
.btn-upload:active, 
.rec-type-btn:active, 
.rec-gender-btn:active, 
.rec-browse-all-btn:active,
.glass-buy-btn:active {
  transform: scale(0.97) !important;
}

@media (max-width: 992px) {
  .detector-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  body {
    padding: 24px 14px;
  }
  .header h1 {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 14px 10px;
  }

  .back-btn-container {
    margin-bottom: 14px;
    display: flex;
    justify-content: flex-start;
  }

  .back-btn {
    font-size: 11.5px;
    padding: 7px 14px;
    border-radius: 8px;
  }

  /* هدر در موبایل */
  .header {
    margin-bottom: 18px;
  }

  .header-badge {
    font-size: 10.5px;
    padding: 4px 12px;
    margin-bottom: 10px;
  }

  .header h1 {
    font-size: 21px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.35;
  }

  .header p {
    font-size: 12px;
    line-height: 1.6;
    padding: 0 4px;
  }

  /* استپر افقی فشرده برای موبایل */
  .steps-section {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 6px;
    padding: 0;
    margin-bottom: 18px;
    width: 100%;
  }

  .step-connector {
    display: none;
  }

  .step-item {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 8px 3px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    background: rgba(22, 22, 26, 0.6);
  }

  .step-number {
    position: static;
    width: 18px;
    height: 18px;
    font-size: 10px;
    margin-bottom: 2px;
    box-shadow: none;
  }

  .step-icon {
    display: none;
  }

  .step-item h3 {
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  .step-item p {
    display: none;
  }

  /* دوربین در موبایل - جلوگیری از زوم شدن افراطی */
  .camera-box, .results-box {
    padding: 14px 12px;
    border-radius: 16px;
    width: 100%;
  }

  .video-wrapper {
    aspect-ratio: 4/3;
    max-height: 340px;
    min-height: 220px;
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .live-guide {
    max-width: 90%;
    padding: 6px 12px;
    font-size: 11px;
    bottom: 8px;
    border-radius: 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  .scan-tips {
    font-size: 11px;
    padding: 6px 10px;
    top: 8px;
    max-width: 88%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  .control-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    padding: 11px 16px;
    font-size: 13px;
    border-radius: 10px;
  }

  .upload-section {
    margin-top: 12px;
  }

  .upload-divider {
    margin-bottom: 10px;
  }

  .btn-upload {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 10px;
  }

  /* باکس نتایج و نوار افقی سوایپ فرم‌های ۷ گانه صورت */
  .result-header-label {
    font-size: 11.5px;
    margin-bottom: 8px;
  }

  .shape-icons-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 2px 2px 8px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(211, 157, 78, 0.4) transparent;
    width: 100%;
  }

  .shape-icons-grid::-webkit-scrollbar {
    height: 3px;
  }

  .shape-icons-grid::-webkit-scrollbar-thumb {
    background: rgba(211, 157, 78, 0.3);
    border-radius: 3px;
  }

  .shape-result-icon {
    flex: 0 0 72px;
    scroll-snap-align: start;
    padding: 9px 2px;
    font-size: 10px;
    gap: 4px;
    border-radius: 12px;
  }

  .shape-result-icon svg {
    width: 19px;
    height: 23px;
  }

  .shape-result-icon i {
    font-size: 17px;
  }

  .shape-pct {
    font-size: 9px;
    padding: 2px 5px;
  }

  .confidence-section {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
  }

  .confidence-value {
    font-size: 13px;
  }

  .shape-details-card {
    padding: 12px 10px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .shape-details-card h2 {
    font-size: 16px;
  }

  .hybrid-shape-badge {
    font-size: 9.5px;
    padding: 2px 8px;
  }

  .shape-details-card p {
    font-size: 11.5px;
    line-height: 1.6;
    margin-bottom: 10px;
  }

  .hybrid-shape-box {
    padding: 8px 10px;
    margin-bottom: 12px;
  }

  .hybrid-shape-header {
    font-size: 11.5px;
  }

  .hybrid-shape-box p {
    font-size: 11px;
  }

  .rec-frame-list-wrapper {
    margin-bottom: 14px;
  }

  .rec-frame-list-wrapper h3 {
    font-size: 11.5px;
    margin-bottom: 6px;
  }

  .rec-frame-list li {
    font-size: 10.5px;
    padding: 3px 8px;
  }

  .rec-avoid-box {
    padding: 8px 10px;
    font-size: 11px;
  }

  .metrics-section {
    padding-top: 12px;
    margin-bottom: 14px;
  }

  .metrics-section h3 {
    font-size: 11.5px;
    margin-bottom: 10px;
  }

  .ratio-item {
    margin-bottom: 10px;
  }

  .ratio-info {
    font-size: 10.5px;
  }

  .result-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn-action {
    padding: 10px 14px;
    font-size: 12px;
  }

  /* بخش محصولات پیشنهادی در موبایل */
  .recommended-glasses {
    margin-top: 25px;
    padding-top: 20px;
  }

  .rec-header-wrapper {
    margin-bottom: 16px;
  }

  .recommended-glasses h2 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .rec-subtitle {
    font-size: 11.5px;
    line-height: 1.55;
    margin-bottom: 14px;
    padding: 0 4px;
  }

  /* تب‌های فیلتر هوشمند */
  .rec-filters-holder {
    width: 100%;
    max-width: 100%;
    gap: 8px;
    margin-bottom: 16px;
  }

  .rec-type-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    padding: 3px;
    border-radius: 10px;
    gap: 3px;
    background: rgba(255, 255, 255, 0.04);
  }

  .rec-type-btn {
    flex: 1;
    min-width: 0;
    padding: 7px 3px;
    font-size: 10.5px;
    font-weight: 800;
    justify-content: center;
    border-radius: 7px;
    white-space: nowrap;
    gap: 3px;
  }

  .rec-type-btn i {
    font-size: 10px;
  }

  .rec-gender-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    gap: 5px;
    padding: 2px 0 4px 0;
    scrollbar-width: none;
  }

  .rec-gender-tabs::-webkit-scrollbar {
    display: none;
  }

  .rec-gender-btn {
    flex: 1 0 auto;
    padding: 5px 9px;
    font-size: 10.5px;
    justify-content: center;
    white-space: nowrap;
    border-radius: 14px;
  }

  /* گرید محصولات پیشنهادی در موبایل */
  .glasses-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .glass-product-card {
    border-radius: 16px;
  }

  .glass-product-image {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .glass-product-info {
    padding: 12px 14px;
    gap: 10px;
  }

  .glass-product-info h3 {
    font-size: 13px;
    height: auto;
    min-height: unset;
  }

  .glass-why-box {
    padding: 6px 8px;
    font-size: 10.5px;
    border-radius: 8px;
  }

  .glass-why-box span {
    font-size: 10.5px;
  }

  .glass-card-bottom {
    padding-top: 10px;
    gap: 8px;
  }

  .glass-price-current {
    font-size: 14.5px;
  }

  .glass-buy-btn {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(211, 157, 78, 0.18) 0%, rgba(211, 157, 78, 0.08) 100%);
    border: 1px solid rgba(211, 157, 78, 0.35);
    color: #e5b56e;
  }

  .glass-buy-btn:active {
    background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
    color: #121214;
  }

  /* بنر انتهای کاتالوگ در موبایل */
  .rec-more-wrapper {
    margin-top: 22px;
  }

  .rec-more-banner {
    padding: 16px 12px;
    border-radius: 14px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .rec-more-info {
    text-align: center;
    min-width: 0;
  }

  .rec-more-info h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .rec-more-info p {
    font-size: 11px;
    line-height: 1.5;
  }

  .rec-shape-pills-row {
    justify-content: center;
    gap: 4px;
  }

  .rec-shape-pill {
    padding: 3px 8px;
    font-size: 10px;
  }

  .rec-browse-all-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 9px;
    white-space: normal;
    text-align: center;
  }

  /* سوالات متداول در موبایل */
  .faq-section {
    margin-top: 25px;
    padding-top: 20px;
  }

  .faq-section h2 {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .faq-item summary {
    padding: 11px 13px;
    font-size: 12px;
  }

  .faq-answer {
    padding: 0 13px 11px 13px;
  }

  .faq-answer p {
    font-size: 11px;
    line-height: 1.65;
    padding-top: 8px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 8px;
  }

  .header h1 {
    font-size: 19px;
  }

  .camera-box, .results-box {
    padding: 12px 8px;
    border-radius: 14px;
  }

  .video-wrapper {
    aspect-ratio: 4/3;
    max-height: 290px;
    border-radius: 12px;
  }

  .shape-result-icon {
    flex: 0 0 66px;
    padding: 8px 2px;
    font-size: 9.5px;
  }

  .shape-result-icon svg {
    width: 18px;
    height: 22px;
  }

  .glass-product-image {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .rec-type-btn {
    padding: 6px 2px;
    font-size: 10px;
    gap: 2px;
  }

  .rec-type-btn i {
    font-size: 9.5px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 8px 5px;
  }

  .header h1 {
    font-size: 17px;
  }

  .header-badge {
    font-size: 9.5px;
    padding: 3px 9px;
  }

  .step-item h3 {
    font-size: 9px;
  }

  .video-wrapper {
    max-height: 250px;
  }

  .shape-result-icon {
    flex: 0 0 60px;
    font-size: 9px;
  }
}

/* ==========================================================================
   مودال راهنمای دوربین موبایل و شبکه محلی
   ========================================================================== */
.camera-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
}

.camera-help-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.camera-help-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.camera-help-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: #141419;
  border: 1px solid rgba(211, 157, 78, 0.25);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(211, 157, 78, 0.1);
  padding: 24px;
  color: #fff;
  z-index: 2;
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.camera-help-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.camera-help-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(211, 157, 78, 0.12);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.camera-help-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex: 1;
  margin: 0;
}

.camera-help-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.camera-help-close:hover {
  background: rgba(230, 80, 80, 0.2);
  color: #fff;
  border-color: rgba(230, 80, 80, 0.4);
}

.camera-help-body {
  padding: 16px 0;
}

.camera-help-alert {
  background: rgba(245, 197, 66, 0.08);
  border: 1px solid rgba(245, 197, 66, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #f1f1f1;
}

.camera-help-alert i {
  color: #f5c842;
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.camera-help-alert-content strong {
  display: block;
  font-size: 13.5px;
  color: #f5c842;
  margin-bottom: 4px;
}

.camera-help-alert code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: #f5c842;
  direction: ltr;
  display: inline-block;
  font-size: 12px;
}

.camera-help-subhead {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-help-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-opt-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.6;
}

.help-opt-card.featured {
  background: rgba(211, 157, 78, 0.06);
  border-color: rgba(211, 157, 78, 0.3);
  position: relative;
}

.opt-badge {
  display: inline-block;
  background: var(--primary-color);
  color: #121214;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.help-opt-card h5 {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.help-opt-card p {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 12px;
}

.btn-help-capture {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 18px;
  background: linear-gradient(135deg, #f5c842, #d39d4e);
  color: #121214;
  font-weight: 800;
  font-size: 13.5px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(211, 157, 78, 0.3);
  margin-top: 4px;
}

.btn-help-capture:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 157, 78, 0.45);
}

.help-steps-list {
  padding-right: 18px;
  margin: 6px 0;
  color: var(--text-muted);
}

.help-steps-list li {
  margin-bottom: 8px;
}

.copy-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  direction: ltr;
  text-align: left;
  user-select: all;
  font-size: 11.5px;
  color: #81c784;
}

.copy-box code {
  color: #81c784;
  word-break: break-all;
}

.camera-help-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
  text-align: left;
}

.btn-help-ok {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 8px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-help-ok:hover {
  background: rgba(255, 255, 255, 0.15);
}
