/* ==========================================================================
   HooshAmoozan - Minimal Design System
   Inspired by dicode.ir/mag - Clean, Minimal, RTL
   ========================================================================== */

/* Performance */
img { content-visibility: auto; }
* { will-change: auto; }

/* Design Tokens */
:root {
  --bg-body: #0f1117;
  --bg-surface: #181a20;
  --bg-surface-hover: #1e2028;
  --bg-elevated: #23252d;
  --bg-header: rgba(15, 17, 23, 0.92);
  --border: #2a2d37;
  --border-hover: #3a3d47;
  --text-primary: #eaedf3;
  --text-secondary: #8b8fa3;
  --text-tertiary: #5c6070;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-muted: rgba(59, 130, 246, 0.12);
  --accent-text: #60a5fa;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;
  --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg-body: #f8f9fb;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f3f4f6;
  --bg-elevated: #f0f1f3;
  --bg-header: rgba(248, 249, 251, 0.92);
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent-muted: rgba(59, 130, 246, 0.08);
  --accent-text: #2563eb;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover, a:focus, a:active { text-decoration: none; color: var(--accent-text); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Typography */
.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: none;
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
  color: var(--accent-text);
}
.btn-outline {
  background: transparent;
  color: var(--accent-text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent-text);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px;
}
.btn-ghost:hover {
  color: var(--accent-text);
  background: var(--accent-muted);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge-primary { background: var(--accent-muted); color: var(--accent-text); }
.badge-success { background: rgba(34,197,94,0.12); color: #4ade80; }
.badge-warning { background: rgba(234,179,8,0.12); color: #facc15; }
.badge-purple { background: rgba(139,92,246,0.12); color: #a78bfa; }
[data-theme="light"] .badge-success { color: #16a34a; }
[data-theme="light"] .badge-warning { color: #ca8a04; }
[data-theme="light"] .badge-purple { color: #7c3aed; }

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease);
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: none;
  transform: translateY(-2px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  flex-shrink: 0;
}
.brand-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  transition: transform 0.25s var(--ease);
}
.brand-logo:hover img {
  transform: scale(1.05);
}
.brand-logo:hover { color: var(--text-primary); }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}
.nav-link svg { width: 18px; height: 18px; stroke-width: 1.5; }
.nav-link:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-link.active { color: var(--accent-text); background: var(--accent-muted); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.5; }
.icon-btn:hover { color: var(--accent-text); background: var(--accent-muted); }
.mobile-toggle { display: none; }

/* Theme Toggle Icons - Strict Single Icon Display */
.theme-icon-sun { display: block !important; }
.theme-icon-moon { display: none !important; }
[data-theme="light"] .theme-icon-sun { display: none !important; }
[data-theme="light"] .theme-icon-moon { display: block !important; }

/* Cart Header Badge */
.cart-btn-header {
  position: relative;
}
.cart-badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--accent-muted);
  color: var(--accent-text);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero-label svg { width: 16px; height: 16px; }
.hero h1 {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.8;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Stats Row */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-item .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-text);
}
.stat-item .stat-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Section */
.section { padding: 64px 0; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.section-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title h2 svg { width: 22px; height: 22px; stroke-width: 1.5; color: var(--accent-text); }
.section-title p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--accent-text);
  font-weight: 600;
  flex-shrink: 0;
  text-decoration: none !important;
  transition: all var(--duration) var(--ease);
}
.section-link:hover {
  text-decoration: none !important;
  color: var(--accent-hover);
}
.section-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration) var(--ease);
}
.section-link:hover svg {
  transform: translateX(-4px);
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.feature-card { padding: 24px; text-align: center; }
.feature-card .feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.feature-card .feature-icon svg { width: 22px; height: 22px; stroke-width: 1.5; }
.feature-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.7; }

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card .product-thumb {
  position: relative;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}
.product-card .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.product-card:hover .product-thumb img { transform: scale(1.04); }
.product-card .discount-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-body .product-cat { margin-bottom: 8px; align-self: flex-start; }
.product-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; line-height: 1.5; }
.product-body .product-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
  min-height: 38px;
}
.product-body .product-features {
  margin-bottom: 14px;
  flex: 1;
}
.product-body .product-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.product-body .product-features li svg { width: 14px; height: 14px; color: var(--success); flex-shrink: 0; }
.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.price-box { display: flex; flex-direction: column; }
.old-price { font-size: 0.75rem; color: var(--text-tertiary); text-decoration: line-through; }
.current-price { font-size: 1.05rem; font-weight: 800; color: var(--accent-text); }

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.article-card { display: flex; flex-direction: column; }
.article-card .article-thumb {
  height: 190px;
  overflow: hidden;
  position: relative;
}
.article-card .article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.article-card:hover .article-thumb img { transform: scale(1.04); }
.article-card .article-cat { position: absolute; top: 10px; right: 10px; }
.article-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-body h3 { font-size: 1rem; font-weight: 700; line-height: 1.6; margin-bottom: 6px; }
.article-body .article-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.article-meta svg { width: 14px; height: 14px; }

/* Videos Grid & Clickable Cards */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.video-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.video-card-link:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: none;
}
.video-card-link:hover .video-card-title {
  color: var(--primary) !important;
}
.video-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: var(--bg-elevated);
  overflow: hidden;
  isolation: isolate;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.video-card-thumbnail,
.video-card-embed,
.video-card-preview iframe,
.video-card-media-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
}
.video-card-thumbnail {
  object-fit: cover;
  object-position: center;
}
.video-card-embed,
.video-card-preview iframe {
  pointer-events: none;
  background: transparent;
}
.video-card-media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.38);
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.video-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  z-index: 2;
}
.video-card-link:hover .video-play-overlay {
  background: rgba(0, 0, 0, 0.45);
}
.video-play-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease;
}
.video-card-link:hover .video-play-btn {
  transform: scale(1.18);
  background: var(--primary);
  box-shadow: none;
}
.video-card-body { padding: 18px 20px; }
.video-card-body .video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.video-card-body h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.video-card-body p { font-size: 0.86rem; color: var(--text-secondary); }
.aparat-container {
  width: 100%;
  min-width: 0;
  line-height: 0;
  overflow: hidden;
  background: transparent;
}
.aparat-embed-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  line-height: 0;
}
.aparat-embed-wrapper iframe,
.aparat-player-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.tool-icon img { width: 32px; height: 32px; object-fit: contain; }
.tool-info { flex: 1; min-width: 0; }
.tool-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-info p { font-size: 0.8rem; color: var(--text-secondary); margin: 4px 0 10px; line-height: 1.6; }

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; }
.footer-col p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.8; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}
.footer-col ul li a:hover { color: var(--accent-text); padding-right: 4px; }
.footer-social { display: flex; gap: 6px; margin-top: 16px; }
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}
.modal-backdrop.active { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  padding: 24px;
  box-shadow: none;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--duration) var(--ease);
}
.modal-backdrop.active .modal-card { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header h3 svg { width: 20px; height: 20px; color: var(--accent-text); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* Form */
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--duration) var(--ease);
  outline: none;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-tertiary); }
.form-group { margin-bottom: 12px; }

/* Liquid Canvas */
#liquid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* ==========================================================================
   Responsive & Mobile Design System
   ========================================================================== */

/* Utility Classes for Responsiveness */
.desktop-only { display: inline-flex !important; }
.mobile-only { display: none !important; }

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  
  /* Layout & Container - Enhanced Typography */
  html { font-size: 17px; }
  body { font-size: 1rem; line-height: 1.8; }
  .container { padding: 0 18px; }
  .section { padding: 42px 0; }

  /* Header */
  .header-inner { height: 64px; gap: 12px; }
  .nav-menu { display: none; }
  .mobile-toggle { display: flex; width: 44px; height: 44px; }
  .brand-logo { font-size: 1.15rem; gap: 10px; font-weight: 800; }
  .brand-logo img { width: 38px; height: 38px; }
  .header-actions { gap: 10px; }
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn svg { width: 22px; height: 22px; }

  /* Buttons & Inputs */
  .btn {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
  }
  .form-control, .input-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
    min-height: 50px;
    font-size: 1.02rem !important;
    padding: 12px 16px !important;
  }
  .badge {
    font-size: 0.88rem;
    padding: 5px 12px;
    font-weight: 700;
  }

  /* Hero Section */
  .hero { padding: 48px 0 36px; }
  .hero-bg { width: 380px; height: 380px; }
  .hero-label { font-size: 0.9rem; padding: 6px 14px; margin-bottom: 18px; font-weight: 700; }
  .hero h1 { font-size: 2.05rem; line-height: 1.45; margin-bottom: 16px; font-weight: 900; }
  .hero p { font-size: 1.05rem; line-height: 1.85; margin-bottom: 26px; color: var(--text-secondary); }
  .hero-actions { width: 100%; gap: 14px; }
  .hero-actions .btn { width: 100%; max-width: 100%; font-size: 1.02rem; min-height: 50px; }

  /* Stats Row */
  .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
  }
  .stat-item .stat-value { font-size: 1.45rem; font-weight: 900; }
  .stat-item .stat-label { font-size: 0.85rem; font-weight: 600; }

  /* Grids & Cards */
  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .products-grid, .articles-grid, .videos-grid, .tools-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .product-detail-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .form-grid-2 { grid-template-columns: 1fr !important; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 26px;
  }
  .section-title h2 { font-size: 1.5rem; font-weight: 800; }
  .section-title p { font-size: 0.96rem; }

  /* Product & Article Details on Mobile */
  .product-card .product-thumb { height: 210px; }
  .article-card .article-thumb { height: 200px; }
  .product-card .product-title, .article-card .article-title { font-size: 1.15rem; font-weight: 800; line-height: 1.5; }
  .product-card .product-price { font-size: 1.15rem; font-weight: 800; }
  .product-card { padding: 18px; border-radius: var(--radius-lg); }

  /* Mobile Drawer Links */
  .mobile-drawer .nav-link {
    font-size: 1.05rem;
    padding: 12px 14px;
    min-height: 48px;
    font-weight: 600;
  }

  /* Footer on Mobile */
  .site-footer { padding: 44px 0 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; margin-bottom: 26px; }
  .footer-bottom { font-size: 0.9rem; padding-top: 20px; }

  /* Modals on Mobile */
  .modal-card {
    width: calc(100% - 24px);
    max-height: 90vh;
    padding: 24px 18px;
    margin: 12px auto;
  }
  .modal-header h3 { font-size: 1.25rem; font-weight: 800; }
}

@media (max-width: 480px) {
  html { font-size: 16.5px; }
  body { font-size: 1rem; }
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.85rem; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-item .stat-value { font-size: 1.3rem; }
  .stat-item .stat-label { font-size: 0.8rem; }
  .card { border-radius: var(--radius-lg); padding: 22px 18px; }
  .btn { min-height: 50px; font-size: 1.02rem; }
  .form-control, .input-control { min-height: 50px; font-size: 1.02rem !important; }
}

/* Mobile header hardening: the admin shortcut already exists inside the drawer,
   so keeping the desktop admin CTA in the toolbar only steals horizontal space.
   Compact actions ensure the hamburger never gets pushed outside the viewport. */
@media (max-width: 768px) {
  .site-header { width: 100%; max-width: 100vw; overflow-x: clip; }
  .header-inner { min-width: 0; height: 60px; gap: 8px; }
  .header-inner .brand-logo { min-width: 0; font-size: 1rem; gap: 8px; }
  .header-inner .brand-logo img { width: 36px; height: 36px; flex: 0 0 36px; }
  .header-inner .brand-logo span {
    min-width: 0;
    max-width: 104px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .header-actions { min-width: 0; gap: 4px; }
  .header-actions .icon-btn { width: 40px; height: 40px; flex: 0 0 40px; }
  .header-actions .icon-btn svg { width: 21px; height: 21px; }
  .admin-header-shortcut { display: none !important; }
  .mobile-toggle { display: flex; }
}
@media (max-width: 480px) {
  .site-header .container { padding-inline: 12px; }
  .header-inner { height: 58px; gap: 6px; }
  .header-inner .brand-logo { font-size: 0.96rem; gap: 7px; }
  .header-inner .brand-logo img { width: 34px; height: 34px; flex-basis: 34px; }
  .header-inner .brand-logo span { max-width: 92px; }
  .header-actions { gap: 2px; }
  .header-actions .icon-btn { width: 38px; height: 38px; flex-basis: 38px; }
  .mobile-toggle { width: 38px !important; height: 38px !important; }
}
@media (max-width: 360px) {
  .header-inner .brand-logo span { display: none; }
}

/* Mobile Drawer (Enhanced & 100% RTL Compatible) */
/* Mobile drawers are a small-screen component only. Keeping them out of
   desktop layout also prevents a first-paint slide when the async stylesheet
   becomes active during the boot skeleton. */
@media (min-width: 769px) {
  .mobile-drawer, .mobile-overlay { display: none !important; }
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 310px);
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 9999;
  padding: 20px 16px;
  transform: translateX(110%);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.mobile-drawer.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  box-shadow: none;
}
.mobile-drawer .drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer .nav-link {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-drawer .nav-link svg {
  width: 18px;
  height: 18px;
  color: var(--accent-text);
  flex-shrink: 0;
}
.mobile-drawer .nav-link:hover,
.mobile-drawer .nav-link.active {
  background: var(--accent-muted);
  color: var(--accent-text);
}
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}
body.ha-drawer-ready .mobile-drawer {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0s linear 0.3s;
}
body.ha-drawer-ready .mobile-drawer.active {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0s linear 0s;
}
body.ha-drawer-ready .mobile-overlay {
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
body.ha-drawer-ready .mobile-overlay.active {
  transition: opacity 0.3s var(--ease), visibility 0s linear 0s;
}
.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Scroll Animation (Instant display for fast speed) */
[data-animate] {
  opacity: 1 !important;
  transform: none !important;
}

/* ===================================================
   Article Like Button & Interactive Reactions
   =================================================== */
.article-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  box-shadow: none;
  user-select: none;
}
.article-like-btn:hover {
  border-color: rgba(236, 72, 153, 0.4);
  color: #ec4899;
  background: rgba(236, 72, 153, 0.06);
  transform: translateY(-2px);
}
.article-like-btn svg {
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.2s ease, stroke 0.2s ease;
}
.article-like-btn.liked {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
  box-shadow: none;
}
.article-like-btn.liked svg {
  fill: #ec4899;
  stroke: #ec4899;
  transform: scale(1.18);
}
.article-like-btn:active svg {
  transform: scale(0.9);
}

/* Floating/Sticky Action Bar for Articles */
.article-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 32px 0 24px;
}

/* ===================================================
   Comments System, Nested Replies & Reactions
   =================================================== */
.comments-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-card {
  background: var(--bg-elevated);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.comment-card:hover {
  border-color: var(--border-hover);
}

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

.comment-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-meta-date {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.comment-body-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 8px 0 14px;
  padding-right: 48px;
  word-break: break-word;
}
@media (max-width: 640px) {
  .comment-body-text {
    padding-right: 0;
  }
}

/* Comment Action Bar (Reactions & Reply) */
.comment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.comment-reactions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
}
.btn-reaction:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-reaction.like:hover,
.btn-reaction.like.active {
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}
.btn-reaction.like.active svg {
  fill: #22c55e;
  stroke: #22c55e;
}

.btn-reaction.dislike:hover,
.btn-reaction.dislike.active {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.btn-reaction.dislike.active svg {
  fill: #ef4444;
  stroke: #ef4444;
}

.btn-reply-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent-text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-reply-toggle:hover {
  background: var(--accent-muted);
  border-color: rgba(99, 102, 241, 0.2);
}

/* Nested Replies Structure (Threaded) */
.comment-replies-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-right: 28px;
  padding-right: 16px;
  border-right: 2px solid var(--border);
  position: relative;
}
@media (max-width: 640px) {
  .comment-replies-list {
    margin-right: 12px;
    padding-right: 10px;
    border-right-width: 1.5px;
  }
}

.comment-reply-card {
  background: var(--bg-surface);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.comment-reply-card .comment-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}
.comment-reply-card .comment-body-text {
  font-size: 0.86rem;
  padding-right: 42px;
  margin: 6px 0 10px;
}
@media (max-width: 640px) {
  .comment-reply-card .comment-body-text {
    padding-right: 0;
  }
}

/* Inline Reply Form Box */
.inline-reply-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 10px;
  margin-right: 28px;
  box-shadow: none;
}
@media (max-width: 640px) {
  .inline-reply-box {
    margin-right: 0;
  }
}
.inline-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--accent-text);
  font-weight: 700;
}

/* ==========================================================================
   Shopping Cart Page Styles
   ========================================================================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}

.cart-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}
.cart-item-row:last-child {
  border-bottom: none;
}
.cart-item-row:hover {
  background: var(--bg-elevated);
}
.cart-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.cart-item-img {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-plan {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.cart-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 6px;
}
.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transition: all var(--duration) var(--ease);
}
.cart-qty-btn:hover {
  background: var(--accent-muted);
  color: var(--accent-text);
  border-color: var(--accent);
}
.cart-qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.cart-item-price {
  text-align: left;
  min-width: 110px;
}
.cart-item-total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-text);
}
.cart-item-unit {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.cart-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}
.cart-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Cart Summary Card */
.cart-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: sticky;
  top: 80px;
}
.cart-summary-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
}
.cart-summary-row.total-row {
  border-bottom: none;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}
.cart-summary-row.total-row .total-val {
  color: var(--accent-text);
  font-size: 1.25rem;
}

/* Coupon Box */
.coupon-box {
  margin: 18px 0;
}
.coupon-input-group {
  display: flex;
  gap: 8px;
}
.coupon-input-group input {
  flex: 1;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
}
.coupon-applied-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-md);
  margin-top: 8px;
  font-size: 0.82rem;
  color: #22c55e;
}
[data-theme="light"] .coupon-applied-badge {
  color: #16a34a;
}

/* Avatar Selector Grid */
.avatar-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.avatar-preset-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  padding: 3px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-preset-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-preset-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent);
  box-shadow: none;
}
.avatar-preset-btn.selected {
  border-color: var(--accent);
  box-shadow: none;
  transform: scale(1.08);
}

/* ==========================================================================
   Article & Video Floating Scroll To Top Button (Bottom-Right)
   ========================================================================== */
.article-scroll-top-btn,
.scroll-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--accent-text);
  border: 1px solid var(--border);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-scroll-top-btn svg,
.scroll-to-top-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.article-scroll-top-btn:hover,
.scroll-to-top-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.06);
  box-shadow: none;
}
.article-scroll-top-btn:hover svg,
.scroll-to-top-btn:hover svg {
  transform: translateY(-2px);
}
.article-scroll-top-btn.visible,
.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
[data-theme="light"] .article-scroll-top-btn,
[data-theme="light"] .scroll-to-top-btn {
  background: #ffffff;
  color: var(--accent-text);
  border-color: var(--border);
  box-shadow: none;
}
[data-theme="light"] .article-scroll-top-btn:hover,
[data-theme="light"] .scroll-to-top-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Contact Page Responsive Grid
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .scroll-to-top-btn {
    bottom: 20px;
    left: 20px;
    width: 42px;
    height: 42px;
  }
}




/* ========================================================================== 
   2026 UX polish: restrained glass surfaces, reactions, media and shop grid
   ========================================================================== */
:root {
  --glass-surface: rgba(24, 26, 32, 0.76);
  --glass-elevated: rgba(35, 37, 45, 0.70);
  --glass-border: rgba(255, 255, 255, 0.085);
  --glass-highlight: none;
}
[data-theme="light"] {
  --glass-surface: rgba(255, 255, 255, 0.78);
  --glass-elevated: rgba(248, 250, 252, 0.75);
  --glass-border: rgba(15, 23, 42, 0.09);
  --glass-highlight: none;
}

.card,
.glass-panel,
.article-action-bar {
  background: linear-gradient(145deg, rgba(255,255,255,0.025), rgba(255,255,255,0)), var(--glass-surface);
  border-color: var(--glass-border);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
}
.card:hover {
  box-shadow: none;
}

