/* =========================================================
   uflyUFLY — Clean Style (Final + Video Guide)
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --primary: #7357ff;
  --primary-2: #2f8cff;
  --accent: #22d6a3;

  --bg: #070b14;
  --bg-soft: #0b1020;
  --surface: #101725;
  --surface-2: #141d2d;
  --surface-3: #192337;

  --text: #f5f7ff;
  --text-soft: #d4dbea;
  --muted: #8e9ab0;

  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .18);
  --shadow: 0 12px 34px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .38);

  --glow: rgba(115, 87, 255, .28);

  --container: 1180px;
  --header-h: 74px;
  --t: .22s ease;

  --font: "Segoe UI", Tahoma, Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #f5f8fd;
  --bg-soft: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #eef3fa;

  --text: #172033;
  --text-soft: #364258;
  --muted: #657188;

  --border: rgba(20, 35, 60, .10);
  --border-strong: rgba(20, 35, 60, .18);

  --shadow-sm: 0 4px 14px rgba(28, 45, 75, .06);
  --shadow: 0 12px 34px rgba(28, 45, 75, .09);
  --shadow-lg: 0 24px 60px rgba(28, 45, 75, .12);

  --glow: rgba(115, 87, 255, .16);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(115, 87, 255, .08), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(47, 140, 255, .06), transparent 28%),
    var(--bg);
  overflow-x: hidden;
  transition: background var(--t), color var(--t);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; background: none; cursor: pointer; color: inherit; }
p, h1, h2, h3, h4 { margin: 0; }
::selection { background: var(--primary); color: #fff; }

:focus-visible {
  outline: 3px solid rgba(47, 140, 255, .55);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Layout ---------- */
.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

main { min-height: calc(100vh - var(--header-h)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t), border-color var(--t);
}
[data-theme="light"] .site-header { background: rgba(255, 255, 255, .85); }

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ---------- Logo (Circular) ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;

  opacity: 100%;
  transition: transform var(--t), box-shadow var(--t);
}
.brand:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 26px rgba(115, 87, 255, .45);
}
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  background: transparent;
  user-select: none;
  -webkit-user-drag: none;
  border: 0;
}

/* ---------- Navigation ---------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-inline: auto;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--t), background var(--t);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(115, 87, 255, .22), rgba(47, 140, 255, .14));
  box-shadow: inset 0 0 0 1px rgba(115, 87, 255, .16);
}
[data-theme="light"] .main-nav a.active { color: var(--primary); background: rgba(115, 87, 255, .1); }

/* ---------- Header actions ---------- */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-button,
.language-button,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  min-width: 42px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all var(--t);
}
.icon-button:hover,
.language-button:hover,
.menu-button:hover {
  border-color: rgba(115, 87, 255, .4);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Language ---------- */
.language-wrapper { position: relative; }
.language-button { gap: 7px; font-size: 12px; font-weight: 800; }
.language-icon {
  width: 16px; height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
}
.language-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 190px;
  padding: 7px;
  display: none;
  background: rgba(16, 23, 37, .97);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 200;
  animation: menuIn .18s ease;
}
[data-theme="light"] .language-menu { background: rgba(255, 255, 255, .98); }

.language-menu.open,
.language-wrapper.open .language-menu { display: block; }

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

.language-option {
  width: 100%;
  min-height: 43px;
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  text-align: start;
  transition: background var(--t), color var(--t);
}
.language-option:hover { background: var(--surface-2); color: var(--text); }
.language-option.active { color: var(--primary); background: rgba(115, 87, 255, .1); }
.language-symbol {
  width: 32px; height: 27px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--surface-3);
  font-size: 11px; font-weight: 900;
}
.language-name { font-size: 13px; font-weight: 600; }
.language-check { opacity: 0; }
.language-option.active .language-check { opacity: 1; }