/* Article featured/content images must always be shown in full. */
.article-featured-media {
  margin: 0 0 32px;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.article-featured-media img,
.article-main-body .article-content img,
.article-main-body .block-image img {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.article-main-body .block-image {
  background: var(--glass-elevated);
}

/* Article reactions replace the old single heart/like control. */
.article-reaction-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.article-reaction-group.is-loading {
  opacity: 0.65;
}
.article-reaction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-elevated);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.article-reaction-btn:hover {
  transform: translateY(-1px);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.article-reaction-btn:disabled {
  cursor: wait;
}
.article-reaction-btn.like:hover,
.article-reaction-btn.like.active {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.09);
  box-shadow: none;
}
.article-reaction-btn.dislike:hover,
.article-reaction-btn.dislike.active {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.09);
  box-shadow: none;
}
.article-reaction-btn.active svg {
  fill: currentColor;
}
.article-reaction-count,
.article-like-count,
.article-dislike-count {
  min-width: 1.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.article-reaction-group-compact .article-reaction-btn {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 0.78rem;
}
.article-action-bar {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}
.article-action-copy {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.8;
}

/* Prevent the tools hero glow from ending on a hard horizontal edge. */
.tools-hero {
  overflow: visible;
  z-index: 1;
}
.tools-hero .hero-bg {
  top: -58%;
  width: min(940px, 96vw);
  height: 940px;
  background: radial-gradient(circle, rgba(59,130,246,0.13) 0%, rgba(99,102,241,0.055) 37%, transparent 70%);
  filter: blur(2px);
}
.tools-list-section {
  position: relative;
  z-index: 2;
}
.tools-list-section::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -210px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, 96vw);
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.075), transparent 68%);
  pointer-events: none;
}

/* Shop: three wider, shorter cards and uncropped product art. */
.shop-catalog .container {
  max-width: 1280px;
}
.shop-products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.shop-product-card .product-thumb {
  height: 190px;
  padding: 10px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--glass-elevated);
}
.shop-product-card .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
}
.shop-product-card:hover .product-thumb img {
  transform: scale(1.015);
}
.shop-product-card .product-body {
  padding: 14px 16px 10px;
}
.shop-product-card .product-desc {
  min-height: 0;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.shop-product-card .product-features {
  flex: 0 0 auto;
  margin-bottom: 5px;
}
.shop-product-card .product-features li {
  margin-bottom: 2px;
  line-height: 1.55;
}
.shop-product-card .product-footer {
  padding: 10px 16px 14px;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .shop-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .shop-products-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-inline: auto;
  }
  .shop-product-card {
    padding: 0;
  }
  .shop-product-card .product-thumb {
    height: 205px;
  }
  .article-action-bar {
    align-items: flex-start;
  }
  .article-action-copy {
    width: 100%;
  }
  .article-reaction-group {
    width: 100%;
  }
  .article-action-bar .article-reaction-btn {
    flex: 1;
  }
}

/* ========================================================================== 
   2026 UX polish v2: seamless media, stronger glass, shop/purchase alignment
   ========================================================================== */
:root {
  --glass-surface: rgba(20, 24, 34, 0.66);
  --glass-elevated: rgba(28, 33, 45, 0.72);
  --glass-border: rgba(255, 255, 255, 0.105);
  --glass-highlight: none;
  --glass-shadow: none;
  --media-surface: rgba(255, 255, 255, 0.018);
}
[data-theme="light"] {
  --glass-surface: rgba(255, 255, 255, 0.72);
  --glass-elevated: rgba(248, 250, 252, 0.78);
  --glass-border: rgba(15, 23, 42, 0.105);
  --glass-highlight: none;
  --glass-shadow: none;
  --media-surface: rgba(15, 23, 42, 0.025);
}

.card,
.glass-panel,
.article-action-bar,
.purchase-modal-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.008) 42%, rgba(59,130,246,0.018) 100%),
    var(--glass-surface);
  border-color: var(--glass-border);
  box-shadow: none;
  backdrop-filter: blur(20px) saturate(138%);
  -webkit-backdrop-filter: blur(20px) saturate(138%);
}
.card:hover {
  box-shadow: none;
}
[data-theme="light"] .card:hover {
  box-shadow: none;
}

/* Full, uncropped article and product artwork with no artificial padding. */
.product-card .product-thumb,
.article-card .article-thumb {
  padding: 0 !important;
  background: var(--media-surface) !important;
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
}
.product-card .product-thumb {
  height: auto !important;
  aspect-ratio: 1 / 1;
}
.article-card .article-thumb {
  height: auto !important;
  aspect-ratio: 3 / 2;
}
.product-card .product-thumb img,
.article-card .article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
.product-card:hover .product-thumb img,
.article-card:hover .article-thumb img {
  transform: scale(1.012);
}

/* Standalone article/product media should visually become the card itself. */
.article-featured-media,
.product-main-media {
  padding: 0 !important;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--media-surface) !important;
}
.article-featured-media:hover,
.product-main-media:hover {
  transform: none;
}
.article-featured-media img,
.product-main-media img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  border-radius: inherit !important;
}
.article-main-body .block-image,
.article-main-body .article-content.legacy img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--media-surface);
  overflow: hidden;
}
.article-main-body .block-image img,
.article-main-body .article-content.legacy img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: inherit;
}

/* Shop hero glow continues into the catalog instead of ending on a hard edge. */
.shop-hero {
  overflow: visible !important;
  position: relative;
  z-index: 1;
}
.shop-hero .hero-content {
  max-width: 780px !important;
}
.shop-hero h1 {
  max-width: 760px;
  margin-inline: auto;
  text-wrap: balance;
}
.shop-hero p {
  max-width: 680px;
  text-wrap: pretty;
}
.shop-hero .hero-bg {
  top: -58%;
  width: min(980px, 96vw);
  height: 980px;
  background: radial-gradient(circle, rgba(59,130,246,0.14) 0%, rgba(99,102,241,0.065) 38%, transparent 70%);
}
.shop-catalog {
  position: relative;
  z-index: 2;
}
.shop-catalog::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1000px, 96vw);
  height: 440px;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.085), transparent 68%);
  pointer-events: none;
}

/* Three-column catalog, full square artwork and a tighter information block. */
.shop-products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
}
.shop-product-card {
  height: auto;
}
.shop-product-card .product-thumb {
  height: auto !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  border-radius: 0;
}
.shop-product-card .product-body {
  padding: 15px 18px 10px;
  text-align: right;
}
.shop-product-card .product-desc {
  min-height: 0;
  margin-bottom: 8px;
  line-height: 1.75;
}
.shop-product-card .product-features {
  margin-bottom: 4px;
}
.shop-product-card .product-footer {
  padding: 11px 18px 15px;
}

/* Product detail alignment and purchase card. */
.product-detail-copy,
.product-detail-copy .card,
.product-description-card,
.product-description-content {
  text-align: right;
}
.product-purchase-card {
  padding: 24px;
  border-color: rgba(59,130,246,0.42) !important;
}
.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.product-price-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.product-price-value {
  text-align: left;
  direction: rtl;
}
.product-old-price {
  font-size: 0.84rem;
  color: var(--text-tertiary);
  text-decoration: line-through;
}
.product-current-price {
  font-size: 1.72rem;
  font-weight: 900;
  color: var(--accent-text);
  line-height: 1.4;
}
.product-buy-trigger,
.sticky-buy-trigger {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 12px 18px;
}
.product-buy-helper {
  margin: 9px 0 0;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  text-align: center;
  line-height: 1.75;
}
.product-cart-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.83rem;
}
.product-cart-feedback.success {
  display: block;
  color: #4ade80;
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.28);
}
.product-cart-feedback.error {
  display: block;
  color: #f87171;
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.28);
}

/* Rating picker: copy on the right, stars physically on the left. */
.product-rating-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  direction: rtl;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-elevated);
}
.product-rating-copy {
  grid-column: 1;
  text-align: right;
}
.product-rating-copy label {
  display: block;
  margin-bottom: 3px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 800;
}
.product-rating-copy span {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.74rem;
}
.product-rating-control {
  grid-column: 2;
  direction: ltr;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 190px;
}
.star-rating-picker {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  direction: ltr;
}
.star-rating-picker .star-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
  transition: transform 0.15s var(--ease), color 0.15s var(--ease);
}
.star-rating-picker .star-btn.active {
  color: #f59e0b;
}
.star-rating-picker .star-btn:hover,
.star-rating-picker .star-btn:focus-visible {
  color: #f59e0b;
  transform: translateY(-1px) scale(1.08);
  outline: none;
}
#ratingLabel {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  direction: rtl;
}

/* Purchase method modal. */
body.purchase-modal-open {
  overflow: hidden;
}
.purchase-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
}
.purchase-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.purchase-modal-card {
  width: min(560px, 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 22px;
  transform: translateY(12px) scale(0.985);
  transition: transform 0.24s var(--ease);
}
.purchase-modal-backdrop.open .purchase-modal-card {
  transform: translateY(0) scale(1);
}
.purchase-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
  text-align: right;
}
.purchase-modal-eyebrow {
  display: inline-block;
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.purchase-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.65;
}
.purchase-modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}
.purchase-modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.purchase-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.purchase-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-elevated);
  color: var(--text-primary);
  text-align: right;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.purchase-choice:hover,
.purchase-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(59,130,246,0.52);
  background: rgba(59,130,246,0.075);
  color: var(--text-primary);
  outline: none;
}
.purchase-choice-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  color: var(--accent-text);
}
.purchase-choice-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.purchase-choice-copy strong {
  font-size: 0.92rem;
}
.purchase-choice-copy small {
  white-space: normal;
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.75;
}
.purchase-choice-arrow {
  color: var(--text-tertiary);
}
.purchase-choice.is-loading {
  opacity: 0.62;
  pointer-events: none;
}

/* Sticky purchase bar is now one clear action, with a glass surface. */
.product-sticky-bar {
  background: rgba(10, 14, 22, 0.76) !important;
  border-top: 1px solid var(--glass-border) !important;
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
}
[data-theme="light"] .product-sticky-bar {
  background: rgba(255,255,255,0.78) !important;
  border-top: 1px solid var(--glass-border) !important;
  box-shadow: none;
}
.sticky-btn-group {
  min-width: 150px;
}
.sticky-buy-trigger {
  padding: 10px 18px;
  font-size: 0.88rem;
}
.sticky-thumb {
  object-fit: contain !important;
  background: var(--media-surface);
}

@media (max-width: 1024px) and (min-width: 769px) {
  .shop-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .shop-hero {
    overflow: hidden !important;
  }
  .shop-products-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-inline: auto;
  }
  .shop-product-card .product-thumb,
  .product-card .product-thumb {
    height: auto !important;
    aspect-ratio: 1 / 1;
  }
  .article-card .article-thumb {
    height: auto !important;
    aspect-ratio: 3 / 2;
  }
  .product-rating-field {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .product-rating-copy,
  .product-rating-control {
    grid-column: 1;
  }
  .product-rating-control {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
  }
  .product-price-row {
    align-items: flex-end;
  }
  .product-current-price {
    font-size: 1.45rem;
  }
  .purchase-modal-card {
    padding: 18px;
  }
  .purchase-choice {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    padding: 13px;
  }
  .purchase-choice-icon {
    width: 40px;
    height: 40px;
  }
  .sticky-btn-group {
    min-width: 132px;
  }
}

.product-review-form,
.product-overall-rating {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0.006)),
    var(--glass-elevated) !important;
  border-color: var(--glass-border) !important;
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

/* Keep mixed Persian/Latin product names visually stable in RTL. */
.product-body h3,
.product-detail-copy h1,
.sticky-title,
.shop-hero p {
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: right;
}
.shop-hero h1,
.shop-hero p {
  text-align: center;
}

/* ========================================================================== 
   2026 UX polish v3: courses continuity + clearer glass discount states
   ========================================================================== */

/* Shared frosted chips: keep the existing semantic tint, add depth and edge. */
.hero-label,
.badge,
.course-discount-chip,
.discount-tag-glass {
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}
[data-theme="light"] .hero-label,
[data-theme="light"] .badge,
[data-theme="light"] .course-discount-chip,
[data-theme="light"] .discount-tag-glass {
  border-color: rgba(15,23,42,0.09);
  box-shadow: none;
}
.badge-cyan {
  background: rgba(6,182,212,0.12);
  color: #67e8f9;
}
[data-theme="light"] .badge-cyan {
  color: #0e7490;
  background: rgba(6,182,212,0.10);
}

/* Header glass is deliberately subtle so text contrast stays high. */
.site-header {
  background: rgba(10, 14, 22, 0.72);
  border-bottom-color: var(--glass-border);
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
[data-theme="light"] .site-header {
  background: rgba(255,255,255,0.76);
  box-shadow: none;
}

/* Courses page: one continuous backdrop, no hard half-page cutoff. */
.courses-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 62vh;
  background:
    radial-gradient(900px 520px at 50% 2%, rgba(79,70,229,0.13), transparent 68%),
    radial-gradient(720px 440px at 16% 38%, rgba(59,130,246,0.055), transparent 72%),
    linear-gradient(180deg, rgba(15,23,42,0.20) 0%, transparent 58%);
}
.courses-page::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent 34%, rgba(99,102,241,0.014));
}
.courses-hero {
  position: relative;
  padding: 68px 0 28px;
}
.courses-page-glow {
  position: absolute;
  z-index: -1;
  top: -300px;
  left: 50%;
  width: min(1120px, 96vw);
  height: 760px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.17) 0%, rgba(59,130,246,0.07) 38%, transparent 72%);
  filter: blur(2px);
  pointer-events: none;
}
.courses-hero-card {
  position: relative;
  overflow: hidden;
  width: min(920px, 100%);
  margin-inline: auto;
  padding: 42px clamp(24px, 5vw, 58px) 40px;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(560px 220px at 50% -60px, rgba(99,102,241,0.16), transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,0.052), rgba(255,255,255,0.009) 48%, rgba(59,130,246,0.026)),
    rgba(18,23,34,0.56);
  box-shadow: none;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}
.courses-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,0.055), transparent 28%, transparent 70%, rgba(99,102,241,0.045));
}
[data-theme="light"] .courses-hero-card {
  background:
    radial-gradient(560px 220px at 50% -60px, rgba(99,102,241,0.10), transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,0.86), rgba(255,255,255,0.58)),
    rgba(255,255,255,0.70);
  box-shadow: none;
}
.courses-hero-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px 13px;
}
.courses-hero-card h1 {
  position: relative;
  z-index: 1;
  margin: 0 auto 14px;
  max-width: 800px;
  font-size: clamp(2rem, 3.15vw, 3rem);
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.courses-hero-card p {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: clamp(0.92rem, 1.35vw, 1.03rem);
  line-height: 2;
  text-wrap: pretty;
}
.courses-catalog {
  position: relative;
  padding: 18px 0 78px;
}
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}
.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(255,255,255,0.043), rgba(255,255,255,0.008) 48%, rgba(59,130,246,0.02)),
    rgba(19,24,35,0.60);
  backdrop-filter: blur(20px) saturate(138%);
  -webkit-backdrop-filter: blur(20px) saturate(138%);
}
[data-theme="light"] .course-card {
  background:
    linear-gradient(150deg, rgba(255,255,255,0.94), rgba(255,255,255,0.63)),
    rgba(255,255,255,0.74);
}
.course-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--media-surface);
  border-bottom: 1px solid var(--glass-border);
}
.course-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  margin: 0;
  transition: transform 0.35s var(--ease);
}
.course-card:hover .course-thumb img {
  transform: scale(1.012);
}
.course-discount-chip {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: #fff;
  background: linear-gradient(135deg, rgba(239,68,68,0.58), rgba(225,29,72,0.36));
  font-size: 0.72rem;
  font-weight: 800;
}
.course-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 19px 14px;
  text-align: right;
}
.course-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.course-card-body h2 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.7;
}
.course-card-body h2 a {
  color: inherit;
  text-decoration: none;
}
.course-card-body p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.85;
}
.course-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding: 14px 19px 17px;
  border-top: 1px solid var(--glass-border);
}
.course-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.course-price strong {
  color: var(--accent-text);
  font-size: 1.02rem;
  font-weight: 900;
  white-space: nowrap;
}
.course-old-price {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  text-decoration: line-through;
  white-space: nowrap;
}
.course-open-btn {
  flex: 0 0 auto;
  padding: 8px 15px;
  font-size: 0.82rem;
}
.courses-empty-state {
  width: min(800px, 100%);
  margin: 8px auto 0;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  text-align: right;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.045), rgba(255,255,255,0.008)),
    rgba(18,23,34,0.55);
  box-shadow: none;
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}
[data-theme="light"] .courses-empty-state {
  background: rgba(255,255,255,0.72);
}
.courses-empty-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: var(--accent-text);
  border: 1px solid rgba(59,130,246,0.20);
  background: rgba(59,130,246,0.10);
}
.courses-empty-state strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-primary);
  font-size: 0.96rem;
}
.courses-empty-state p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* Discounted products should be identifiable before reading the price. */
.product-card.has-special-discount {
  position: relative;
  isolation: isolate;
  border-color: rgba(244,63,94,0.28) !important;
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(244,63,94,0.10), transparent 68%),
    linear-gradient(150deg, rgba(255,255,255,0.055), rgba(255,255,255,0.009) 44%, rgba(99,102,241,0.024)),
    var(--glass-surface);
  box-shadow: none;
}
.product-card.has-special-discount::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -90px;
  left: -80px;
  width: 240px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,63,94,0.12), transparent 68%);
  pointer-events: none;
}
.product-card.has-special-discount > * {
  position: relative;
  z-index: 1;
}
.product-card.has-special-discount:hover {
  border-color: rgba(244,63,94,0.42) !important;
  box-shadow: none;
}
[data-theme="light"] .product-card.has-special-discount {
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(244,63,94,0.085), transparent 68%),
    linear-gradient(150deg, rgba(255,255,255,0.94), rgba(255,255,255,0.67)),
    rgba(255,255,255,0.76);
  box-shadow: none;
}
.product-card .discount-tag.discount-tag-glass {
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
  background: linear-gradient(135deg, rgba(239,68,68,0.62), rgba(225,29,72,0.38));
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}
.product-card .discount-tag.discount-tag-glass svg {
  flex: 0 0 auto;
}
.product-card.has-special-discount .old-price {
  color: rgba(248,113,113,0.78);
}
.product-card.has-special-discount .current-price {
  text-shadow: none;
}

/* Add a little more glass depth to the common content surfaces without making
   the whole page translucent. */
.article-action-bar,
.product-review-form,
.product-overall-rating,
.product-rating-field,
.purchase-choice,
.courses-empty-state {
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

@media (max-width: 1100px) {
  .courses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .courses-hero {
    padding: 38px 0 18px;
  }
  .courses-hero-card {
    padding: 28px 18px 26px;
    border-radius: 22px;
  }
  .courses-hero-card h1 {
    font-size: clamp(1.72rem, 8vw, 2.2rem);
  }
  .courses-hero-card p {
    font-size: 0.9rem;
    line-height: 1.9;
  }
  .courses-catalog {
    padding: 14px 0 54px;
  }
  .courses-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-inline: auto;
  }
  .course-card-footer {
    align-items: flex-end;
  }
  .courses-empty-state {
    align-items: flex-start;
    padding: 20px;
  }
}
.courses-hero-card .text-gradient {
  display: inline-block;
  white-space: nowrap;
}
.product-card .discount-tag.discount-tag-glass {
  z-index: 3;
}


/* ========================================================================== 
   2026 UX polish v4: flat macOS-style frosted materials, no visual shadows
   ========================================================================== */
:root {
  --bg-body: #0b0e14;
  --bg-surface: rgba(18, 22, 30, 0.54);
  --bg-surface-hover: rgba(30, 36, 48, 0.62);
  --bg-elevated: rgba(31, 38, 50, 0.56);
  --bg-header: rgba(12, 16, 24, 0.60);
  --border: rgba(255, 255, 255, 0.105);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f2f5fa;
  --text-secondary: #a7afbf;
  --text-tertiary: #727b8d;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-muted: rgba(59, 130, 246, 0.14);
  --accent-text: #74adff;
  --glass-surface: rgba(24, 30, 40, 0.48);
  --glass-elevated: rgba(32, 39, 51, 0.53);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: none;
  --glass-shadow: none;
  --media-surface: rgba(255, 255, 255, 0.025);
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}
[data-theme="light"] {
  --bg-body: #eef3f9;
  --bg-surface: rgba(255, 255, 255, 0.46);
  --bg-surface-hover: rgba(255, 255, 255, 0.64);
  --bg-elevated: rgba(255, 255, 255, 0.56);
  --bg-header: rgba(248, 251, 255, 0.58);
  --border: rgba(50, 65, 88, 0.13);
  --border-hover: rgba(50, 65, 88, 0.23);
  --text-primary: #111827;
  --text-secondary: #586477;
  --text-tertiary: #8792a3;
  --accent-muted: rgba(59, 130, 246, 0.10);
  --accent-text: #2563eb;
  --glass-surface: rgba(255, 255, 255, 0.44);
  --glass-elevated: rgba(255, 255, 255, 0.56);
  --glass-border: rgba(42, 56, 78, 0.13);
  --media-surface: rgba(255, 255, 255, 0.24);
}

/* A restrained ambient canvas gives the translucent materials something real
   to refract/blur without relying on drop shadows for separation. */
body {
  background-color: var(--bg-body);
  background-image:
    radial-gradient(900px 560px at 86% 4%, rgba(59, 130, 246, 0.105), transparent 66%),
    radial-gradient(760px 520px at 8% 52%, rgba(124, 58, 237, 0.075), transparent 70%),
    radial-gradient(620px 440px at 72% 92%, rgba(14, 165, 233, 0.05), transparent 72%);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background-image:
    radial-gradient(900px 560px at 86% 4%, rgba(59, 130, 246, 0.13), transparent 66%),
    radial-gradient(760px 520px at 8% 52%, rgba(139, 92, 246, 0.09), transparent 70%),
    radial-gradient(620px 440px at 72% 92%, rgba(14, 165, 233, 0.075), transparent 72%);
}
#liquid-bg { opacity: 0.22; }
[data-theme="light"] #liquid-bg { opacity: 0.14; }

/* User asked for a flat interface: remove every decorative box/text shadow.
   Keyboard focus is preserved with an outline instead of a shadow ring. */
body *, body *::before, body *::after {
  box-shadow: none;
  text-shadow: none;
}
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.82);
  outline-offset: 2px;
}

/* Core frosted material. Top-edge luminosity is painted into the background,
   not simulated with a shadow, so the interface remains visually flat. */
.card,
.glass-panel,
.article-action-bar,
.purchase-modal-card,
.modal-card,
.cart-table-card,
.cart-summary-card,
.comment-card,
.comment-reply-card,
.inline-reply-box,
.product-review-form,
.product-overall-rating,
.product-rating-field,
.purchase-choice,
.courses-hero-card,
.course-card,
.courses-empty-state {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055) 0, rgba(255,255,255,0.018) 1px, transparent 46px),
    linear-gradient(145deg, rgba(255,255,255,0.028), rgba(255,255,255,0.004) 48%, rgba(59,130,246,0.018)),
    var(--glass-surface) !important;
  border-color: var(--glass-border) !important;
  backdrop-filter: blur(28px) saturate(155%);
  -webkit-backdrop-filter: blur(28px) saturate(155%);
}
[data-theme="light"] .card,
[data-theme="light"] .glass-panel,
[data-theme="light"] .article-action-bar,
[data-theme="light"] .purchase-modal-card,
[data-theme="light"] .modal-card,
[data-theme="light"] .cart-table-card,
[data-theme="light"] .cart-summary-card,
[data-theme="light"] .comment-card,
[data-theme="light"] .comment-reply-card,
[data-theme="light"] .inline-reply-box,
[data-theme="light"] .product-review-form,
[data-theme="light"] .product-overall-rating,
[data-theme="light"] .product-rating-field,
[data-theme="light"] .purchase-choice,
[data-theme="light"] .courses-hero-card,
[data-theme="light"] .course-card,
[data-theme="light"] .courses-empty-state {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.68) 0, rgba(255,255,255,0.34) 1px, transparent 54px),
    linear-gradient(145deg, rgba(255,255,255,0.25), rgba(255,255,255,0.035) 52%, rgba(59,130,246,0.018)),
    var(--glass-surface) !important;
}
.card:hover,
.course-card:hover,
.product-card.has-special-discount:hover {
  transform: none !important;
  border-color: var(--border-hover) !important;
}

/* Header/navigation material: translucent, neutral and shadow-free. */
.site-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(11, 15, 23, 0.58) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  backdrop-filter: blur(30px) saturate(155%);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
}
[data-theme="light"] .site-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.70), rgba(255,255,255,0.14)),
    rgba(246, 250, 255, 0.47) !important;
}
.nav-link:hover,
.icon-btn:hover,
.btn-secondary,
.form-control,
.cart-qty-control,
.cart-qty-btn,
.btn-reaction,
.purchase-modal-close {
  background-color: rgba(255,255,255,0.045);
  border-color: var(--glass-border);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .icon-btn:hover,
[data-theme="light"] .btn-secondary,
[data-theme="light"] .form-control,
[data-theme="light"] .cart-qty-control,
[data-theme="light"] .cart-qty-btn,
[data-theme="light"] .btn-reaction,
[data-theme="light"] .purchase-modal-close {
  background-color: rgba(255,255,255,0.42);
}
.btn:hover,
.btn:active,
.btn:focus-visible,
.icon-btn:hover,
.nav-link:hover,
.article-card:hover,
.product-card:hover,
.video-card:hover,
.tool-card:hover {
  transform: none !important;
}

/* Frosted chips are cleaner without faux elevation. */
.hero-label,
.badge,
.course-discount-chip,
.discount-tag-glass {
  border-color: rgba(255,255,255,0.13) !important;
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}
[data-theme="light"] .hero-label,
[data-theme="light"] .badge,
[data-theme="light"] .course-discount-chip,
[data-theme="light"] .discount-tag-glass {
  border-color: rgba(42,56,78,0.12) !important;
}

/* Product review area from the screenshot: unify the many gray blocks into
   one neutral glass hierarchy so the form no longer looks like nested slabs. */
.product-reviews-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), transparent 48px),
    rgba(21, 27, 37, 0.42) !important;
  border-color: rgba(255,255,255,0.12) !important;
  overflow: visible;
}
[data-theme="light"] .product-reviews-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.58), transparent 58px),
    rgba(255,255,255,0.38) !important;
  border-color: rgba(42,56,78,0.12) !important;
}
.product-reviews-header {
  border-bottom-color: var(--glass-border) !important;
}
.product-review-form {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 42px),
    rgba(255,255,255,0.025) !important;
}
[data-theme="light"] .product-review-form {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.46), transparent 42px),
    rgba(255,255,255,0.18) !important;
}
.product-rating-field,
.product-overall-rating {
  background: rgba(255,255,255,0.035) !important;
}
[data-theme="light"] .product-rating-field,
[data-theme="light"] .product-overall-rating {
  background: rgba(255,255,255,0.31) !important;
}
.form-control {
  background: rgba(5, 8, 14, 0.19) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: var(--text-primary);
}
[data-theme="light"] .form-control {
  background: rgba(255,255,255,0.30) !important;
  border-color: rgba(42,56,78,0.12) !important;
}
.form-control:focus {
  border-color: rgba(59,130,246,0.68) !important;
  background: rgba(59,130,246,0.045) !important;
}
[data-theme="light"] .form-control:focus {
  background: rgba(255,255,255,0.48) !important;
}
.comment-card {
  background: rgba(255,255,255,0.028) !important;
}
.comment-reply-card,
.inline-reply-box {
  background: rgba(255,255,255,0.020) !important;
}
[data-theme="light"] .comment-card {
  background: rgba(255,255,255,0.26) !important;
}
[data-theme="light"] .comment-reply-card,
[data-theme="light"] .inline-reply-box {
  background: rgba(255,255,255,0.18) !important;
}
.comment-toolbar,
.comment-replies-list {
  border-color: var(--glass-border) !important;
}

/* Public profile page: keep the entire region on one continuous backdrop so
   there is no clipped/half shadow band between the profile and article list. */
.user-profile-page {
  position: relative;
  isolation: isolate;
  min-height: 68vh;
  background:
    radial-gradient(760px 360px at 74% 4%, rgba(59,130,246,0.095), transparent 70%),
    radial-gradient(660px 360px at 14% 58%, rgba(139,92,246,0.06), transparent 72%);
}
[data-theme="light"] .user-profile-page {
  background:
    radial-gradient(760px 360px at 74% 4%, rgba(59,130,246,0.12), transparent 70%),
    radial-gradient(660px 360px at 14% 58%, rgba(139,92,246,0.08), transparent 72%);
}
.user-profile-hero {
  overflow: visible;
  padding-bottom: 28px !important;
}
.user-profile-hero .hero-bg {
  display: none;
}
.user-profile-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), transparent 58px),
    rgba(24,30,40,0.43) !important;
  border-color: rgba(255,255,255,0.13) !important;
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
}
[data-theme="light"] .user-profile-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.68), transparent 64px),
    rgba(255,255,255,0.40) !important;
  border-color: rgba(42,56,78,0.13) !important;
}
.user-profile-avatar {
  border-width: 1px !important;
  border-color: var(--glass-border) !important;
  background: rgba(59,130,246,0.16) !important;
}
.user-articles-section {
  position: relative;
  padding-top: 22px !important;
  background: transparent !important;
}
.user-article-card {
  background: rgba(255,255,255,0.025) !important;
}
[data-theme="light"] .user-article-card {
  background: rgba(255,255,255,0.36) !important;
}

/* Discount state remains visually obvious but flat: stained-glass tint + edge,
   with no glow or elevated shadow. */
.product-card.has-special-discount {
  border-color: rgba(244,63,94,0.34) !important;
  background:
    radial-gradient(420px 190px at 0% 0%, rgba(244,63,94,0.105), transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.004) 54%),
    rgba(28, 28, 38, 0.47) !important;
}
[data-theme="light"] .product-card.has-special-discount {
  border-color: rgba(225,29,72,0.25) !important;
  background:
    radial-gradient(420px 190px at 0% 0%, rgba(244,63,94,0.10), transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,0.42), rgba(255,255,255,0.04) 54%),
    rgba(255,255,255,0.43) !important;
}
.product-card.has-special-discount::after { display: none !important; }
.product-card .discount-tag.discount-tag-glass {
  background: rgba(190, 24, 93, 0.48) !important;
  border-color: rgba(255,255,255,0.20) !important;
}
[data-theme="light"] .product-card .discount-tag.discount-tag-glass {
  color: #9f1239;
  background: rgba(255,255,255,0.46) !important;
  border-color: rgba(190,24,93,0.23) !important;
}

/* Course hero and catalog stay continuous but lose the previous floating-card
   shadow language. */
.courses-page {
  background:
    radial-gradient(900px 520px at 50% 2%, rgba(79,70,229,0.11), transparent 68%),
    radial-gradient(720px 440px at 16% 38%, rgba(59,130,246,0.05), transparent 72%),
    transparent;
}
.courses-hero-card,
.courses-empty-state,
.course-card {
  border-color: var(--glass-border) !important;
}

/* Sticky purchase bar is glass, but flat and separated only by a hairline. */
.product-sticky-bar {
  background: rgba(9, 13, 20, 0.58) !important;
  border-top: 1px solid var(--glass-border) !important;
  box-shadow: none;
  backdrop-filter: blur(30px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(160%) !important;
}
[data-theme="light"] .product-sticky-bar {
  background: rgba(248, 251, 255, 0.58) !important;
  border-top-color: rgba(42,56,78,0.12) !important;
  box-shadow: none;
}

/* Keep image cards seamless with the new transparent material. */
.product-card .product-thumb,
.article-card .article-thumb,
.course-thumb,
.article-featured-media,
.product-main-media {
  background: rgba(255,255,255,0.018) !important;
  border-color: var(--glass-border) !important;
}
[data-theme="light"] .product-card .product-thumb,
[data-theme="light"] .article-card .article-thumb,
[data-theme="light"] .course-thumb,
[data-theme="light"] .article-featured-media,
[data-theme="light"] .product-main-media {
  background: rgba(255,255,255,0.20) !important;
}

@media (max-width: 768px) {
  .user-profile-card { padding: 24px 20px !important; }
  .product-reviews-panel { padding: 22px 18px !important; }
  .product-review-form { padding: 18px !important; }
  .product-rating-control { align-items: flex-start; }
}

/* Avoid stacking blur-on-blur inside an already frosted panel. The outer
   material provides the glass; inner controls stay flat/translucent. */
.product-reviews-panel .product-review-form,
.product-reviews-panel .product-rating-field,
.product-reviews-panel .product-overall-rating,
.product-reviews-panel .comment-card,
.product-reviews-panel .comment-reply-card,
.product-reviews-panel .inline-reply-box {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Final flat-surface guarantee: dynamically injected inline shadows are also suppressed. */
body *, body *::before, body *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* ========================================================================== 
   UX polish v5: canonical clean routes, flat cards, non-destructive media
   ========================================================================== */
:root,
[data-theme="light"] {
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --glass-shadow: none;
  --glass-highlight: none;
}

/* Fully flat interaction language: no lift, no shadow, no glow-as-shadow. */
.card,
.card:hover,
.btn:hover,
.product-card:hover,
.article-card:hover,
.course-card:hover,
.tool-card:hover,
.feature-card:hover,
.user-profile-card,
.user-article-card {
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
}

/* List media uses its real aspect ratio. There is no fixed crop box, no
   letterbox padding and no badge sitting over the artwork. */
.product-card .product-thumb,
.shop-product-card .product-thumb,
.article-card .article-thumb,
.user-article-card .article-thumb {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0;
  overflow: hidden;
  background: transparent !important;
  border-bottom: 1px solid var(--glass-border) !important;
}
.product-card .product-thumb img,
.shop-product-card .product-thumb img,
.article-card .article-thumb img,
.user-article-card .article-thumb img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
}
.product-card:hover .product-thumb img,
.shop-product-card:hover .product-thumb img,
.article-card:hover .article-thumb img,
.user-article-card:hover .article-thumb img {
  transform: none !important;
}

/* Metadata belongs below the image so it never covers product/article art. */
.product-badges-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.product-badges-row .product-cat {
  margin: 0 !important;
}
.product-card .discount-tag.discount-tag-glass {
  position: static !important;
  inset: auto !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #fda4af;
  background: rgba(190, 24, 93, 0.13) !important;
  border: 1px solid rgba(244, 63, 94, 0.28) !important;
  border-radius: var(--radius-full);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}
[data-theme="light"] .product-card .discount-tag.discount-tag-glass {
  color: #be123c;
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(190, 24, 93, 0.22) !important;
}

/* A discount is now communicated by the chip beside the account type only;
   the card/image itself is never stained by the discount color. */
.product-card.has-special-discount,
[data-theme="light"] .product-card.has-special-discount,
.product-card.has-special-discount:hover {
  border-color: var(--glass-border) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0.004)),
    var(--glass-surface) !important;
  box-shadow: none !important;
}
.product-card.has-special-discount::before,
.product-card.has-special-discount::after {
  display: none !important;
  content: none !important;
}

.article-card .article-cat.article-cat-inline {
  position: static !important;
  inset: auto !important;
  align-self: flex-start;
  margin: 0 0 9px !important;
}

/* Final no-shadow guarantee, including inline styles injected by older pages. */
html body *,
html body *::before,
html body *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* ===== Deployment 2026-09-12: password visibility + aligned captcha ===== */
.password-visibility-wrap {
    position: relative;
    width: 100%;
}
.password-visibility-wrap > input.form-control {
    width: 100%;
    padding-left: 48px !important;
}
.password-visibility-toggle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: color .18s ease, background .18s ease;
}
.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
    color: var(--accent-text);
    background: var(--accent-muted);
    outline: none;
}
.password-visibility-toggle .eye-off { display: none; }
.password-visibility-toggle[aria-pressed="true"] .eye-on { display: none; }
.password-visibility-toggle[aria-pressed="true"] .eye-off { display: block; }

.captcha-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 9px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary, rgba(255,255,255,.04));
    border-radius: var(--radius-md);
}
.captcha-panel-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.captcha-panel-label strong {
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 700;
}
.captcha-panel-label small {
    color: var(--text-muted, var(--text-secondary));
    font-size: .72rem;
    opacity: .8;
}
.captcha-question-badge {
    min-width: 92px;
    min-height: 40px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated, rgba(255,255,255,.06));
    color: var(--accent-text);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
    direction: ltr;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
@media (max-width: 430px) {
    .captcha-panel { grid-template-columns: 1fr; }
    .captcha-question-badge { width: 100%; }
}

/* ===== 2026-09-12 v8: accessible Persian custom file picker ===== */
.hoosh-file-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0.001 !important;
}
.hoosh-file-ui {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary, rgba(255,255,255,.035));
    transition: border-color .18s ease, background .18s ease;
}
.hoosh-file-native:focus-visible + .hoosh-file-ui {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}
.hoosh-file-button {
    min-height: 46px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    color: var(--accent-text, var(--accent));
    background: var(--accent-muted, rgba(59,130,246,.10));
    border-left: 1px solid var(--border);
    font-size: .84rem;
    font-weight: 800;
}
.hoosh-file-name {
    min-width: 0;
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: .82rem;
    direction: rtl;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hoosh-file-ui.has-file .hoosh-file-name { color: var(--text-primary); }
.hoosh-file-ui.is-disabled { opacity: .55; pointer-events: none; }
@media (max-width: 520px) {
    .hoosh-file-ui { grid-template-columns: 1fr; }
    .hoosh-file-button { border-left: 0; border-bottom: 1px solid var(--border); }
    .hoosh-file-name { min-height: 42px; justify-content: center; text-align: center; }
}

/* ===== v10: flatter, responsive public user profile ===== */
.user-profile-page { background:var(--bg-body); min-height:60vh; }
.user-profile-page .user-profile-hero { padding:36px 0 24px !important; }
.user-profile-page .hero-bg { display:none !important; }
.user-profile-page .user-profile-card {
  max-width:940px !important; padding:28px !important; background:var(--bg-surface) !important;
  border:1px solid var(--border) !important; border-radius:var(--radius-lg) !important;
  box-shadow:none !important; backdrop-filter:none !important;
}
.user-profile-page .user-profile-avatar { background:var(--bg-elevated) !important; border:1px solid var(--border) !important; box-shadow:none !important; }
.user-profile-page .user-articles-section .container { max-width:940px !important; }
.user-profile-page .user-article-card { box-shadow:none !important; border:1px solid var(--border); }
@media (max-width:720px) {
  .user-profile-page .user-profile-hero { padding:22px 0 16px !important; }
  .user-profile-page .user-profile-card { padding:18px !important; border-radius:var(--radius-md) !important; }
  .user-profile-page .user-profile-card > div { align-items:center !important; gap:16px !important; }
  .user-profile-page .user-profile-avatar { width:76px !important; height:76px !important; font-size:1.6rem !important; }
  .user-profile-page .user-profile-card h1 { font-size:1.3rem !important; }
  .user-profile-page .user-profile-card > div > div:last-child { min-width:0 !important; width:100%; flex-basis:100%; }
  .user-profile-page .articles-grid { grid-template-columns:1fr !important; }
}
@media (prefers-reduced-motion: reduce), (max-width:767px) { #liquid-bg { display:none !important; } }


/* ===== 2026-09-20: final editorial card alignment ===== */
/* Article covers need one predictable frame in a grid. Product artwork keeps its
   original non-cropped behavior; this override is intentionally article-only. */
.articles-grid {
  align-items: stretch;
}
.articles-grid > .article-card,
.articles-grid > .user-article-card {
  min-width: 0;
  height: 100%;
}
.articles-grid .article-card .article-thumb,
.articles-grid .user-article-card .article-thumb {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
  background: var(--media-surface) !important;
  border-bottom: 1px solid var(--glass-border) !important;
}
.articles-grid .article-card .article-thumb img,
.articles-grid .user-article-card .article-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
.articles-grid .article-card .article-body {
  min-height: 0;
  flex: 1 1 auto;
}
.articles-grid .article-card .article-body h3,
.articles-grid .article-card .article-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 3.2em;
}
.articles-grid .article-card .article-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 4.8em;
  flex: 1 1 auto;
}
.articles-grid .article-card .article-meta {
  margin-top: auto;
}
@media (max-width: 768px) {
  .articles-grid .article-card .article-body h3,
  .articles-grid .article-card .article-title,
  .articles-grid .article-card .article-summary {
    min-height: 0;
  }
}