/* ---------- Menu button ---------- */
.menu-button { display: none; padding: 0; }
.menu-lines {
  width: 20px; height: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.menu-lines span {
  display: block; height: 2px; width: 100%;
  background: currentColor; border-radius: 10px;
  transition: transform var(--t), opacity var(--t);
}
.menu-button[aria-expanded="true"] .menu-lines span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-lines span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] .menu-lines span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 80px;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 20%, rgba(115, 87, 255, .2), transparent 32%),
    radial-gradient(circle at 20% 70%, rgba(47, 140, 255, .11), transparent 30%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hero-content { max-width: 760px; margin-inline: auto; text-align: center; }
.hero-label {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 13px;
  border: 1px solid rgba(115, 87, 255, .25);
  border-radius: 999px;
  background: rgba(115, 87, 255, .08);
  color: #b9adff;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.hero h1 {
  margin: 0 auto 18px;
  font-size: clamp(32px, 6vw, 60px);
  line-height: 1.12;
  font-weight: 850;
  letter-spacing: -.03em;
}
.hero p {
  max-width: 660px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
}

/* ---------- Search form ---------- */
.search-form {
  width: min(680px, 100%);
  margin-inline: auto;
  display: flex;
  gap: 9px;
  padding: 7px;
  background: rgba(16, 23, 37, .94);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .search-form { background: rgba(255, 255, 255, .95); }

.search-form input {
  flex: 1; min-width: 0; height: 48px;
  padding: 0 15px;
  background: transparent;
  border: 0; outline: 0;
  color: var(--text);
  border-radius: var(--radius);
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
  min-width: 100px; min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 22px var(--glow);
  transition: transform var(--t), filter var(--t);
}
.search-form button:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ---------- Sections ---------- */
.section { padding: 65px 0; }
.section-heading { margin-bottom: 26px; }
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.section-heading h2,
.section-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.text-link {
  display: inline-flex; align-items: center;
  padding: 8px 12px;
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 800;
  transition: background var(--t);
}
.text-link:hover { background: rgba(115, 87, 255, .1); }

/* ---------- Page hero ---------- */
.page-hero {
  padding: 60px 0 48px;
  background: radial-gradient(circle at 85% 10%, rgba(115, 87, 255, .13), transparent 32%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.page-heading { max-width: 800px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 11px;
  color: #b8adff;
  background: rgba(115, 87, 255, .08);
  border: 1px solid rgba(115, 87, 255, .2);
  border-radius: 999px;
  font-size: 12px; font-weight: 800;
}
.page-heading h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 850;
  line-height: 1.2;
  margin-bottom: 10px;
}
.page-heading p { color: var(--muted); font-size: 16px; max-width: 700px; }

/* ---------- Category grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.category-card {
  position: relative;
  min-height: 130px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  overflow: hidden;
  color: var(--text);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.category-card::before {
  content: "";
  position: absolute;
  width: 130px; height: 130px;
  top: -70px; inset-inline-start: -45px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(115, 87, 255, .22), rgba(47, 140, 255, .04));
  transition: transform .35s ease;
}
.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(115, 87, 255, .35);
  box-shadow: var(--shadow);
}
.category-card:hover::before { transform: scale(1.25); }
.category-card span { position: relative; font-size: 15px; font-weight: 800; z-index: 1; }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* ---------- Product card ---------- */
.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(115, 87, 255, .32);
  box-shadow: var(--shadow);
}

.product-image {
  display: block;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: linear-gradient(135deg, #111a2b, #172239);
  border-bottom: 1px solid var(--border);
}
.product-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.product-card:hover .product-image img { transform: scale(1.05); }

.product-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 22px;
  background:
    radial-gradient(circle at 30% 25%, rgba(115, 87, 255, .35), transparent 30%),
    radial-gradient(circle at 80% 75%, rgba(34, 214, 163, .2), transparent 28%),
    linear-gradient(135deg, #11182a, #18253d);
}
.product-image-placeholder span {
  width: 70px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 18px 35px rgba(0, 0, 0, .25);
}

.product-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
}
.product-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.product-card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
}
.product-card-body h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.product-card-body h3 a { transition: color var(--t); }
.product-card-body h3 a:hover { color: var(--primary); }
.product-card-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.product-size {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.product-details-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  transition: all var(--t);
}
.product-details-link:hover {
  color: var(--primary);
  border-color: rgba(115, 87, 255, .3);
  transform: translateX(2px);
}
.product-details-link svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2;
}
html[dir="rtl"] .product-details-link svg { transform: scaleX(-1); }