/* ========================================================================== 
   2026-09-20 v12: continuous ambient depth + curated video presentation
   ========================================================================== */
/* Decorative glows must not be cut at the boundary between hero/sections.
   Horizontal overflow is clipped only at the viewport edge; functional media
   and text clamps keep their own local overflow rules. */
html,
body {
  /* hidden is the compatibility fallback; clip prevents horizontal page scroll
     without creating an inner scroll container in modern browsers. */
  overflow-x: hidden;
  overflow-x: clip;
}
.hero,
.shop-hero,
.tools-hero,
.user-profile-hero,
.section {
  overflow: visible !important;
}
.hero {
  isolation: isolate;
}
.hero > .container,
.section > .container {
  position: relative;
  z-index: 1;
}
.hero .hero-bg {
  z-index: -1;
  width: min(980px, 150vw);
  height: 980px;
  top: -58%;
}
.products-grid,
.articles-grid,
.videos-grid,
.tools-grid,
.features-grid {
  overflow: visible;
}

/* Video cards: calmer rhythm, aligned metadata and readable Persian copy. */
.videos-grid {
  align-items: stretch;
}
.home-videos-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.video-card-link {
  min-width: 0;
  height: 100%;
  padding: 0;
  text-decoration: none;
  color: inherit;
}
.video-card-body {
  padding: 22px 22px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.video-card-body > div:first-child {
  min-width: 0;
}
.video-card-body .video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.video-card-title {
  color: var(--text-primary);
  font-size: 1.07rem;
  font-weight: 800;
  line-height: 1.75;
  margin: 0 0 10px;
  text-wrap: pretty;
}
.video-card-description {
  margin: 0 0 2px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.95;
  text-align: right;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.video-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border, var(--border));
}
.video-card-cta {
  color: var(--accent-text);
  font-size: 0.84rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.video-card-views {
  color: var(--text-tertiary);
  font-size: 0.76rem;
  white-space: nowrap;
}

/* Single video copy: each admin-entered line becomes a real paragraph and URLs
   get their own LTR direction so mixed Persian/Latin text no longer tangles. */
.video-detail-card {
  padding: 0;
  margin-bottom: 32px;
  overflow: hidden;
}
.video-detail-card > .aparat-container {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: transparent;
}
.video-detail-card .aparat-embed-wrapper {
  width: 100%;
  margin: 0;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: transparent;
}
.video-detail-card .aparat-player-frame {
  border-radius: inherit;
}
.video-detail-content {
  padding: clamp(22px, 3.5vw, 32px);
}
.video-detail-title {
  margin: 0 0 18px;
  color: var(--text-primary);
  font-size: clamp(1.35rem, 2.6vw, 1.72rem);
  font-weight: 900;
  line-height: 1.65;
  text-wrap: pretty;
}
.video-description {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 2.05;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: normal;
}
.video-description p {
  margin: 0;
}
.video-description p + p {
  margin-top: 12px;
}
.video-description-link {
  display: inline;
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  unicode-bidi: isolate;
}
.video-description-link:hover {
  color: var(--accent-hover);
}

@media (max-width: 820px) {
  .home-videos-grid {
    grid-template-columns: 1fr;
  }
  .video-card-body {
    padding: 19px 18px 18px;
  }
  .video-detail-content {
    padding: 20px 18px 22px;
  }
  .video-description {
    font-size: 0.92rem;
    line-height: 2;
  }
}

/* Top-level page shells are also paint-safe; only viewport horizontal overflow is clipped. */
.courses-page,
.error-404-section {
  overflow: visible !important;
}

/* ========================================================================== 
   2026-09-20 v14: Aparat viewport fit + balanced site header
   ========================================================================== */
/* Keep the third-party player and its rounded shell as a single painted box.
   A small overscan hides letterbox seams baked into some Aparat player/source
   combinations without creating a second dark layer behind the iframe. */
.aparat-container {
  position: relative;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent !important;
  contain: paint;
}
.aparat-embed-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: inherit;
  overflow: hidden;
  background: transparent !important;
  transform: translateZ(0);
}
.aparat-embed-wrapper > iframe,
.aparat-player-frame {
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent !important;
  transform: scale(var(--aparat-overscan, 1.018));
  transform-origin: 50% 0;
}
.video-detail-card {
  --aparat-overscan: 1.045;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
}
.video-detail-card > .aparat-container {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}
.video-detail-card .aparat-embed-wrapper,
.video-detail-card .aparat-player-frame {
  border-radius: inherit;
}
.block-embed,
.block-embed .aparat-container {
  --aparat-overscan: 1.022;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent !important;
}
@media (max-width: 768px) {
  .video-detail-card { --aparat-overscan: 1.04; }
  .aparat-container,
  .aparat-embed-wrapper { border-radius: var(--radius-md); }
  .video-detail-card > .aparat-container { border-radius: var(--radius-md) var(--radius-md) 0 0; }
}

/* The public header gets its own wider container so navigation is balanced on
   large screens while keeping a deliberate safe inset from both viewport edges. */
.site-header .header-inner.container {
  max-width: 1500px;
  padding-inline: clamp(18px, 2.5vw, 40px);
}
.site-header .nav-menu { gap: 4px; min-width: 0; }
.site-header .nav-link { padding-inline: 11px; }
.site-header .header-actions { gap: 6px; }
@media (max-width: 1180px) and (min-width: 769px) {
  .site-header .header-inner.container { padding-inline: 20px; gap: 10px; }
  .site-header .nav-link { padding-inline: 8px; gap: 5px; font-size: .82rem; }
  .site-header .nav-menu { gap: 1px; }
  .site-header .header-actions { gap: 3px; }
}
@media (max-width: 768px) {
  .site-header .header-inner.container { padding-inline: 14px; }
}
@media (max-width: 480px) {
  .site-header .header-inner.container { padding-inline: 12px; }
}

/* v14 header optical insets: equal breathing room on both sides without
   squeezing the middle navigation. */
@media (min-width: 1181px) {
  .site-header .header-inner.container {
    width: min(100%, 1560px);
    max-width: 1560px;
    padding-inline: clamp(30px, 3.6vw, 58px);
    gap: clamp(12px, 1.4vw, 22px);
  }
  .site-header .brand-logo,
  .site-header .header-actions {
    flex: 0 0 auto;
  }
  .site-header .nav-menu {
    justify-content: center;
    flex: 1 1 auto;
  }
}

/* Final Aparat paint containment. clip-path prevents anti-aliased corners from
   revealing the card surface behind the cross-origin iframe. */
.aparat-container,
.aparat-embed-wrapper {
  line-height: 0;
}
.aparat-embed-wrapper {
  position: relative;
  display: block;
  font-size: 0;
  clip-path: inset(0 round var(--radius-lg));
}
.aparat-embed-wrapper > iframe,
.aparat-player-frame {
  position: absolute;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  vertical-align: top;
}
.video-detail-card > .aparat-container {
  clip-path: inset(0 round var(--radius-lg) var(--radius-lg) 0 0);
}
@media (max-width: 768px) {
  .video-detail-card > .aparat-container {
    clip-path: inset(0 round var(--radius-md) var(--radius-md) 0 0);
  }
}
@media (max-width: 768px) {
  .aparat-embed-wrapper { clip-path: inset(0 round var(--radius-md)); }
}

/* ========================================================================== 
   v15 — Responsive detail pages (article / product / video)
   Mobile media is allowed to use the full viewport width while text keeps a
   comfortable reading inset. This avoids the nested-card / double-padding look.
   ========================================================================== */
.content-detail-page {
  --detail-mobile-pad: 16px;
  padding-top: clamp(34px, 5vw, 64px);
}
.content-detail-page .detail-page-container { min-width: 0; }
.detail-shell { width: 100%; min-width: 0; margin-inline: auto; }
.article-detail-shell { max-width: 920px; }
.video-detail-shell { max-width: 960px; }
.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 26px;
  color: var(--text-tertiary);
  font-size: .8rem;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}
.detail-breadcrumb a { flex: 0 0 auto; color: var(--text-tertiary); }
.detail-breadcrumb svg { flex: 0 0 auto; }
.detail-breadcrumb > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.article-hero-header { margin-bottom: 26px; }
.article-head-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.article-detail-title,
.product-detail-title,
.video-detail-title {
  color: var(--text-primary);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.article-detail-title { margin: 0 0 17px; font-size: clamp(1.85rem, 4vw, 2.4rem); font-weight: 950; line-height: 1.5; letter-spacing: -.018em; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 11px 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: .82rem; }
.detail-meta > span { min-width: 0; }
.detail-featured-media { margin: 0 0 28px; }
.detail-featured-media img { display: block; width: 100% !important; max-width: 100%; height: auto !important; }
.detail-content-card { padding: clamp(24px, 4vw, 36px); margin-bottom: 30px; min-width: 0; }
.detail-comments-card { padding: clamp(20px, 3vw, 28px); }
.detail-content-card .article-content,
.detail-comments-card,
.product-detail-copy,
.product-media-column { min-width: 0; }

/* Article reading surface */
.article-detail-page .article-toc-card { margin-bottom: 24px; }
.article-detail-page .article-action-bar { margin-bottom: 30px; }
.article-detail-page .article-content { max-width: 100%; overflow-wrap: anywhere; }
.article-detail-page .article-content img,
.video-detail-page .article-content img,
.product-detail-page .article-content img { max-width: 100%; height: auto; }

/* Product detail */
.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(28px, 4vw, 46px);
  align-items: start;
  margin-bottom: 44px;
}
.product-main-media { margin-bottom: 18px; }
.product-detail-title { margin: 0 0 10px; font-size: clamp(1.7rem, 3vw, 2rem); font-weight: 950; line-height: 1.5; }
.product-detail-tagline { margin: 0 0 24px; color: var(--text-secondary); font-size: .98rem; line-height: 1.9; }
.product-description-card > div:first-child { min-width: 0; }
.product-description-card > div:first-child > div:last-child { min-width: 0; }

/* Video detail */
.video-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.video-detail-meta > span:not(.badge) { color: var(--text-tertiary); font-size: .78rem; }
.video-block-content { padding: clamp(22px, 3.4vw, 32px); }
.video-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 30px; }
.video-detail-card > .aparat-container,
.video-detail-card .aparat-embed-wrapper { aspect-ratio: 16 / 9; width: 100%; min-height: 0; }
.video-detail-card .aparat-player-frame { width: 100%; height: 100%; }

/* Comment forms should never force a two-column mobile layout just because the
   original markup contains an inline grid declaration. */
@media (max-width: 720px) {
  .content-detail-page { --detail-mobile-pad: 16px; padding: 24px 0 42px; }
  .content-detail-page .detail-page-container { padding-inline: var(--detail-mobile-pad) !important; }
  .detail-breadcrumb { margin-bottom: 18px; font-size: .75rem; }

  .article-head-tools { align-items: stretch; gap: 10px; }
  .article-head-tools > .badge { align-self: flex-start; }
  .article-head-tools .article-reaction-group { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-head-tools .article-reaction-btn { width: 100%; min-width: 0; }
  .article-detail-title { font-size: clamp(1.55rem, 7vw, 1.9rem); line-height: 1.52; margin-bottom: 15px; }
  .detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; padding-bottom: 18px; font-size: .77rem; }
  .detail-meta > span { display: inline-flex !important; align-items: center; gap: 5px !important; line-height: 1.7; }

  /* Featured article/product images and the complete video hero become true
     edge-to-edge media on phones; text/cards below keep their normal inset. */
  .article-detail-page .detail-featured-media,
  .product-detail-page .detail-featured-media,
  .video-detail-page .detail-featured-card {
    width: calc(100% + (var(--detail-mobile-pad) * 2));
    max-width: none;
    margin-inline: calc(var(--detail-mobile-pad) * -1);
    border-inline: 0 !important;
    border-radius: 0 !important;
  }
  .article-detail-page .detail-featured-media,
  .product-detail-page .detail-featured-media { margin-bottom: 22px; }
  .article-detail-page .detail-featured-media img,
  .product-detail-page .detail-featured-media img { border-radius: 0 !important; }
  .video-detail-page .video-detail-card > .aparat-container,
  .video-detail-page .video-detail-card .aparat-embed-wrapper { border-radius: 0 !important; clip-path: none !important; }
  .video-detail-page .video-detail-content { padding: 18px var(--detail-mobile-pad) 22px; }

  .detail-content-card { padding: 22px 16px !important; margin-bottom: 24px; border-radius: 16px; }
  .detail-comments-card { padding: 20px 16px !important; }
  .article-detail-page .article-toc-card { padding: 16px; border-radius: 14px; }
  .article-detail-page .article-toc-header { align-items: flex-start; gap: 10px; }
  .article-detail-page .article-toc-title { font-size: .94rem; }
  .article-detail-page .article-toc-toggle-btn { flex: 0 0 auto; }

  /* Images inside block content can use the full card width instead of being
     inset once by the page and a second time by the content card. */
  .detail-content-card .block-image {
    width: calc(100% + 32px);
    max-width: none;
    margin-inline: -16px;
    border-inline: 0 !important;
    border-radius: 0 !important;
  }
  .detail-content-card .block-image img { border-radius: 0 !important; }
  .detail-content-card .article-content.legacy img {
    width: calc(100% + 32px) !important;
    max-width: none !important;
    margin-inline: -16px !important;
    border-radius: 0 !important;
  }
  .detail-content-card .block-table { margin-inline: -4px; width: calc(100% + 8px); }

  .product-detail-grid { grid-template-columns: 1fr; gap: 20px; margin-bottom: 28px; }
  .product-media-column { display: flex; flex-direction: column; min-width: 0; }
  .product-detail-title { font-size: clamp(1.5rem, 6.4vw, 1.8rem); line-height: 1.55; }
  .product-detail-tagline { font-size: .92rem; line-height: 1.9; margin-bottom: 18px; }
  .product-detail-copy > div[style*="display:flex"] { gap: 7px !important; }
  .product-purchase-card { padding: 20px 16px !important; }
  .product-price-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .product-price-value { text-align: right; }
  .product-current-price { font-size: 1.45rem; }
  .product-description-card > div:first-child { align-items: flex-start !important; gap: 10px !important; }
  .product-description-card > div:first-child > div:first-child { width: 38px !important; height: 38px !important; flex: 0 0 38px !important; }
  .product-description-card h2 { font-size: 1.15rem !important; line-height: 1.6; }

  .video-detail-title { font-size: clamp(1.35rem, 6.3vw, 1.65rem); line-height: 1.62; margin-bottom: 14px; }
  .video-description { font-size: .91rem; line-height: 2; }
  .video-tags { margin-bottom: 24px; }

  .content-detail-page #comments form > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .content-detail-page #comments form { padding: 16px !important; }
}

@media (max-width: 420px) {
  .content-detail-page { --detail-mobile-pad: 12px; }
  .article-detail-title { font-size: 1.52rem; }
  .detail-meta { grid-template-columns: 1fr 1fr; column-gap: 8px; }
  .article-head-tools .article-reaction-btn { padding-inline: 9px; font-size: .78rem; }
  .detail-content-card { padding-inline: 14px !important; }
  .detail-content-card .block-image { width: calc(100% + 28px); margin-inline: -14px; }
  .detail-content-card .article-content.legacy img { width: calc(100% + 28px) !important; margin-inline: -14px !important; }
  .video-detail-page .video-detail-content { padding-inline: 14px; }
}

/* v15 — final mobile detail polish */
.content-detail-page .article-content,
.content-detail-page .product-description-content,
.content-detail-page .video-description {
  min-width: 0;
  overflow-wrap: anywhere;
}
.content-detail-page .block-table {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.content-detail-page iframe,
.content-detail-page video,
.content-detail-page canvas,
.content-detail-page svg,
.content-detail-page img {
  max-width: 100%;
}
@media (max-width: 720px) {
  .product-detail-page .product-media-column > .card:not(.product-main-media) {
    padding: 16px !important;
    margin-bottom: 0;
  }
  .product-detail-page .product-detail-copy > .card {
    padding: 18px 16px !important;
    margin-bottom: 18px !important;
  }
  .product-detail-page .product-features li {
    align-items: flex-start;
    line-height: 1.85;
  }
  .product-detail-page .product-reviews-panel {
    padding: 20px 16px !important;
    border-radius: 16px;
  }
  .product-detail-page .product-reviews-header {
    align-items: stretch !important;
    margin-bottom: 20px !important;
  }
  .product-detail-page .product-overall-rating {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px !important;
    gap: 10px !important;
  }
  .product-detail-page .product-review-form {
    padding: 16px !important;
    margin-bottom: 24px !important;
  }
  .product-detail-page .product-review-form > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .product-detail-page .product-sticky-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .article-detail-page .article-action-bar,
  .article-detail-page .article-toc-card,
  .video-detail-page .detail-content-card,
  .video-detail-page .detail-comments-card,
  .product-detail-page .detail-content-card,
  .product-detail-page .product-reviews-panel {
    min-width: 0;
    max-width: 100%;
  }
}

/* ========================================================================== 
   V17 — Editorial magazine + article reading experience + motion polish
   The structure intentionally follows a clean editorial rhythm: strong lead
   story, restrained cards, comfortable reading measure and mobile edge-to-edge
   media without copying any third-party brand assets.
   ========================================================================== */

html {
  scroll-padding-top: 92px;
  scrollbar-gutter: stable;
}
body {
  overscroll-behavior-y: none;
}
:is(h1,h2,h3,h4,[id]) {
  scroll-margin-top: 104px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  [data-animate] {
    transition-duration: .5s;
    transition-timing-function: cubic-bezier(.22,.61,.36,1);
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Magazine listing ---------------------------------------------------- */
.mag-editorial-page {
  --mag-card-bg: rgba(18, 22, 31, .76);
  --mag-soft: rgba(255,255,255,.055);
  position: relative;
  min-width: 0;
}
[data-theme="light"] .mag-editorial-page {
  --mag-card-bg: rgba(255,255,255,.92);
  --mag-soft: rgba(15,23,42,.055);
}
.mag-editorial-hero {
  padding: clamp(46px, 7vw, 88px) 0 clamp(28px, 4vw, 50px);
  position: relative;
}
.mag-editorial-hero::before {
  content: "";
  position: absolute;
  width: min(720px, 80vw);
  height: 420px;
  inset: -150px 50% auto auto;
  transform: translateX(50%);
  background: radial-gradient(circle, rgba(59,130,246,.13), rgba(99,102,241,.045) 42%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}
.mag-editorial-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.mag-editorial-copy { max-width: 760px; }
.mag-editorial-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-text);
  font-size: .82rem;
  font-weight: 850;
  margin-bottom: 16px;
}
.mag-editorial-kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}
.mag-editorial-copy h1 {
  font-size: clamp(2rem, 5vw, 3.45rem);
  line-height: 1.35;
  letter-spacing: -.025em;
  font-weight: 950;
  text-wrap: balance;
  max-width: 14ch;
  margin: 0 0 16px;
}
.mag-editorial-copy p {
  color: var(--text-secondary);
  max-width: 680px;
  font-size: clamp(.98rem, 1.4vw, 1.08rem);
  line-height: 2;
  text-wrap: pretty;
}
.mag-editorial-stat {
  min-width: 148px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--mag-card-bg);
  display: grid;
  gap: 2px;
}
.mag-editorial-stat strong { font-size: 1.8rem; line-height: 1.25; }
.mag-editorial-stat span { color: var(--text-secondary); font-size: .78rem; }
.mag-editorial-content { padding-top: 0; }
.mag-toolbar {
  position: sticky;
  top: 76px;
  z-index: 12;
  margin-bottom: 34px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15,17,23,.86);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}