/* ---------- Downloads controls ---------- */
.downloads-controls {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.downloads-search input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: 0;
  transition: border-color var(--t), box-shadow var(--t);
}
.downloads-search input:focus {
  border-color: rgba(115, 87, 255, .5);
  box-shadow: 0 0 0 4px rgba(115, 87, 255, .1);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.category-filters button {
  min-height: 37px;
  padding: 6px 14px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 750;
  transition: all var(--t);
}
.category-filters button:hover {
  color: var(--text);
  border-color: rgba(115, 87, 255, .28);
}
.category-filters button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  box-shadow: 0 7px 18px var(--glow);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-control label { color: var(--muted); font-size: 12px; font-weight: 700; }
.sort-control select {
  min-width: 160px; height: 40px;
  padding: 0 12px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  cursor: pointer;
}

/* ---------- Product page ---------- */
.product-page-section { padding-top: 40px; }
.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  padding: 8px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 750;
  transition: all var(--t);
}
.back-link:hover { color: var(--text); background: var(--surface-2); }

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 34px;
  padding: 24px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.product-detail-image {
  width: 100%;
  min-height: 360px;
  max-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #10192b, #19253c);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.product-detail-image img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.product-detail-content { min-width: 0; padding: 8px 0; }
.product-category {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.product-detail-content h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.product-detail-content .product-description {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}
.product-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 22px;
}
.product-info-grid > div {
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.product-info-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.product-info-grid strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.product-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.primary-button,
.button-primary {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 26px var(--glow);
  transition: transform var(--t), box-shadow var(--t), filter var(--t);
}
.primary-button:hover,
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px var(--glow);
  filter: brightness(1.05);
}
.primary-button.disabled,
.button-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.legal-notice {
  padding: 12px 15px;
  color: var(--text-soft);
  background: rgba(34, 214, 163, .07);
  border: 1px solid rgba(34, 214, 163, .2);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- Notice box (hacker) ---------- */
.notice-box {
  margin-bottom: 26px;
  padding: 20px 22px;
  background: rgba(115, 87, 255, .07);
  border: 1px solid rgba(115, 87, 255, .22);
  border-radius: var(--radius-lg);
}
.notice-box h2 {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.notice-box p { color: var(--muted); font-size: 13px; }

/* ---------- States ---------- */
.loading-state,
.empty-state,
.error-state {
  grid-column: 1 / -1;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.error-state { color: #ef5b6b; border-color: rgba(239, 91, 107, .25); background: rgba(239, 91, 107, .05); }

/* =========================================================
   VIDEO GUIDE (YouTube)
   ========================================================= */
.video-guide {
  margin-top: 36px;
  padding: 24px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  animation: videoFadeIn .45s ease;
}

@keyframes videoFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.video-guide-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.video-guide-header .video-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff0033, #ff5c5c);
  box-shadow: 0 8px 22px rgba(255, 0, 51, .32);
  flex-shrink: 0;
}

.video-guide-header .video-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.video-guide-header-text {
  min-width: 0;
}

.video-guide-header h2 {
  margin: 0;
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 850;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -.01em;
}

.video-guide-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.video-guide-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
}

.video-guide-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@supports not (aspect-ratio: 16 / 9) {
  .video-guide-frame {
    height: 0;
    padding-bottom: 56.25%;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin-top: 70px;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 45px;
  padding: 48px 0 40px;
}

.footer-brand .brand {
  width: 52px;
  height: 52px;
  justify-content: center;
}
.footer-brand p {
  margin-top: 14px;
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.footer-links h3 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-nav a {
  color: var(--muted);
  font-size: 13px;
  transition: color var(--t), transform var(--t);
  width: fit-content;
}
.footer-nav a:hover { color: var(--primary); }
html[dir="rtl"] .footer-nav a:hover { transform: translateX(-4px); }
html[dir="ltr"] .footer-nav a:hover { transform: translateX(4px); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.footer-bottom p {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .main-nav a { padding-inline: 9px; font-size: 13px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-main { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 35px; }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }

  .main-nav {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    inset-inline: 14px;
    max-height: calc(100vh - var(--header-h) - 25px);
    padding: 9px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    background: rgba(16, 23, 37, .98);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    z-index: 150;
  }
  [data-theme="light"] .main-nav { background: rgba(255, 255, 255, .98); }
  .main-nav.open { display: flex; animation: menuIn .18s ease; }
  .main-nav a { width: 100%; min-height: 45px; justify-content: flex-start; }
  .menu-button { display: inline-flex; }

  .product-detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .product-detail-image { min-height: 300px; }
}

@media (max-width: 700px) {
  .container { width: calc(100% - 26px); }

  .brand { width: 48px; height: 48px; }
  .language-code { display: none; }
  .language-menu { position: fixed; top: 64px; inset-inline-end: 12px; width: min(200px, calc(100vw - 24px)); }

  .hero { padding: 60px 0 55px; }
  .hero h1 { font-size: clamp(28px, 8vw, 42px); }
  .search-form { flex-direction: column; padding: 6px; }
  .search-form input { height: 46px; }
  .search-form button { width: 100%; min-height: 46px; }

  .section { padding: 45px 0; }
  .section-heading-row { flex-wrap: wrap; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-card { min-height: 100px; padding: 14px; }
  .category-card span { font-size: 13px; }

  .product-grid { grid-template-columns: 1fr; gap: 14px; }
  .product-image { height: 210px; }

  .sort-control { flex-direction: column; align-items: stretch; }
  .sort-control select { width: 100%; }

  .product-detail-layout { padding: 15px; }
  .product-detail-image { min-height: 260px; }
  .product-info-grid { grid-template-columns: 1fr; }

  .video-guide {
    padding: 16px;
    margin-top: 24px;
    border-radius: var(--radius-lg);
  }
  .video-guide-header { gap: 10px; margin-bottom: 14px; padding-bottom: 12px; }
  .video-guide-header .video-icon { width: 38px; height: 38px; border-radius: 10px; }
  .video-guide-header .video-icon svg { width: 20px; height: 20px; }
  .video-guide-header h2 { font-size: 16px; }
  .video-guide-header p { font-size: 12px; }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 38px 0 30px;
  }
  .footer-brand p { max-width: none; }
  .footer-brand .brand { width: 48px; height: 48px; }
}

@media (max-width: 480px) {
  .container { width: calc(100% - 20px); }
  .brand { width: 44px; height: 44px; }
  .hero h1 { font-size: clamp(26px, 8vw, 36px); }
  .category-card { min-height: 88px; padding: 12px; }
  .category-card span { font-size: 12px; }
  .product-image { height: 195px; }
  .product-detail-content h1 { font-size: 24px; }
  .footer-brand .brand { width: 44px; height: 44px; }
  .video-guide-header { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1500px) {
  :root { --container: 1280px; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border: 2px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .search-form, .downloads-controls, .product-actions, .video-guide { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}
/* =========================================================
   DOWNLOAD MODAL (Social Subscribe)
   ========================================================= */
.download-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 14, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  overflow-y: auto;
}

.download-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.download-modal {
  position: relative;
  width: min(520px, 100%);
  margin: auto;
  padding: 32px 26px 26px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  text-align: center;
  transform: scale(.92) translateY(20px);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.2);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.download-modal-overlay.open .download-modal {
  transform: scale(1) translateY(0);
}

/* Close button */
.download-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
  font-size: 20px;
  line-height: 1;
}
.download-modal-close:hover {
  color: var(--text);
  background: var(--surface);
  transform: rotate(90deg);
}

/* Icon */
.download-modal-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 15px 40px rgba(115, 87, 255, .4);
  font-size: 34px;
  animation: giftBounce 2s ease-in-out infinite;
}

@keyframes giftBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-8px) rotate(-4deg); }
}

/* Title */
.download-modal h2 {
  margin: 0 0 8px;
  font-size: clamp(19px, 3.5vw, 24px);
  font-weight: 850;
  color: var(--text);
  letter-spacing: -.01em;
}

.download-modal .download-modal-desc {
  margin: 0 auto 22px;
  max-width: 380px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* Social buttons */
.social-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.social-sub-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), filter var(--t);
  overflow: hidden;
}

.social-sub-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
}

.social-sub-btn svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.social-sub-btn.youtube {
  background: linear-gradient(135deg, #ff0033, #ff2b60);
  box-shadow: 0 10px 24px rgba(255, 0, 51, .32);
}
.social-sub-btn.tiktok {
  background: linear-gradient(135deg, #000, #25f4ee 120%);
  box-shadow: 0 10px 24px rgba(37, 244, 238, .25);
  border-color: rgba(255, 255, 255, .12);
}
.social-sub-btn.instagram {
  background: linear-gradient(135deg, #feda75, #d62976 45%, #4f5bd5);
  box-shadow: 0 10px 24px rgba(214, 41, 118, .32);
}

/* Check mark when clicked */
.social-sub-btn .sub-check {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #22d6a3;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.4);
  transition: all .3s ease;
}

.social-sub-btn.subscribed .sub-check {
  opacity: 1;
  transform: scale(1);
}

.social-sub-btn.subscribed {
  position: relative;
}

/* Countdown */
.download-countdown {
  margin-bottom: 18px;
}

.countdown-ring {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 10px;
}

.countdown-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-ring circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.countdown-ring .ring-bg {
  stroke: var(--border-strong);
}

.countdown-ring .ring-fg {
  stroke: url(#cdGradient);
  stroke-dasharray: 226;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.download-countdown p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Final Download Button */
.download-final-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 30px var(--glow);
  cursor: pointer;
  transition: all var(--t);
}

.download-final-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px var(--glow);
  filter: brightness(1.06);
}

.download-final-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: linear-gradient(135deg, #4a4a5c, #2f2f40);
  box-shadow: none;
  color: rgba(255, 255, 255, .65);
}

.download-final-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Ready state animation */
.download-final-btn.ready {
  animation: readyPulse 1.4s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 12px 30px var(--glow); }
  50%      { box-shadow: 0 12px 40px rgba(115, 87, 255, .55); }
}

/* Responsive */
@media (max-width: 480px) {
  .download-modal { padding: 26px 18px 20px; border-radius: var(--radius-lg); }
  .download-modal-icon { width: 62px; height: 62px; font-size: 28px; border-radius: 20px; }
  .social-sub-grid { gap: 7px; }
  .social-sub-btn { padding: 12px 5px; font-size: 10px; gap: 6px; }
  .social-sub-btn svg { width: 22px; height: 22px; }
  .countdown-ring { width: 68px; height: 68px; }
  .countdown-number { font-size: 20px; }
}