[data-theme="light"] .mag-toolbar { background: rgba(248,249,251,.9); }
.mag-toolbar form { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 12px 18px; align-items: center; }
.mag-search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg-surface);
  color: var(--text-tertiary);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.mag-search-box:focus-within {
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,.09);
}
.mag-search-box > svg { margin-inline: 13px 8px; flex: 0 0 auto; }
.mag-search-box input {
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  height: 100%;
  padding-inline: 0 38px;
}
.mag-search-spinner {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mag-spin .65s linear infinite;
}
.mag-search-spinner[hidden] { display: none; }
@keyframes mag-spin { to { transform: rotate(360deg); } }
.mag-filter-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  padding: 2px;
}
.mag-filter-strip::-webkit-scrollbar { display: none; }
.mag-filter-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: .2s ease;
}
.mag-filter-chip:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-surface); }
.mag-filter-chip.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }
.mag-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.mag-results-head > div { display: grid; gap: 3px; }
.mag-results-head span { color: var(--text-tertiary); font-size: .78rem; }
.mag-results-head h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.5; }
.mag-result-count {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}
#articlesResultsContainer { min-height: 220px; transition: opacity .2s ease; }
#articlesResultsContainer.is-loading { opacity: .48; pointer-events: none; }
.mag-editorial-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
.mag-story-card {
  grid-column: span 4;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--mag-card-bg);
  display: flex;
  flex-direction: column;
  transition: transform .25s cubic-bezier(.22,.61,.36,1), border-color .25s ease, background .25s ease;
}
.mag-story-card:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.mag-story-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}
.mag-story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
}
.mag-story-card:hover .mag-story-media img { transform: scale(1.035); }
.mag-story-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 20px 20px 18px;
}
.mag-story-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: .75rem;
  margin-bottom: 10px;
}
.mag-story-eyebrow > span { color: var(--accent-text); font-weight: 800; }
.mag-story-content h3 { margin: 0 0 9px; font-size: 1.08rem; line-height: 1.72; font-weight: 900; text-wrap: pretty; }
.mag-story-content h3 a { color: var(--text-primary); }
.mag-story-content h3 a:hover { color: var(--accent-text); }
.mag-story-content > p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: .86rem;
  line-height: 1.95;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mag-story-footer {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-tertiary);
  font-size: .74rem;
}
.mag-story-link { margin-right: auto; color: var(--accent-text); font-weight: 800; white-space: nowrap; }
.mag-story-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, .75fr);
  height: clamp(440px, 30vw, 500px);
  min-height: 0;
  align-items: stretch;
  border-radius: 24px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--mag-card-bg) 96%, var(--accent) 4%), var(--mag-card-bg));
}
/* The lead image is full-bleed inside its pane. The card height is bounded so a
   native 16:9 cover only needs a very small crop instead of leaving dark bars. */
.mag-story-featured .mag-story-media {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  background: transparent;
}
.mag-story-featured .mag-story-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.mag-story-featured .mag-story-content {
  padding: clamp(26px, 2.7vw, 40px);
  justify-content: center;
  min-height: 0;
}
.mag-story-featured .mag-story-eyebrow { margin-bottom: 12px; }
.mag-story-featured .mag-story-content h3 {
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.65;
  margin-bottom: 12px;
  text-wrap: balance;
}
.mag-story-featured .mag-story-content > p {
  font-size: .92rem;
  line-height: 2;
  -webkit-line-clamp: 2;
  margin-bottom: 16px;
}
.mag-story-featured .mag-story-footer { padding-top: 12px; align-items: center; }
.mag-story-featured .mag-story-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.mag-story-featured .mag-story-link:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateX(-2px);
}
.mag-empty-state {
  min-height: 280px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 30px;
}
.mag-empty-state strong { color: var(--text-primary); font-size: 1.05rem; }

/* --- Article detail: editorial reading measure --------------------------- */
.article-detail-page {
  padding-top: clamp(34px, 5vw, 62px) !important;
}
.article-detail-page .detail-page-container { max-width: 1180px; }
.article-detail-page .article-detail-shell { max-width: 1100px; }
.article-detail-page .detail-breadcrumb {
  max-width: 850px;
  margin-inline: auto;
  margin-bottom: 25px;
  font-size: .78rem;
  color: var(--text-tertiary);
}
.article-detail-page .article-hero-header {
  max-width: 850px;
  margin: 0 auto clamp(28px, 4vw, 42px);
  text-align: right;
}
.article-detail-page .article-head-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.article-detail-page .article-detail-title {
  font-size: clamp(2.1rem, 4.5vw, 3.35rem);
  line-height: 1.42;
  letter-spacing: -.028em;
  font-weight: 950;
  text-wrap: balance;
  margin-bottom: 20px;
}
.article-detail-page .article-meta {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-top: 0;
  border-top: 0;
  color: var(--text-secondary);
  font-size: .78rem;
}
.article-detail-page .article-featured-media {
  max-width: 1080px;
  margin: 0 auto clamp(30px, 4vw, 46px);
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg-elevated) !important;
}
.article-detail-page .article-featured-media img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: contain !important;
  border-radius: inherit !important;
}
.article-detail-page .article-toc-card,
.article-detail-page .article-main-body,
.article-detail-page .article-action-bar,
.article-detail-page .detail-comments-card {
  max-width: 820px;
  margin-inline: auto;
}
.article-detail-page .article-toc-card {
  margin-bottom: 34px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--bg-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.article-detail-page .article-main-body.detail-content-card {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
  margin-bottom: 38px;
}
.article-detail-page .article-main-body .article-content {
  font-size: clamp(1rem, 1.15vw, 1.075rem);
  line-height: 2.15;
  color: var(--text-primary);
}
.article-detail-page .article-main-body .block-paragraph { margin: 0 0 1.35em; }
.article-detail-page .article-main-body h2.block-heading {
  font-size: clamp(1.45rem, 2.35vw, 1.9rem);
  line-height: 1.65;
  margin: 2.2em 0 .75em;
  letter-spacing: -.015em;
}
.article-detail-page .article-main-body h3.block-heading {
  font-size: clamp(1.18rem, 1.8vw, 1.42rem);
  line-height: 1.72;
  margin: 1.9em 0 .65em;
}
.article-detail-page .article-main-body .block-list { margin-block: 1.1em 1.5em; }
.article-detail-page .article-main-body .block-list li { margin-bottom: .55em; }
.article-detail-page .article-main-body .block-image {
  margin: 2em 0;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.article-detail-page .article-main-body .block-image figcaption { text-align: center; padding: 9px 13px 12px; font-size: .76rem; color: var(--text-tertiary); }
.article-detail-page .article-main-body .block-callout,
.article-detail-page .article-main-body .block-code,
.article-detail-page .article-main-body .block-table,
.article-detail-page .article-main-body .block-faq,
.article-detail-page .article-main-body .block-quote { margin-block: 1.6em; }
.article-detail-page .article-action-bar { margin-bottom: 34px; }
.article-detail-page .detail-comments-card { margin-bottom: 28px; }

/* Reading progress line feels lighter than a floating scrollbar and is disabled
   automatically when JavaScript is unavailable. */
.article-reading-progress {
  position: fixed;
  z-index: 95;
  top: 72px;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  background: transparent;
}
.article-reading-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #8b5cf6);
  transform-origin: right center;
  transition: width .08s linear;
}

/* Homepage video posters: always fill the media slot like a real thumbnail. */
.video-card-thumbnail,
.video-card-thumbnail-aparat {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  background: var(--bg-elevated);
}
.video-card-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,.02) 25%, rgba(255,255,255,.07) 42%, rgba(255,255,255,.02) 60%);
  background-size: 240% 100%;
  animation: video-thumb-shimmer 1.35s ease-in-out infinite;
  z-index: 0;
}
.video-card-preview > img,
.video-card-preview > iframe,
.video-card-preview > .video-card-media-fallback { z-index: 1; }
@keyframes video-thumb-shimmer { to { background-position: -180% 0; } }

/* --- Responsive editorial layout ---------------------------------------- */
@media (max-width: 980px) {
  .mag-story-card { grid-column: span 6; }
  .mag-story-featured {
    grid-column: 1/-1;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
  }
  .mag-story-featured .mag-story-media {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .mag-story-featured .mag-story-content { padding: 22px 22px 20px; }
  .mag-story-featured .mag-story-content h3 { font-size: clamp(1.35rem, 4vw, 1.72rem); }
  .mag-toolbar form { grid-template-columns: 1fr; }
  .mag-toolbar { top: 68px; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 76px; scrollbar-gutter: auto; }
  body { overscroll-behavior-y: auto; }
  .mag-editorial-hero { padding: 30px 0 18px; }
  .mag-editorial-hero .container,
  .mag-editorial-content .container { padding-inline: 14px; }
  .mag-editorial-hero-inner { grid-template-columns: 1fr; gap: 20px; padding-bottom: 24px; }
  .mag-editorial-copy h1 { font-size: clamp(1.7rem, 8.4vw, 2.35rem); max-width: 17ch; line-height: 1.48; }
  .mag-editorial-copy p { font-size: .92rem; line-height: 1.95; }
  .mag-editorial-stat { display: none; }
  .mag-toolbar { position: relative; top: auto; margin-bottom: 26px; padding: 10px; border-radius: 15px; }
  .mag-toolbar form { gap: 10px; }
  .mag-search-box { height: 46px; }
  .mag-filter-strip { margin-inline: -2px; padding-bottom: 2px; }
  .mag-results-head { margin-bottom: 16px; }
  .mag-results-head h2 { font-size: 1.25rem; }
  .mag-editorial-grid { grid-template-columns: 1fr; gap: 16px; }
  .mag-story-card,
  .mag-story-featured { grid-column: 1; display: flex; min-height: 0; border-radius: 17px; }
  .mag-story-media,
  .mag-story-featured .mag-story-media { aspect-ratio: 16 / 9; min-height: 0; }
  .mag-story-content,
  .mag-story-featured .mag-story-content { padding: 16px 15px 14px; }
  .mag-story-content h3,
  .mag-story-featured .mag-story-content h3 { font-size: 1.05rem; line-height: 1.75; margin-bottom: 7px; }
  .mag-story-content > p,
  .mag-story-featured .mag-story-content > p { font-size: .84rem; line-height: 1.9; -webkit-line-clamp: 2; margin-bottom: 13px; }
  .mag-story-footer { gap: 10px; }
  .mag-story-link { width: 100%; margin: 2px 0 0; padding-top: 9px; border-top: 1px dashed var(--border); }

  .article-detail-page { padding-top: 24px !important; }
  .article-detail-page .detail-page-container { padding-inline: 14px !important; }
  .article-detail-page .detail-breadcrumb { margin-bottom: 18px; font-size: .72rem; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
  .article-detail-page .detail-breadcrumb::-webkit-scrollbar { display: none; }
  .article-detail-page .article-hero-header { margin-bottom: 24px; }
  .article-detail-page .article-head-tools { margin-bottom: 14px; align-items: flex-start; }
  .article-detail-page .article-detail-title { font-size: clamp(1.72rem, 8.1vw, 2.28rem); line-height: 1.5; margin-bottom: 18px; }
  .article-detail-page .article-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; font-size: .74rem; }
  .article-detail-page .article-featured-media {
    width: calc(100% + 28px);
    max-width: none;
    margin-inline: -14px;
    border-inline: 0;
    border-radius: 0;
    margin-bottom: 28px;
  }
  .article-detail-page .article-featured-media img { border-radius: 0 !important; }
  .article-detail-page .article-toc-card { margin-bottom: 26px; padding: 15px; }
  .article-detail-page .article-main-body .article-content { font-size: .98rem; line-height: 2.08; }
  .article-detail-page .article-main-body h2.block-heading { font-size: 1.38rem; margin-top: 1.9em; }
  .article-detail-page .article-main-body h3.block-heading { font-size: 1.17rem; margin-top: 1.65em; }
  .article-detail-page .article-main-body .block-image {
    width: calc(100% + 28px);
    max-width: none;
    margin-inline: -14px;
    border-inline: 0;
    border-radius: 0;
  }
  .article-detail-page .article-main-body .block-image img { border-radius: 0 !important; }
  .article-detail-page .article-main-body .block-image figcaption { padding-inline: 14px; }
  .article-detail-page .article-action-bar,
  .article-detail-page .detail-comments-card { border-radius: 16px; }
  .article-reading-progress { top: 58px; }
}
@media (max-width: 420px) {
  .mag-editorial-hero .container,
  .mag-editorial-content .container,
  .article-detail-page .detail-page-container { padding-inline: 12px !important; }
  .article-detail-page .article-featured-media,
  .article-detail-page .article-main-body .block-image { width: calc(100% + 24px); margin-inline: -12px; }
  .article-detail-page .article-meta { grid-template-columns: 1fr 1fr; }
  .article-detail-page .article-reaction-group-compact { width: 100%; }
  .article-detail-page .article-reaction-group-compact .article-reaction-btn { flex: 1; }
}


/* v17: graceful Aparat-poster fallback. If the metadata endpoint cannot
   resolve a thumbnail, stop the shimmer and keep the card intentional. */
.video-card-preview.video-poster-unavailable {
  background:
    radial-gradient(circle at 50% 42%, rgba(59,130,246,.18), transparent 36%),
    linear-gradient(145deg, rgba(20,28,43,.96), rgba(11,15,23,.98));
}
.video-card-preview.video-poster-unavailable::before {
  animation: none !important;
  opacity: 0 !important;
}
.video-card-preview.video-poster-unavailable .video-card-thumbnail { display: none !important; }
[data-theme="light"] .video-card-preview.video-poster-unavailable {
  background:
    radial-gradient(circle at 50% 42%, rgba(59,130,246,.14), transparent 36%),
    linear-gradient(145deg, #f8fafc, #eef2f7);
}


/* v19: uploaded video posters are real cover media, not a decorative layer. */
.video-card-preview {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-elevated);
}
.video-card-preview .video-card-thumbnail {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  object-fit: cover !important;
  object-position: 50% 50% !important;
  border-radius: 0;
}
@media (max-width: 720px) {
  .mag-story-featured .mag-story-media { width: 100%; }
}
/* === V22 ARTICLE READING EXPERIENCE ===================================== */
.article-v22-page {
  position: relative;
  padding: clamp(30px, 4vw, 58px) 0 74px !important;
  overflow: clip;
}
.article-v22-page::before {
  content: "";
  position: absolute;
  width: min(720px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  top: -360px;
  right: -220px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}
.article-v22-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  padding-inline: clamp(18px, 3vw, 32px);
}
.article-v22-shell { max-width: 1160px; margin-inline: auto; }

.article-v22-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 980px;
  margin: 0 auto 28px;
  color: var(--text-tertiary);
  font-size: .78rem;
  line-height: 1.6;
}
.article-v22-breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color .18s ease;
}
.article-v22-breadcrumb a:hover { color: var(--accent); }
.article-v22-breadcrumb svg { flex: 0 0 auto; opacity: .62; }

.article-v22-hero {
  max-width: 980px;
  margin-inline: auto;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.article-v22-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.article-v22-category {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: color-mix(in srgb, var(--accent) 74%, white);
  font-size: .78rem;
  font-weight: 800;
}
[data-theme="light"] .article-v22-category {
  color: color-mix(in srgb, var(--accent) 78%, #14213d);
}
.article-v22-hero-actions { display: flex; align-items: center; gap: 8px; }
.article-v22-share-btn {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-surface) 86%, transparent);
  color: var(--text-secondary);
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}
.article-v22-share-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
  transform: translateY(-1px);
}
.article-v22-share-btn.copied { color: #34d399; border-color: rgba(52,211,153,.42); }

.article-v22-title {
  max-width: 20ch;
  margin: 0 0 18px;
  color: var(--text-primary);
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  line-height: 1.42;
  font-weight: 950;
  letter-spacing: -.035em;
  text-wrap: pretty;
}
.article-v22-lead {
  max-width: 850px;
  margin: 0 0 26px;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.35vw, 1.14rem);
  line-height: 2.05;
  text-wrap: pretty;
}
.article-v22-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  padding: 18px 0;
  border-block: 1px solid var(--border);
}
.article-v22-author {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.article-v22-author > img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: var(--bg-elevated);
}
.article-v22-author-copy { min-width: 0; display: grid; gap: 2px; }
.article-v22-author-label { color: var(--text-tertiary); font-size: .68rem; }
.article-v22-author-copy strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: .84rem;
  font-weight: 850;
  white-space: nowrap;
}
.article-v22-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-tertiary);
  font-size: .75rem;
}
.article-v22-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.article-v22-meta svg { opacity: .8; }

.article-v22-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.article-v22-reaction-label {
  color: var(--text-tertiary);
  font-size: .72rem;
  margin-left: 3px;
}
.article-v22-reactions .article-reaction-btn {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: .72rem;
}

.article-v22-cover {
  position: relative;
  max-width: 1120px;
  margin: 0 auto clamp(38px, 5vw, 58px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: clamp(18px, 2.4vw, 28px);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: 0 20px 60px rgba(0,0,0,.14);
  isolation: isolate;
}
.article-v22-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
  border-radius: inherit;
  pointer-events: none;
}
.article-v22-cover img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.article-v22-reading-layout {
  max-width: 1080px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(220px, 260px);
  grid-template-areas: "main rail";
  gap: clamp(26px, 3vw, 42px);
  align-items: start;
  direction: ltr;
}
.article-v22-reading-layout.without-toc {
  display: block;
  max-width: 780px;
}
.article-v22-reading-column {
  grid-area: main;
  min-width: 0;
  direction: rtl;
}
.article-v22-rail {
  grid-area: rail;
  min-width: 0;
  direction: rtl;
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  scrollbar-width: thin;
}
.article-v22-rail .article-toc-card {
  width: 100%;
  margin: 0;
  padding: 15px 14px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.article-v22-rail .article-toc-header {
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  cursor: default !important;
}
.article-v22-rail .article-toc-title { font-size: .84rem; }
.article-v22-rail .article-toc-toggle-btn { display: none; }
.article-v22-rail .article-toc-card.collapsed .article-toc-body,
.article-v22-rail .article-toc-body {
  display: block !important;
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin-top: 10px !important;
}
.article-v22-rail .article-toc-list { gap: 2px; }
.article-v22-rail .article-toc-list .toc-item a {
  padding: 7px 7px;
  border-radius: 9px;
  font-size: .74rem;
  line-height: 1.75;
}
.article-v22-rail .article-toc-list .toc-item.toc-h3 a {
  padding-right: 18px;
  font-size: .7rem;
}
.article-v22-rail .article-toc-list .toc-bullet { min-width: 18px; }
.article-v22-rail-actions {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
}
.article-v22-rail-actions button,
.article-v22-rail-actions a {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: .72rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.article-v22-rail-actions button:hover,
.article-v22-rail-actions a:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.article-v22-page .article-main-body.detail-content-card {
  max-width: none;
  margin: 0 0 36px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}
.article-v22-page .article-main-body .article-content {
  max-width: 100%;
  color: color-mix(in srgb, var(--text-primary) 92%, var(--text-secondary));
  font-size: clamp(1.035rem, 1.15vw, 1.11rem);
  line-height: 2.18;
  letter-spacing: -.002em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.article-v22-page .article-main-body .block-paragraph,
.article-v22-page .article-main-body .article-content > p {
  margin: 0 0 1.38em;
}
.article-v22-page .article-main-body h2.block-heading,
.article-v22-page .article-main-body .article-content > h2 {
  position: relative;
  margin: 2.35em 0 .8em;
  padding-top: .2em;
  color: var(--text-primary);
  font-size: clamp(1.48rem, 2vw, 1.82rem);
  line-height: 1.62;
  font-weight: 920;
  letter-spacing: -.02em;
  text-wrap: pretty;
  scroll-margin-top: 108px;
}
.article-v22-page .article-main-body h2.block-heading::before,
.article-v22-page .article-main-body .article-content > h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1em;
  margin-left: 9px;
  vertical-align: -.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa, #8b5cf6);
}
.article-v22-page .article-main-body h3.block-heading,
.article-v22-page .article-main-body .article-content > h3 {
  margin: 2em 0 .72em;
  color: var(--text-primary);
  font-size: clamp(1.18rem, 1.5vw, 1.38rem);
  line-height: 1.7;
  font-weight: 880;
  scroll-margin-top: 108px;
}
.article-v22-page .article-main-body a:not(.btn) {
  color: color-mix(in srgb, var(--accent) 78%, #60a5fa);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.article-v22-page .article-main-body strong { color: var(--text-primary); font-weight: 850; }
.article-v22-page .article-main-body .block-list {
  margin: 1.1em 0 1.55em;
  padding-right: 1.25em;
}
.article-v22-page .article-main-body .block-list li { margin-bottom: .62em; padding-right: .2em; }
.article-v22-page .article-main-body .block-image {
  margin: 2.2em 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.article-v22-page .article-main-body .block-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 0 !important;
}
.article-v22-page .article-main-body .block-image figcaption {
  padding: 10px 14px 12px;
  color: var(--text-tertiary);
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  font-size: .74rem;
  line-height: 1.75;
  text-align: center;
}
.article-v22-page .article-main-body .block-quote {
  position: relative;
  margin: 1.9em 0;
  padding: 20px 22px 20px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-right: 4px solid color-mix(in srgb, var(--accent) 76%, #8b5cf6);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-surface));
}
.article-v22-page .article-main-body .block-callout,
.article-v22-page .article-main-body .block-code,
.article-v22-page .article-main-body .block-table,
.article-v22-page .article-main-body .block-faq,
.article-v22-page .article-main-body .block-embed {
  margin-block: 1.8em;
}
.article-v22-page .article-main-body .block-code,
.article-v22-page .article-main-body .block-table {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.article-v22-page .article-main-body .block-divider {
  margin: 2.4em 0;
  border-color: var(--border);
}

.article-v22-end-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 36px 0 24px;
}
.article-v22-end-divider::before,
.article-v22-end-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}
.article-v22-end-divider > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 72%, #8b5cf6);
}

.article-v22-author-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
}
.article-v22-author-card > img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.article-v22-author-card-copy > span { color: var(--text-tertiary); font-size: .69rem; }
.article-v22-author-card-copy h2 {
  margin: 3px 0 5px;
  font-size: 1rem;
  line-height: 1.6;
}
.article-v22-author-card-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.9;
}

.article-v22-feedback {
  max-width: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 34px !important;
  padding: 16px 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  border: 1px solid var(--border);
}
.article-v22-feedback .article-action-copy {
  display: grid;
  gap: 3px;
}
.article-v22-feedback .article-action-copy strong { color: var(--text-primary); font-size: .88rem; }
.article-v22-feedback .article-action-copy span { color: var(--text-tertiary); font-size: .72rem; }

.article-v22-related {
  max-width: 1080px;
  margin: clamp(50px, 7vw, 76px) auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.article-v22-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.article-v22-section-head > div { display: grid; gap: 3px; }
.article-v22-section-head span { color: var(--text-tertiary); font-size: .72rem; }
.article-v22-section-head h2 { margin: 0; font-size: clamp(1.3rem, 2vw, 1.7rem); line-height: 1.6; }
.article-v22-section-head > a {
  color: var(--accent);
  text-decoration: none;
  font-size: .76rem;
  font-weight: 800;
}
.article-v22-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.article-v22-related-card {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 17px;
  overflow: hidden;
  background: var(--bg-surface);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.article-v22-related-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 14px 34px rgba(0,0,0,.1);
}
.article-v22-related-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elevated);
}
.article-v22-related-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .35s ease;
}
.article-v22-related-card:hover .article-v22-related-media img { transform: scale(1.025); }
.article-v22-related-copy { padding: 14px 14px 13px; }
.article-v22-related-category { color: var(--accent); font-size: .67rem; font-weight: 800; }
.article-v22-related-copy h3 {
  margin: 6px 0 12px;
  font-size: .94rem;
  line-height: 1.8;
  font-weight: 850;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-v22-related-meta {
  display: flex;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: .68rem;
}

.article-v22-comments {
  max-width: 920px !important;
  margin: clamp(50px, 7vw, 76px) auto 0 !important;
  padding: clamp(20px, 3vw, 30px) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent) !important;
}
.article-v22-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.article-v22-comments-head > div { display: grid; gap: 2px; }
.article-v22-comments-head > div > span { color: var(--text-tertiary); font-size: .7rem; }
.article-v22-comments-head h2 { margin: 0; font-size: 1.28rem; line-height: 1.6; }
.article-v22-comments-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: .7rem;
  border: 1px solid var(--border);
}
.article-v22-alert {
  margin-bottom: 18px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: .78rem;
  text-align: center;
}
.article-v22-alert-error { color: #fca5a5; border: 1px solid rgba(248,113,113,.28); background: rgba(248,113,113,.08); }
.article-v22-alert-success { color: #6ee7b7; border: 1px solid rgba(52,211,153,.28); background: rgba(52,211,153,.08); }

.article-v22-comment-form {
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
}
.article-v22-comment-form-head { display: grid; gap: 2px; margin-bottom: 14px; }
.article-v22-comment-form-head strong { font-size: .9rem; }
.article-v22-comment-form-head span { color: var(--text-tertiary); font-size: .68rem; }
.article-v22-comment-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.article-v22-field { display: grid; gap: 6px; margin-bottom: 12px; color: var(--text-secondary); font-size: .72rem; }
.article-v22-field .form-control { min-width: 0; }
.article-v22-comment-submit { display: flex; justify-content: flex-start; }
.article-v22-comment-submit .btn { min-width: 132px; }
.article-v22-comments-list { display: grid; gap: 14px; }
.article-v22-comments-list .comment-thread { margin: 0; }
.article-v22-comments-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--text-tertiary);
  text-align: center;
}
.article-v22-comments-empty svg { margin-bottom: 4px; opacity: .6; }
.article-v22-comments-empty strong { color: var(--text-primary); font-size: .9rem; }
.article-v22-comments-empty span { max-width: 420px; font-size: .74rem; line-height: 1.8; }

.article-v22-page .article-scroll-top-btn {
  border-radius: 12px;
}

@media (max-width: 1020px) {
  .article-v22-reading-layout,
  .article-v22-reading-layout.without-toc {
    display: block;
    max-width: 800px;
  }
  .article-v22-rail {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 26px;
  }
  .article-v22-rail .article-toc-card {
    padding: 15px 16px;
    margin: 0;
  }
  .article-v22-rail .article-toc-header { cursor: pointer !important; padding-bottom: 0; border-bottom: 0; }
  .article-v22-rail .article-toc-toggle-btn { display: inline-flex; }
  .article-v22-rail .article-toc-card.collapsed .article-toc-body {
    display: grid !important;
    max-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    margin-top: 0 !important;
  }
  .article-v22-rail .article-toc-card:not(.collapsed) .article-toc-body {
    max-height: 520px !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-top: 12px !important;
  }
  .article-v22-rail-actions { display: none; }
  .article-v22-related { max-width: 920px; }
}

@media (max-width: 760px) {
  .article-v22-page {
    padding-top: 18px !important;
    padding-bottom: 54px !important;
  }
  .article-v22-container { padding-inline: 14px; }
  .article-v22-breadcrumb {
    margin-bottom: 18px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: .69rem;
  }
  .article-v22-breadcrumb::-webkit-scrollbar { display: none; }
  .article-v22-hero { margin-bottom: 24px; }
  .article-v22-kicker-row { margin-bottom: 14px; }
  .article-v22-share-btn span { display: none; }
  .article-v22-share-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }
  .article-v22-title {
    max-width: none;
    margin-bottom: 14px;
    font-size: clamp(1.75rem, 7.8vw, 2.35rem);
    line-height: 1.5;
    letter-spacing: -.025em;
  }
  .article-v22-lead {
    margin-bottom: 20px;
    font-size: .94rem;
    line-height: 1.95;
  }
  .article-v22-byline {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    padding: 15px 0;
  }
  .article-v22-meta {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
  }
  .article-v22-meta > span {
    min-width: 0;
    padding: 8px 7px;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
    font-size: .66rem;
  }
  .article-v22-meta svg { width: 14px; height: 14px; flex: 0 0 auto; }
  .article-v22-reactions {
    margin-top: 12px;
  }
  .article-v22-reaction-label { flex: 0 0 100%; margin-bottom: 1px; }
  .article-v22-reactions .article-reaction-btn { flex: 1 1 0; justify-content: center; }

  .article-v22-cover {
    width: calc(100% + 28px);
    max-width: none;
    margin-inline: -14px;
    margin-bottom: 28px;
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .article-v22-reading-layout,
  .article-v22-reading-layout.without-toc { max-width: none; }
  .article-v22-rail { margin-bottom: 22px; }
  .article-v22-rail .article-toc-card {
    border-radius: 14px;
    padding: 14px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .article-v22-page .article-main-body .article-content {
    font-size: 1rem;
    line-height: 2.08;
  }
  .article-v22-page .article-main-body h2.block-heading,
  .article-v22-page .article-main-body .article-content > h2 {
    margin-top: 2em;
    font-size: 1.38rem;
    line-height: 1.7;
    scroll-margin-top: 82px;
  }
  .article-v22-page .article-main-body h3.block-heading,
  .article-v22-page .article-main-body .article-content > h3 {
    margin-top: 1.75em;
    font-size: 1.16rem;
    scroll-margin-top: 82px;
  }
  .article-v22-page .article-main-body .block-image {
    width: calc(100% + 28px);
    margin-inline: -14px;
    border-inline: 0;
    border-radius: 0;
  }
  .article-v22-page .article-main-body .block-image figcaption { padding-inline: 14px; }
  .article-v22-page .article-main-body .block-code,
  .article-v22-page .article-main-body .block-table,
  .article-v22-page .article-main-body .block-embed {
    width: calc(100% + 8px);
    margin-inline: -4px;
  }
  .article-v22-page .article-main-body .block-callout,
  .article-v22-page .article-main-body .block-quote { border-radius: 12px; }

  .article-v22-author-card {
    grid-template-columns: 50px minmax(0,1fr);
    gap: 12px;
    padding: 14px;
  }
  .article-v22-author-card > img { width: 50px; height: 50px; }
  .article-v22-author-card-copy p { font-size: .76rem; }

  .article-v22-feedback {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }
  .article-v22-feedback .article-reaction-group { width: 100%; }
  .article-v22-feedback .article-reaction-btn { flex: 1; justify-content: center; }

  .article-v22-related {
    margin-top: 48px;
    padding-top: 24px;
  }
  .article-v22-section-head { align-items: flex-start; }
  .article-v22-section-head > a { margin-top: 8px; }
  .article-v22-related-grid {
    display: flex;
    gap: 12px;
    margin-inline: -14px;
    padding-inline: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .article-v22-related-grid::-webkit-scrollbar { display: none; }
  .article-v22-related-card {
    flex: 0 0 min(82vw, 320px);
    scroll-snap-align: start;
  }

  .article-v22-comments {
    width: calc(100% + 28px);
    margin-inline: -14px !important;
    padding: 18px 14px !important;
    border-inline: 0 !important;
    border-radius: 0 !important;
  }
  .article-v22-comments-head { align-items: flex-start; }
  .article-v22-comments-head h2 { font-size: 1.16rem; }
  .article-v22-comment-form { padding: 14px; }
  .article-v22-comment-grid { grid-template-columns: 1fr; gap: 0; }
  .article-v22-comment-submit .btn { width: 100%; }
}

@media (max-width: 430px) {
  .article-v22-container { padding-inline: 12px; }
  .article-v22-cover {
    width: calc(100% + 24px);
    margin-inline: -12px;
  }
  .article-v22-meta { grid-template-columns: 1fr 1fr; }
  .article-v22-meta > span:first-child { grid-column: 1 / -1; justify-content: flex-start; padding-inline: 10px; }
  .article-v22-page .article-main-body .block-image {
    width: calc(100% + 24px);
    margin-inline: -12px;
  }
  .article-v22-related-grid {
    margin-inline: -12px;
    padding-inline: 12px;
  }
  .article-v22-comments {
    width: calc(100% + 24px);
    margin-inline: -12px !important;
    padding-inline: 12px !important;
  }
  .article-v22-section-head > a { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .article-v22-related-card,
  .article-v22-related-media img,
  .article-v22-share-btn { transition: none !important; }
}


/* === V23 ARTICLE IMAGE-FIRST EDITORIAL REDESIGN ======================== */
.article-v23-page {
  padding-top: clamp(18px, 2.6vw, 34px) !important;
}
.article-v23-container {
  max-width: 1320px;
  padding-inline: clamp(18px, 3vw, 36px);
}
.article-v23-shell { max-width: 1180px; }
.article-v23-breadcrumb {
  max-width: 1180px;
  margin-bottom: 18px;
}

.article-v23-page .article-v23-cover {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto clamp(26px, 3.6vw, 42px);
  aspect-ratio: 16 / 9;
  border-radius: clamp(20px, 2.2vw, 30px);
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  overflow: hidden;
  background: #0b1019;
  box-shadow: 0 24px 72px rgba(0,0,0,.18);
}
.article-v23-page .article-v23-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
}

.article-v23-page .article-v23-hero {
  max-width: 930px;
  margin: 0 auto clamp(38px, 5vw, 58px);
}
.article-v23-kicker-row {
  margin-bottom: 16px;
  padding-bottom: 0;
}
.article-v23-category {
  min-height: 32px;
  padding: 5px 12px;
  font-size: .74rem;
}
.article-v23-page .article-v23-title {
  max-width: 22ch;
  margin: 0 0 16px;
  font-size: clamp(2.15rem, 4.15vw, 3.55rem);
  line-height: 1.42;
  letter-spacing: -.032em;
}
.article-v23-page .article-v23-lead {
  max-width: 820px;
  margin-bottom: 22px;
  color: color-mix(in srgb, var(--text-secondary) 94%, var(--text-primary));
  font-size: clamp(.98rem, 1.28vw, 1.1rem);
  line-height: 2;
}
.article-v23-byline-panel {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 20px 28px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
}
.article-v23-author { min-width: 0; }
.article-v23-author > img {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}
.article-v23-page .article-v23-meta {
  justify-content: flex-end;
  gap: 8px 16px;
}
.article-v23-page .article-v23-meta > span {
  padding: 7px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-elevated) 66%, transparent);
}
.article-v23-share-btn { min-height: 36px; }

/* Reading column begins with breathing room after the editorial header. */
.article-v23-page .article-v22-reading-layout { margin-top: 0; }
.article-v23-page .article-main-body .article-content {
  font-size: clamp(1.035rem, 1.08vw, 1.095rem);
  line-height: 2.12;
}

@media (max-width: 1020px) {
  .article-v23-page .article-v23-cover { max-width: 960px; }
  .article-v23-page .article-v23-hero { max-width: 800px; }
}

@media (max-width: 760px) {
  .article-v23-page {
    padding-top: 12px !important;
    padding-bottom: 52px !important;
  }
  .article-v23-container { padding-inline: 14px; }
  .article-v23-breadcrumb { margin-bottom: 13px; }
  .article-v23-page .article-v23-cover {
    width: calc(100% + 28px);
    max-width: none;
    margin-inline: -14px;
    margin-bottom: 22px;
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .article-v23-page .article-v23-hero { margin-bottom: 30px; }
  .article-v23-kicker-row { margin-bottom: 12px; }
  .article-v23-page .article-v23-title {
    max-width: none;
    margin-bottom: 12px;
    font-size: clamp(1.7rem, 7.6vw, 2.25rem);
    line-height: 1.52;
    letter-spacing: -.02em;
  }
  .article-v23-page .article-v23-lead {
    margin-bottom: 17px;
    font-size: .92rem;
    line-height: 1.92;
  }
  .article-v23-byline-panel {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 13px;
    border-radius: 14px;
  }
  .article-v23-page .article-v23-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    width: 100%;
    gap: 7px;
  }
  .article-v23-page .article-v23-meta > span {
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 8px 5px;
    font-size: .64rem;
    white-space: normal;
  }
  .article-v23-page .article-v23-meta svg { flex: 0 0 auto; width: 14px; height: 14px; }
  .article-v23-page .article-main-body .article-content {
    font-size: .99rem;
    line-height: 2.04;
  }
}

@media (max-width: 430px) {
  .article-v23-container { padding-inline: 12px; }
  .article-v23-page .article-v23-cover {
    width: calc(100% + 24px);
    margin-inline: -12px;
  }
  .article-v23-page .article-v23-title { font-size: clamp(1.58rem, 7.8vw, 2rem); }
  .article-v23-page .article-v23-meta { grid-template-columns: 1fr 1fr; }
  .article-v23-page .article-v23-meta > span:first-child {
    grid-column: 1 / -1;
    justify-content: flex-start;
    text-align: right;
    padding-inline: 9px;
  }
}


/* ==========================================================================
   V25 - Responsive commerce/auth/activation polish
   ========================================================================== */
.text-gradient{
  background:none !important;
  -webkit-background-clip:initial !important;
  -webkit-text-fill-color:currentColor !important;
  color:var(--accent-text) !important;
}
input,select,textarea,button{max-width:100%}
.card,.form-control{min-width:0}
.ha-card-number-row{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;min-width:0}
.ha-card-number{font-size:clamp(.98rem,4.5vw,1.25rem);font-weight:850;color:var(--accent-text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;direction:ltr;unicode-bidi:isolate;overflow-wrap:anywhere;word-break:break-word;max-width:100%;text-align:center}
.ha-auth-section{padding:54px 0;min-height:calc(100vh - 240px);display:flex;align-items:center}
.ha-auth-shell{max-width:520px;margin:0 auto;padding:32px;width:100%}
.ha-auth-shell h1{font-size:clamp(1.35rem,4vw,1.7rem);margin-bottom:8px}
.ha-auth-lead{color:var(--text-secondary);font-size:.9rem;margin-bottom:22px}
.ha-auth-shell .form-label{display:block;margin:14px 0 6px;font-weight:700;font-size:.85rem;color:var(--text-secondary)}
.ha-btn-block{width:100%;margin-top:18px;padding:12px 16px}
.ha-auth-alt-actions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:14px}
.ha-auth-links{text-align:center;border-top:1px solid var(--border);margin-top:20px;padding-top:16px;font-size:.86rem}
.ha-auth-phone{padding:10px 12px;border:1px solid var(--border);background:var(--bg-elevated);border-radius:var(--radius-md);text-align:center;font-family:ui-monospace,monospace;margin-bottom:12px}
.ha-form-alert{padding:12px 14px;border-radius:var(--radius-md);margin:12px 0;font-size:.88rem}
.ha-form-alert.error{background:rgba(239,68,68,.08);border:1px solid rgba(239,68,68,.25);color:#f87171}
.ha-form-alert.success{background:rgba(34,197,94,.08);border:1px solid rgba(34,197,94,.25);color:#4ade80}
.gemini-order-guide-banner{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:16px;margin:0 0 24px;border:1px solid var(--border);background:var(--bg-elevated);border-radius:var(--radius-md)}
.gemini-order-guide-banner div{min-width:0;flex:1}
.gemini-order-guide-banner strong{display:block;margin-bottom:4px}
.gemini-order-guide-banner span{display:block;color:var(--text-secondary);font-size:.84rem;line-height:1.8}
.gemini-activation-page{padding:42px 0 80px}
.activation-shell{max-width:900px;margin:0 auto}
.activation-hero{border:1px solid var(--border);background:var(--bg-surface);padding:28px;border-radius:var(--radius-xl);margin-bottom:18px}
.activation-hero h1{font-size:clamp(1.6rem,5vw,2.35rem);margin:12px 0 8px}
.activation-hero p{color:var(--text-secondary);line-height:2;max-width:760px}
.activation-status{padding:12px 16px;border-radius:var(--radius-md);margin-bottom:18px;font-weight:700}
.activation-status.ready{background:rgba(34,197,94,.08);border:1px solid rgba(34,197,94,.25);color:#4ade80}
.activation-status.waiting{background:rgba(234,179,8,.08);border:1px solid rgba(234,179,8,.25);color:#facc15}
.activation-steps{counter-reset:step;display:grid;gap:14px;list-style:none}
.activation-steps li{position:relative;background:var(--bg-surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px 22px}
.activation-steps li::before{counter-increment:step;content:counter(step);position:absolute;top:18px;right:18px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--accent-muted);color:var(--accent-text);font-weight:800}
.activation-steps strong{display:block;padding-right:42px;margin-bottom:6px}
.activation-steps p{color:var(--text-secondary);line-height:1.95;margin:0 0 12px}
.activation-warning,.activation-checklist{margin-top:18px;padding:20px 22px;border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--bg-surface)}
.activation-warning{border-color:rgba(245,158,11,.28);background:rgba(245,158,11,.06)}
.activation-warning strong{color:#fbbf24}
.activation-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.activation-wait-note{padding:16px;margin-top:18px;border:1px dashed var(--border);border-radius:var(--radius-md);color:var(--text-secondary)}
.activation-checklist ul{list-style:disc;padding-right:22px;color:var(--text-secondary);line-height:2}
.section .card{overflow-wrap:anywhere}
@media(max-width:700px){
  .container{padding-inline:14px}
  .card{border-radius:12px}
  .ha-auth-section{padding:24px 0 50px}
  .ha-auth-shell{padding:22px 16px}
  .ha-card-number-row{align-items:stretch}
  .ha-card-number-row .btn{width:100%}
  .ha-card-number{width:100%;font-size:1.05rem;letter-spacing:.05em;padding:2px 0}
  .gemini-activation-page{padding:24px 0 60px}
  .activation-hero{padding:20px 16px}
  .activation-steps li{padding:18px 16px}
  .activation-steps li::before{right:14px}
  .gemini-order-guide-banner .btn,.activation-actions .btn{width:100%}
}


/* ==========================================================================
   V25.1 — Commerce responsiveness + restrained visual system
   ========================================================================== */
.ha-order-fulfillment-banner{
  display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;
  margin:0 0 22px;padding:14px 16px;border:1px solid var(--border);border-radius:14px;
  background:color-mix(in srgb,var(--bg-surface) 94%,#fff 6%);
}
.ha-order-fulfillment-banner div{min-width:0}.ha-order-fulfillment-banner span{display:block;color:var(--text-secondary);font-size:.76rem;margin-bottom:4px}
.ha-order-fulfillment-banner strong{display:block;font-size:.95rem;color:var(--text-primary)}
.ha-order-fulfillment-banner.processing{border-color:rgba(96,165,250,.30)}
.ha-order-fulfillment-banner.ready,.ha-order-fulfillment-banner.completed{border-color:rgba(52,211,153,.30)}
.ha-order-fulfillment-banner.cancelled{border-color:rgba(248,113,113,.30)}
.ha-order-fulfillment-link{font-size:.78rem;font-weight:800;color:var(--accent-text);white-space:nowrap}
/* Tone down synthetic multi-color decoration while keeping the brand accent. */
.hero-badge,.section-badge,.category-badge,.article-v23-category{background:rgba(59,130,246,.10)!important;border-color:rgba(96,165,250,.22)!important;color:#93c5fd!important}
.btn-primary{background:var(--accent)!important;background-image:none!important;box-shadow:none!important}
@media(max-width:700px){
  .ha-order-fulfillment-banner{align-items:stretch;padding:13px 14px}.ha-order-fulfillment-link{width:100%;white-space:normal}
  .checkout-container,.payment-card,.order-card{min-width:0;max-width:100%}
  .ha-card-number-row{overflow:hidden}.ha-card-number{overflow-wrap:anywhere;word-break:break-word}
}

.activation-status .activation-countdown{display:block;margin-top:6px;font-weight:600;font-size:.76rem;color:inherit;opacity:.82}
.activation-preflight{margin-top:18px;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-elevated)}
.activation-preflight label{display:flex;align-items:flex-start;gap:9px;font-weight:750;line-height:1.9;cursor:pointer}
.activation-preflight input{margin-top:7px;accent-color:#22c55e;flex:0 0 auto}
.activation-preflight small{display:block;color:var(--text-secondary);font-size:.76rem;line-height:1.8;margin-top:6px;padding-right:25px}
.activation-actions.is-locked{opacity:.48;filter:saturate(.3)}
.activation-actions.is-locked a,.activation-actions.is-locked button{cursor:not-allowed}
@media(max-width:700px){.activation-preflight{padding:13px}.activation-preflight small{padding-right:0}}

/* ========================================================================== 
   V26 — Site-wide responsive hardening
   Prevent horizontal overflow and make content/forms/cards readable on small
   phones without clipping desktop layouts.
   ========================================================================== */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}
body { min-width: 0; }
main,
section,
article,
aside,
.site-header,
.site-footer,
.container,
.card,
[class*="-grid"],
[class*="-layout"],
[class*="-shell"],
[class*="-content"] { min-width: 0; }

.container {
  width: min(100%, 1200px);
  max-width: 1200px;
}

/* Long identifiers, URLs, emails and mixed Persian/Latin strings must never
   force the viewport wider than the device. */
.card p,
.card a,
.card span,
.card strong,
.card small,
.form-control,
.admin-link-safe,
.content-detail-page,
.dashboard-content {
  overflow-wrap: anywhere;
  word-break: normal;
}

iframe,
video,
picture,
canvas,
svg,
img {
  max-width: 100%;
}
iframe,
video { border: 0; }

.form-group,
.form-grid-2,
.contact-grid,
.cart-layout,
.product-detail-grid,
.detail-shell,
.dashboard-grid,
.dashboard-content,
.dashboard-card-body,
.dashboard-card-header {
  min-width: 0;
}
.form-control,
.input-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="file"],
select,
textarea {
  min-width: 0;
  width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; min-width: 0; }
textarea { max-width: 100%; }

/* Tables stay usable on mobile instead of stretching the whole document. */
.table-responsive,
.admin-table-wrap,
.article-table-wrap,
.block-table,
.invoice-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

/* Contact page — the previous inline desktop spacings created an oversized
   vertical gap and cramped cards on phones. */
.page-contact .contact-grid > * { min-width: 0; }
.page-contact .contact-grid .card { overflow: hidden; }
.page-contact .contact-grid .btn { max-width: 100%; }
.page-contact .contact-grid .btn span { min-width: 0; overflow-wrap: anywhere; }

/* Checkout/order/card-number surfaces: contain mixed LTR data safely. */
.ha-card-number,
.ha-auth-phone,
.invoice-meta-row strong,
.invoice-meta-row span,
.party-col,
.order-code,
[dir="ltr"] {
  max-width: 100%;
}

@media (max-width: 820px) {
  .container { padding-inline: 16px; }
  .section { min-width: 0; }
  .section-header { min-width: 0; }
  .section-header > * { min-width: 0; }

  .page-contact .hero[style] {
    padding: 30px 0 18px !important;
  }
  .page-contact .hero .hero-content[style] {
    max-width: 100% !important;
  }
  .page-contact .section[style] {
    padding: 14px 0 48px !important;
  }
  .page-contact .contact-grid {
    gap: 14px;
  }
  .page-contact .contact-grid > div[style] {
    gap: 12px !important;
  }
  .page-contact .contact-grid .card {
    padding: 18px 16px !important;
    border-radius: 14px !important;
  }
  .page-contact .contact-grid .card > div:first-child {
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .page-contact .contact-grid .card h3 {
    line-height: 1.65 !important;
  }
  .page-contact .contact-grid .card p {
    font-size: .88rem !important;
    line-height: 1.95 !important;
  }
  .page-contact .contact-grid .btn {
    width: 100% !important;
    min-height: 48px;
    padding: 10px 12px !important;
    white-space: normal;
    line-height: 1.75;
    text-align: center;
  }

  /* Common public pages */
  .cart-item-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 12px;
    align-items: center;
  }
  .cart-item-info { grid-column: 1 / -1; width: 100%; }
  .cart-item-title { white-space: normal; overflow: visible; text-overflow: clip; }
  .cart-summary-card { position: static !important; top: auto !important; }

  .invoice-wrapper,
  .invoice-card { max-width: 100%; min-width: 0; }
  .invoice-card { padding-inline: 16px !important; }
  .invoice-header,
  .invoice-parties { gap: 14px !important; }
  .invoice-parties { grid-template-columns: 1fr !important; }
  .invoice-table { min-width: 620px; }

  .content-detail-page .detail-page-container,
  .product-detail-page .detail-page-container,
  .video-detail-page .detail-page-container {
    max-width: 100%;
    min-width: 0;
  }
  .product-purchase-card,
  .detail-content-card,
  .detail-comments-card { overflow: hidden; }

  /* Buttons should not overflow because of long Persian labels. */
  .btn {
    max-width: 100%;
  }
  .card .btn,
  .dashboard-content .btn {
    white-space: normal;
    line-height: 1.65;
  }
}

@media (max-width: 640px) {
  .container { padding-inline: 12px; }
  .card { max-width: 100%; }

  .hero:not(.article-v23-hero) {
    min-height: 0;
  }
  .page-contact .hero h1[style] {
    font-size: clamp(1.55rem, 7vw, 1.95rem) !important;
    line-height: 1.55 !important;
  }
  .page-contact .hero p[style] {
    font-size: .92rem !important;
    line-height: 1.95 !important;
    margin-bottom: 0 !important;
  }
  .page-contact .hero-label { margin-bottom: 12px; }

  .form-grid-2 { grid-template-columns: 1fr !important; }
  .form-group { min-width: 0; }
  .form-control,
  .input-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important; /* Prevent iOS zoom while keeping Android stable. */
  }

  .modal-card {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 10px auto !important;
    padding: 18px 14px !important;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .ha-order-fulfillment-banner,
  .gemini-order-guide-banner,
  .activation-actions {
    align-items: stretch;
  }

  .ha-card-number {
    font-size: clamp(.92rem, 4.2vw, 1.05rem);
    letter-spacing: .035em;
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .container { padding-inline: 10px; }
  .page-contact .contact-grid .card { padding: 16px 14px !important; }
  .page-contact .contact-grid .card > div:first-child > div:first-child {
    width: 42px !important;
    height: 42px !important;
  }
  .btn { padding-inline: 14px; }
  .cart-item-row { padding: 14px; }
}


/* ========================================================================== 
   v27 - Mobile product cards: edge-to-edge artwork + simpler responsive UI
   ========================================================================== */
.product-card,
.shop-product-card {
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  background: var(--bg-surface) !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: border-color .14s ease, background-color .14s ease !important;
}
.product-card:hover,
.shop-product-card:hover {
  transform: none !important;
  border-color: var(--border-hover) !important;
}
.product-card.has-special-discount,
.product-card.has-special-discount:hover,
[data-theme="light"] .product-card.has-special-discount {
  border-color: var(--border) !important;
  background: var(--bg-surface) !important;
  background-image: none !important;
}
/* v27-special-card-flat */
.product-card .product-thumb,
.shop-product-card .product-thumb {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  line-height: 0 !important;
}
.product-card .product-thumb img,
.shop-product-card .product-thumb img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}
.product-card .product-body,
.shop-product-card .product-body {
  padding: 15px 16px 10px !important;
}
.product-card .product-body h3,
.shop-product-card .product-body h3 {
  margin-bottom: 6px !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
}
.product-card .product-desc,
.shop-product-card .product-desc {
  min-height: 0 !important;
  margin-bottom: 10px !important;
  color: var(--text-secondary) !important;
  font-size: .84rem !important;
  line-height: 1.8 !important;
}
.product-card .product-features,
.shop-product-card .product-features {
  margin: 0 !important;
}
.product-card .product-features li,
.shop-product-card .product-features li {
  margin-bottom: 4px !important;
  color: var(--text-secondary) !important;
  line-height: 1.7 !important;
}
.product-card .product-footer,
.shop-product-card .product-footer {
  padding: 11px 16px 14px !important;
  border-top: 1px solid var(--border) !important;
  background: transparent !important;
}
.product-card .product-footer .btn,
.shop-product-card .product-footer .btn {
  min-height: 40px !important;
  padding: 8px 14px !important;
  border-radius: 9px !important;
  font-size: .82rem !important;
}
.product-card .product-badges-row,
.shop-product-card .product-badges-row {
  gap: 7px !important;
  margin-bottom: 8px !important;
}
.product-card .badge,
.shop-product-card .badge,
.product-card .discount-tag.discount-tag-glass,
.shop-product-card .discount-tag.discount-tag-glass {
  min-height: 28px;
  padding: 4px 9px !important;
  border-radius: 8px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media (max-width: 768px) {
  .products-grid,
  .shop-products-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  .shop-products-grid {
    width: 100% !important;
    max-width: 540px !important;
    margin-inline: auto !important;
  }
  .product-card,
  .shop-product-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    border-radius: 15px !important;
  }
  .product-card .product-thumb,
  .shop-product-card .product-thumb {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
  }
  .product-card .product-body,
  .shop-product-card .product-body {
    padding: 14px 14px 9px !important;
  }
  .product-card .product-footer,
  .shop-product-card .product-footer {
    padding: 10px 14px 13px !important;
    gap: 10px !important;
  }
  .product-card .product-title,
  .article-card .article-title,
  .product-card .product-price {
    font-size: 1rem !important;
  }
}

@media (max-width: 640px) {
  .container { padding-inline: 16px !important; }
  .section { padding-block: 42px; }
  .section-header { margin-bottom: 20px; }
  .section-title h2 { font-size: 1.24rem; line-height: 1.65; }
  .section-title p { font-size: .88rem; line-height: 1.8; }
  .product-card .product-body h3,
  .shop-product-card .product-body h3 {
    font-size: 1rem !important;
  }
}

@media (max-width: 430px) {
  .container { padding-inline: 14px !important; }
  .product-card,
  .shop-product-card { border-radius: 14px !important; }
  .product-card .product-body,
  .shop-product-card .product-body { padding-inline: 13px !important; }
  .product-card .product-footer,
  .shop-product-card .product-footer { padding-inline: 13px !important; }
}


/* ==========================================================================\n   v28 — Cart + checkout: compact, minimal, responsive commerce surfaces\n   ========================================================================== */
.commerce-page { padding: 30px 0 64px !important; }
.commerce-page > .container { width: min(100%, 1180px); max-width: 1180px; }
.commerce-page-head { margin-bottom: 18px !important; }
.commerce-page-head h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.cart-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.cart-table-card,
.cart-summary-card {
  border-radius: 14px;
  background: var(--bg-surface) !important;
  background-image: none !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.cart-list-head { padding: 13px 16px; background: transparent; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .8rem; color: var(--text-secondary); display:flex;justify-content:space-between;gap:12px; }
.cart-item-row { padding: 14px 16px; gap: 14px; transition: background-color .12s ease; }
.cart-item-row:hover { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.cart-item-img { width: 64px; height: 64px; border-radius: 10px; }
.cart-item-title { font-size: .9rem; line-height: 1.75; }
.cart-item-plan { font-size: .74rem; line-height: 1.7; }
.cart-item-actions { display:flex;align-items:center;gap:12px;flex:0 0 auto; }
.cart-qty-control { border-radius: 9px; padding: 3px 5px; }
.cart-qty-btn { border-radius: 7px; }
.cart-item-price { min-width: 105px; }
.cart-item-total { font-size: .92rem; white-space: nowrap; }
.cart-delete-btn { border: 1px solid transparent; }
.cart-summary-card { padding: 18px; top: 88px; }
.cart-summary-title { font-size: 1rem; margin-bottom: 12px; }
.cart-summary-row { padding: 9px 0; font-size: .82rem; }
.cart-summary-row.total-row { font-size: .93rem; }
.cart-summary-row.total-row .total-val { font-size: 1.06rem; }
.cart-summary-actions { margin-top: 18px; }
.cart-auth-notice { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; margin-bottom: 16px; display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px; }
.cart-auth-notice > div:first-child { min-width:0; }
.cart-auth-notice .btn { box-shadow:none!important; }
.coupon-box { margin: 14px 0; }
.coupon-input-group { gap: 6px; }

.checkout-shell { width: min(100%, 760px); margin: 0 auto; }
.checkout-card,
.checkout-auth-card {
  padding: 24px !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  background: var(--bg-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.checkout-auth-card { padding: 34px 26px !important; text-align:center; }
.checkout-card-head { display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid var(--border); }
.checkout-card-head-main { display:flex;align-items:center;gap:12px;min-width:0; }
.checkout-card-head-main > div:first-child { width:42px!important;height:42px!important;border-radius:10px!important; }
.checkout-card-head-main h1 { font-size: 1.12rem !important; line-height:1.7; }
.checkout-card-head-main p { font-size:.78rem!important; }
.checkout-total-head { flex:0 0 auto;text-align:left; }
.checkout-total-head span:last-child { font-size:1.08rem!important; }
.checkout-items { background:transparent;border:1px solid var(--border);border-radius:11px;padding:11px 14px;margin-bottom:20px; }
.checkout-item-row { display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:8px 0;border-bottom:1px solid var(--border);font-size:.84rem; }
.checkout-item-row:last-child { border-bottom:0; }
.checkout-item-row > span { min-width:0;line-height:1.8; }
.checkout-item-row > strong { flex:0 0 auto;white-space:nowrap; }
.checkout-step { margin-bottom: 22px; }
.checkout-step-title { font-size:.9rem;font-weight:750;margin:0 0 12px;display:flex;align-items:center;gap:8px;color:var(--text-primary); }
.checkout-step-title > span { width:22px!important;height:22px!important;border-radius:7px!important;background:transparent!important;border:1px solid var(--border)!important;color:var(--accent-text)!important; }
.checkout-payment-options { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px; }
.checkout-payment-option { display:flex;align-items:flex-start;gap:10px;min-width:0;padding:13px;background:transparent;border:1px solid var(--border);border-radius:11px;cursor:pointer;transition:border-color .12s ease,background-color .12s ease; }
.checkout-payment-option:hover { border-color:var(--border-hover); }
.checkout-payment-option.is-selected { border-color:color-mix(in srgb,var(--accent) 58%,var(--border));background:var(--accent-muted); }
.checkout-payment-option input[type="radio"] { width:18px!important;height:18px!important;margin-top:3px!important;flex:0 0 auto; }
.checkout-payment-copy { flex:1;min-width:0; }
.checkout-payment-line { display:flex;align-items:flex-start;justify-content:space-between;gap:8px;flex-wrap:wrap; }
.checkout-payment-line strong { font-size:.88rem!important;line-height:1.75; }
.checkout-payment-copy p { font-size:.75rem!important;line-height:1.8!important; }
.checkout-payment-line .badge { flex:0 0 auto;max-width:100%;white-space:normal;text-align:center; }
.checkout-bank-transfer { min-width:0; }
.checkout-bank-card,
.checkout-receipt-upload,
.checkout-credentials-box { background:transparent;border:1px solid var(--border);padding:15px;border-radius:11px;margin-bottom:12px; }
.checkout-bank-card .ha-card-number-row { gap:8px; }
.checkout-transfer-amount { margin:12px 0;padding:13px;border-radius:10px;background:var(--accent-muted);border:1px solid color-mix(in srgb,var(--accent) 38%,var(--border)); }
.checkout-transfer-amount-head { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.checkout-transfer-amount-label { display:block;font-size:.73rem;color:var(--text-secondary);margin-bottom:3px; }
.checkout-transfer-amount-toman { display:block;font-size:1rem;color:var(--accent-text);font-weight:850; }
.checkout-copy-amount { flex:0 0 auto;min-height:34px;white-space:nowrap; }
.checkout-transfer-rial-row { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid color-mix(in srgb,var(--accent) 24%,var(--border));font-size:.77rem;color:var(--text-secondary); }
.checkout-transfer-rial-row strong { color:var(--text-primary);direction:ltr;unicode-bidi:isolate;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.03em; }
.checkout-transfer-fee-note { margin:8px 0 0;font-size:.72rem;line-height:1.85;color:var(--text-tertiary); }
.checkout-receipt-upload input[type="file"] { width:100%;max-width:100%;padding:9px; }
.checkout-file-help { display:block;margin-top:7px;font-size:.73rem;color:var(--text-tertiary);line-height:1.85; }
.checkout-file-state { display:block;min-height:18px;margin-top:5px;font-size:.72rem;color:var(--success);direction:ltr;text-align:right;overflow-wrap:anywhere; }
.checkout-file-state.is-error { color:var(--danger); }
.checkout-credentials-box { margin-bottom:22px; }
.checkout-form .btn[type="submit"] { min-height:48px;border-radius:10px;font-size:.95rem!important;padding:11px 14px!important; }

@media(max-width:900px){
  .cart-layout{grid-template-columns:minmax(0,1fr)}
  .cart-summary-card{position:static;top:auto}
}
@media(max-width:700px){
  .commerce-page{padding:18px 0 42px!important}
  .commerce-page>.container{padding-inline:10px}
  .commerce-page-head{align-items:flex-start!important;gap:10px!important}
  .cart-auth-notice{align-items:stretch}
  .cart-auth-notice>div:last-child{width:100%;display:grid!important;grid-template-columns:1fr 1fr}
  .cart-auth-notice .btn{width:100%;justify-content:center}
  .cart-list-head span:last-child{display:none}
  .cart-item-row{display:block;padding:13px}
  .cart-item-info{align-items:flex-start}
  .cart-item-img{width:72px;height:72px}
  .cart-item-title{white-space:normal;overflow:visible;text-overflow:clip}
  .cart-item-actions{width:100%;margin-top:12px;padding-top:11px;border-top:1px solid var(--border);display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:9px}
  .cart-item-price{min-width:0;text-align:center}
  .cart-item-total{white-space:normal;font-size:.86rem}
  .cart-summary-card{padding:15px}
  .checkout-card,.checkout-auth-card{padding:15px!important;border-radius:12px!important}
  .checkout-card-head{align-items:flex-start;flex-direction:column;gap:11px}
  .checkout-card-head-main{width:100%}
  .checkout-total-head{width:100%;display:flex;justify-content:space-between;align-items:center;text-align:right;padding-top:10px;border-top:1px solid var(--border)}
  .checkout-items{padding:10px 12px}
  .checkout-item-row{font-size:.8rem;gap:10px}
  .checkout-payment-options{grid-template-columns:minmax(0,1fr)}
  .checkout-payment-option{padding:12px}
  .checkout-bank-card,.checkout-receipt-upload,.checkout-credentials-box{padding:13px}
  .checkout-bank-card>div{gap:10px;flex-wrap:wrap}
  .checkout-transfer-amount-head{align-items:stretch;flex-direction:column}
  .checkout-copy-amount{width:100%;justify-content:center}
  .checkout-transfer-rial-row{align-items:flex-start;flex-direction:column}
}
@media(max-width:430px){
  .cart-auth-notice>div:last-child{grid-template-columns:1fr}
  .cart-item-actions{grid-template-columns:auto minmax(0,1fr) 36px}
  .coupon-input-group{display:grid;grid-template-columns:minmax(0,1fr) auto}
  .checkout-item-row{display:grid;grid-template-columns:minmax(0,1fr);gap:3px}
  .checkout-item-row>strong{text-align:left}
  .checkout-payment-line{display:block}
  .checkout-payment-line .badge{display:inline-flex;margin-top:6px}
}
@media(prefers-reduced-motion:reduce){.checkout-payment-option,.cart-item-row{transition:none!important}}

/* ========================================================================== 
   v28.1 - Purchase flow + order status refinements
   Keep commerce surfaces flat, line-based and predictable on touch devices.
   ========================================================================== */
.purchase-modal-backdrop {
  padding: clamp(10px, 3vw, 22px) !important;
  background: rgba(3, 7, 14, .78) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: opacity .14s ease, visibility .14s ease !important;
}
.purchase-modal-card {
  width: min(600px, 100%) !important;
  max-height: min(720px, calc(100dvh - 24px));
  overflow: auto;
  padding: 20px !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28) !important;
  transform: none !important;
  transition: none !important;
}
.purchase-modal-backdrop.open .purchase-modal-card { transform: none !important; }
.purchase-modal-header {
  gap: 12px !important;
  padding-bottom: 14px !important;
  margin-bottom: 14px !important;
  border-color: var(--border) !important;
}
.purchase-modal-close {
  width: 34px !important;
  height: 34px !important;
  flex-basis: 34px !important;
  border-radius: 9px !important;
  border-color: var(--border) !important;
  background: transparent !important;
  transition: border-color .12s ease, background .12s ease !important;
}
.purchase-modal-close:hover {
  background: var(--bg-elevated) !important;
  transform: none !important;
}
.purchase-choice-grid { gap: 9px !important; }
.purchase-choice {
  grid-template-columns: 42px minmax(0, 1fr) 18px !important;
  gap: 11px !important;
  padding: 13px 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 11px !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: border-color .12s ease, background .12s ease !important;
}
.purchase-choice:hover,
.purchase-choice:focus-visible {
  transform: none !important;
  background: var(--bg-elevated) !important;
  border-color: var(--accent) !important;
}
.purchase-choice-icon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
}
.product-sticky-bar {
  background: color-mix(in srgb, var(--bg-surface) 96%, transparent) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform .16s ease, opacity .14s ease !important;
}

.page-order-status .order-status-shell { width: min(100%, 720px) !important; }
.page-order-status .order-status-shell > div {
  max-width: 100%;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
.page-order-status input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.page-order-status form { min-width: 0; }
.page-order-status .telegram_channel_banner {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
}

@media (max-width: 700px) {
  .purchase-modal-card { padding: 15px !important; border-radius: 12px !important; }
  .purchase-modal-header h3 { font-size: 1rem !important; }
  .purchase-choice {
    grid-template-columns: 38px minmax(0, 1fr) 16px !important;
    padding: 12px !important;
  }
  .purchase-choice-icon { width: 38px !important; height: 38px !important; }
  .purchase-choice-copy strong { font-size: .86rem !important; }
  .purchase-choice-copy small { font-size: .7rem !important; line-height: 1.7 !important; }
  .page-order-status .section,
  .page-order-status .order-status-page { padding-top: 18px !important; padding-bottom: 48px !important; }
  .page-order-status .order-status-shell { padding-inline: 0 !important; }
  .page-order-status .order-status-shell > div { border-radius: 12px !important; }
  .page-order-status form > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .page-order-status form .btn { width: 100% !important; justify-content: center !important; }
}
@media (prefers-reduced-motion: reduce) {
  .purchase-modal-backdrop,
  .purchase-modal-card,
  .purchase-choice,
  .product-sticky-bar { transition: none !important; animation: none !important; }
}

/* v31 — consistent translucent modals on public/shop surfaces */
.modal-backdrop,
.purchase-modal-backdrop { background: rgba(2,6,16,.30) !important; backdrop-filter: blur(7px) !important; -webkit-backdrop-filter: blur(7px) !important; }
.modal-card,
.purchase-modal-card {
  background: color-mix(in srgb, var(--bg-surface) 76%, transparent) !important;
  border-color: color-mix(in srgb, var(--border) 86%, rgba(255,255,255,.16)) !important;
  backdrop-filter: blur(20px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(145%) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.18) !important;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-card,.purchase-modal-card { background: var(--bg-surface) !important; }
}

/* v32 — transparent public/shop modal material */
.modal-backdrop,
.purchase-modal-backdrop {
  background: rgba(2,6,16,.12) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}
.modal-card,
.purchase-modal-card {
  background: color-mix(in srgb, var(--bg-surface) 18%, transparent) !important;
  border-color: color-mix(in srgb, var(--border) 82%, rgba(255,255,255,.22)) !important;
  backdrop-filter: blur(28px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(125%) !important;
  box-shadow: 0 18px 56px rgba(0,0,0,.16) !important;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-card,.purchase-modal-card { background: color-mix(in srgb,var(--bg-surface) 88%,transparent) !important; }
}


/* v33 — public/shop modal shells use no glass fill. */
.modal-backdrop,
.purchase-modal-backdrop { background: rgba(2,6,16,.66) !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
.modal-card,
.purchase-modal-card { background: transparent !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; box-shadow:none !important; }

/* ==========================================================================
   v34 - Opaque modal surfaces: no glass, no page bleed-through
   ========================================================================== */
:root {
  --ha-modal-solid: #0f141d;
  --ha-modal-solid-elevated: #141b26;
  --ha-modal-solid-control: #171f2b;
}
[data-theme="light"] {
  --ha-modal-solid: #ffffff;
  --ha-modal-solid-elevated: #f6f8fb;
  --ha-modal-solid-control: #ffffff;
}
.modal-backdrop,
.purchase-modal-backdrop {
  background: rgba(2, 6, 16, .78) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.modal-card,
.purchase-modal-card {
  background: var(--ha-modal-solid) !important;
  background-color: var(--ha-modal-solid) !important;
  background-image: none !important;
  opacity: 1 !important;
  border-color: var(--border) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .34) !important;
  isolation: isolate;
}
.modal-card .modal-header,
.purchase-modal-card .purchase-modal-header {
  background: var(--ha-modal-solid) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.modal-card input,
.modal-card select,
.modal-card textarea,
.purchase-modal-card input,
.purchase-modal-card select,
.purchase-modal-card textarea {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ========================================================================== 
   v35 - Mobile-first hardening, compact custom scrollbars, 3-column home video grid
   ========================================================================== */
:root {
  --ha-scroll-thumb: #465064;
  --ha-scroll-thumb-hover: #64748b;
  --ha-scroll-track: transparent;
}
[data-theme="light"] {
  --ha-scroll-thumb: #a8b1c1;
  --ha-scroll-thumb-hover: #7c8799;
  --ha-scroll-track: transparent;
}

/* Consistent, quiet scrollbars across public pages and dialogs. Keep them visible
   for keyboard/mouse accessibility, but remove the bulky native arrow buttons. */
html,
body,
.modal-card,
.purchase-modal-card,
.ha-user-dialog,
.ha-user-dialog-body,
.table-responsive,
.cart-items,
.article-v22-rail,
pre,
textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--ha-scroll-thumb) var(--ha-scroll-track);
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: var(--ha-scroll-track);
}
*::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--ha-scroll-thumb);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ha-scroll-thumb-hover);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* A few scroll containers deserve an even slimmer treatment. */
.modal-card,
.purchase-modal-card,
.ha-user-dialog-body,
.table-responsive,
.article-v22-rail {
  scrollbar-gutter: stable;
}
.modal-card::-webkit-scrollbar,
.purchase-modal-card::-webkit-scrollbar,
.ha-user-dialog-body::-webkit-scrollbar,
.article-v22-rail::-webkit-scrollbar { width: 7px; height: 7px; }

/* Desktop homepage: three equal video cards per row. Six records are requested
   by index.php so the first two rows stay visually balanced. */
.home-videos-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
}
.home-videos-grid .video-card-body { padding: 18px 18px 16px; gap: 14px; }
.home-videos-grid .video-card-title { font-size: .96rem; line-height: 1.72; }
.home-videos-grid .video-card-description { font-size: .82rem; line-height: 1.86; -webkit-line-clamp: 2; }
.home-videos-grid .video-play-btn { width: 48px; height: 48px; }

/* Global overflow safety. Flex/grid children with long Persian/Latin mixtures,
   URLs and order codes may shrink instead of forcing horizontal page scroll. */
body,
main,
section,
.container,
.card,
.modal-card,
.purchase-modal-card,
.product-detail-grid,
.detail-shell,
.cart-layout,
.checkout-shell,
.contact-grid,
.courses-grid,
.shop-products-grid,
.products-grid,
.articles-grid,
.videos-grid,
.tools-grid,
.features-grid { min-width: 0; max-width: 100%; }

:where(.container, .card, .product-detail-grid, .detail-shell, .cart-layout, .checkout-shell, .contact-grid, .courses-grid, .shop-products-grid, .products-grid, .articles-grid, .videos-grid, .tools-grid, .features-grid) > * {
  min-width: 0;
}

:where(h1,h2,h3,h4,h5,h6,p,li,dd,dt,figcaption,.product-desc,.video-card-title,.video-card-description,.article-summary,.detail-breadcrumb) {
  overflow-wrap: anywhere;
}

:where(img, video, iframe, embed, object, canvas, svg) { max-width: 100%; }
:where(pre, code) { max-width: 100%; }
pre { overflow: auto; -webkit-overflow-scrolling: touch; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  max-width: 100%;
  min-width: 0;
}

/* Tablets keep a useful two-column density where cards are designed for it. */
@media (max-width: 1080px) {
  .home-videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Mobile is the primary layout: single-column content, no clipped controls,
   compact spacing and touch-safe form sizing. */
@media (max-width: 768px) {
  html { overflow-x: hidden; overflow-x: clip; }
  body { width: 100%; overflow-x: hidden; overflow-x: clip; }
  .container { padding-inline: 14px !important; }
  .section { padding-block: 34px; }

  .hero,
  .shop-hero,
  .tools-hero,
  .courses-hero,
  .user-profile-hero,
  .commerce-page-head { max-width: 100%; overflow-x: clip !important; }

  .section-header {
    width: 100%;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .section-title,
  .section-title > * { min-width: 0; }
  .section-link {
    width: fit-content;
    max-width: 100%;
    min-height: 42px;
    align-items: center;
  }

  .products-grid,
  .articles-grid,
  .videos-grid,
  .home-videos-grid,
  .tools-grid,
  .features-grid,
  .courses-grid,
  .shop-products-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .product-detail-grid,
  .contact-grid,
  .cart-layout,
  .article-v22-reading-layout,
  .detail-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .home-videos-grid .video-card-body,
  .video-card-body { padding: 15px 14px 14px; gap: 12px; }
  .home-videos-grid .video-card-title,
  .video-card-title { font-size: .96rem; line-height: 1.72; }
  .video-card-description { font-size: .8rem; line-height: 1.85; -webkit-line-clamp: 2; }
  .video-card-footer { gap: 8px; padding-top: 11px; flex-wrap: wrap; }
  .video-card-cta,
  .video-card-views { font-size: .74rem; }
  .video-play-btn { width: 46px; height: 46px; }

  .card,
  .product-card,
  .article-card,
  .video-card-link,
  .tool-card,
  .course-card,
  .checkout-card,
  .cart-summary-card { width: 100%; max-width: 100%; }

  /* Prevent iOS from zooming text fields and keep controls inside the viewport. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea { font-size: 16px !important; }

  .btn,
  button,
  [role="button"] { max-width: 100%; }
  .btn { white-space: normal; text-align: center; }

  .form-grid-2,
  .form-row,
  .checkout-form,
  .contact-grid { grid-template-columns: minmax(0,1fr) !important; }

  .table-responsive,
  .admin-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-card,
  .purchase-modal-card {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    margin: auto !important;
    border-radius: 12px !important;
  }

  *::-webkit-scrollbar { width: 6px; height: 6px; }
  *::-webkit-scrollbar-thumb { border-width: 1px; }
}

@media (max-width: 430px) {
  .container { padding-inline: 12px !important; }
  .section { padding-block: 28px; }
  .hero h1 { font-size: clamp(1.55rem, 8.5vw, 1.9rem); }
  .hero p { font-size: .94rem; line-height: 1.9; }
  .section-title h2 { font-size: 1.22rem; line-height: 1.65; }
  .section-title p { font-size: .82rem; line-height: 1.8; }
  .video-card-body .video-meta { align-items: flex-start; }
  .video-card-footer { align-items: flex-start; }
  .modal-card,
  .purchase-modal-card {
    width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    max-height: calc(100dvh - 10px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* v35 safe-area padding for edge-to-edge mobile browsers */
@media (max-width:768px){
  .container{
    padding-right:max(14px,env(safe-area-inset-right))!important;
    padding-left:max(14px,env(safe-area-inset-left))!important;
  }
}
@media (max-width:430px){
  .container{
    padding-right:max(12px,env(safe-area-inset-right))!important;
    padding-left:max(12px,env(safe-area-inset-left))!important;
  }
}


/* v36 — order lookup affordance + persistent-login controls */
.page-order-status .order-status-search-btn {
  min-height: 46px;
  padding-inline: 22px !important;
  font-weight: 800;
}
.page-order-status .order-status-search-btn svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  flex: 0 0 22px;
  stroke-width: 2.25;
}
.ha-remember-row {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  margin: 2px 0 18px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
}
.ha-remember-row input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.ha-remember-control {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: var(--bg-surface);
  transition: border-color .12s ease, background .12s ease;
}
.ha-remember-control::after {
  content: '';
  width: 9px;
  height: 5px;
  border-inline-start: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform .12s ease;
}
.ha-remember-row input:checked + .ha-remember-control {
  background: var(--accent);
  border-color: var(--accent);
}
.ha-remember-row input:checked + .ha-remember-control::after { transform: rotate(-45deg) scale(1); }
.ha-remember-row input:focus-visible + .ha-remember-control { outline: 2px solid var(--accent); outline-offset: 3px; }
.ha-remember-copy { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; }
.ha-remember-copy strong { color: var(--text-primary); font-size: .84rem; font-weight: 800; }
.ha-remember-copy small { color: var(--text-tertiary); font-size: .72rem; line-height: 1.6; }
@media (max-width: 560px) {
  .page-order-status .order-status-search-btn { min-height: 48px; padding-inline: 18px !important; }
  .page-order-status .order-status-search-btn svg { width: 23px !important; height: 23px !important; flex-basis: 23px; }
  .ha-remember-row { padding: 10px; margin-bottom: 16px; }
  .ha-remember-copy { display: block; }
  .ha-remember-copy small { display: block; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .ha-remember-control, .ha-remember-control::after { transition: none; }
}

/* Theme-aware glass for the floating purchase bar. The ID overrides legacy
   transparency rules without changing any other navigation surfaces. */
#productStickyBar {
  --purchase-glass-tint: rgba(19, 24, 34, .68);
  --purchase-glass-edge: rgba(255, 255, 255, .16);
  --purchase-glass-glow: rgba(255, 255, 255, .07);
  bottom: 0 !important;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  background: linear-gradient(180deg, var(--purchase-glass-glow), transparent), var(--purchase-glass-tint) !important;
  border: 0 !important;
  border-top: 1px solid var(--purchase-glass-edge) !important;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .12) !important;
  backdrop-filter: blur(22px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
}
[data-theme="light"] #productStickyBar {
  --purchase-glass-tint: rgba(255, 255, 255, .64);
  --purchase-glass-edge: rgba(45, 60, 85, .14);
  --purchase-glass-glow: rgba(255, 255, 255, .28);
  box-shadow: 0 -8px 28px rgba(30, 45, 65, .08) !important;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #productStickyBar { --purchase-glass-tint: rgba(19, 24, 34, .96); }
  [data-theme="light"] #productStickyBar { --purchase-glass-tint: rgba(255, 255, 255, .96); }
}
@media (max-width: 768px) {
  #productStickyBar { padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)) !important; }
}
.product-sticky-bar .sticky-bar-inner {
  width: min(calc(100% - 48px), 1180px) !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 24px !important;
}
.product-sticky-bar .sticky-bar-actions {
  display: grid !important;
  grid-template-columns: auto minmax(150px, 172px) !important;
  align-items: center !important;
  gap: 16px !important;
}
.product-sticky-bar .sticky-buy-trigger {
  width: 100% !important;
  min-height: 48px;
  justify-content: center;
}
body.product-sticky-visible .product-detail-page {
  padding-bottom: 92px;
}
@media (max-width: 1024px) {
  .product-sticky-bar .sticky-bar-inner {
    width: min(calc(100% - 32px), 960px) !important;
    gap: 16px !important;
  }
  .product-sticky-bar .sticky-bar-actions {
    grid-template-columns: auto minmax(142px, 160px) !important;
    gap: 12px !important;
  }
  .product-sticky-bar .sticky-title { max-width: 34vw !important; }
}
@media (max-width: 768px) {
  .product-detail-page .product-sticky-bar,
  .product-sticky-bar {
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)) !important;
  }
  .product-sticky-bar .sticky-bar-inner {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }
  .product-sticky-bar .sticky-bar-product { display: none !important; }
  .product-sticky-bar .sticky-bar-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(138px, 44vw) !important;
    gap: 10px !important;
  }
  .product-sticky-bar .sticky-price-box {
    min-width: 0;
    align-items: flex-start !important;
    justify-content: center;
  }
  .product-sticky-bar .sticky-price-values { min-width: 0; }
  .product-sticky-bar .sticky-price-current { font-size: 1.06rem !important; }
  .product-sticky-bar .sticky-buy-trigger {
    min-height: 48px;
    padding-inline: 12px !important;
    font-size: .82rem !important;
  }
  body.product-sticky-visible .product-detail-page { padding-bottom: 82px; }
}
@media (max-width: 390px) {
  .product-sticky-bar .sticky-bar-actions {
    grid-template-columns: minmax(0, 1fr) 136px !important;
    gap: 8px !important;
  }
  .product-sticky-bar .sticky-price-label,
  .product-sticky-bar .sticky-price-old { display: none !important; }
  .product-sticky-bar .sticky-price-current { font-size: .98rem !important; }
  .product-sticky-bar .sticky-buy-trigger {
    min-height: 46px;
    padding-inline: 10px !important;
    font-size: .78rem !important;
  }
}
