/* ============================================================
   visual-fixes-v2.css — ASTRO-ADAPTED visual QA layer
   ============================================================
   Базируется на staging visual-fixes.css (mobile-app SPA).
   Расширение для Astro: каждый [style*="rgb(...)"] селектор
   дополнен hex-вариантами (#aabbcc lowercase + #AABBCC upper),
   потому что Astro SSR пишет inline-style raw (без CSSOM-
   нормализации hex→rgb которую делает React-DOM).

   Source-of-truth для оригинальных правил:
     wp-content/themes/avanam-superstore/visual-fixes.css
     (на staging Cloudways app vycwqkbppr)
   ============================================================ */


/* ──────────────────────────────────────────────────────────
   PATCH 1.1 — Контраст неактивных категорий
   #D4D4D8 (1.48:1) → #71717A (4.83:1 AA ✓)
   ────────────────────────────────────────────────────────── */
#device-wrap .no-scroll > button[style*="rgb(212, 212, 216)"],
#device-wrap .no-scroll > button[style*="#d4d4d8"],
#device-wrap .no-scroll > button[style*="#D4D4D8"] {
  color: #71717A !important;
}


/* ──────────────────────────────────────────────────────────
   PATCH 1.2 — Иерархия карточки товара
   ────────────────────────────────────────────────────────── */

/* 1.2.1 — Бренд (Subei Toys и т.п.) */
#device-wrap span[style*="color: rgb(138, 138, 142)"][style*="font-size: 9px"],
#device-wrap span[style*="color: #8a8a8e"][style*="font-size: 9px"],
#device-wrap span[style*="color: #8A8A8E"][style*="font-size: 9px"] {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #71717A !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
}

/* 1.2.2 — SKU (YM1090747) */
#device-wrap span[style*="color: rgb(107, 107, 112)"][style*="font-size: 9px"],
#device-wrap span[style*="color: #6b6b70"][style*="font-size: 9px"],
#device-wrap span[style*="color: #6B6B70"][style*="font-size: 9px"] {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #71717A !important;
}

/* 1.2.3 — Название товара (без rgb — без изменений) */
#device-wrap div[style*="font-size: 13px"][style*="line-height: 16px"] {
  font-size: 15px !important;
  line-height: 1.35 !important;
  color: #0A0A0A !important;
  min-height: 41px !important;
}

/* 1.2.4 — MOQ-пилюля */
#device-wrap span[style*="font-size: 8px"][style*="rgb(232, 123, 0)"],
#device-wrap span[style*="font-size: 8px"][style*="#e87b00"],
#device-wrap span[style*="font-size: 8px"][style*="#E87B00"] {
  font-size: 10px !important;
  color: #C76200 !important;
  background: #FFF1E0 !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  letter-spacing: 0.4px !important;
  line-height: 1 !important;
}

/* 1.2.5 — «за шт» / «/ шт» */
#device-wrap span[style*="color: rgb(138, 138, 142)"][style*="font-size: 11px"],
#device-wrap span[style*="color: #8a8a8e"][style*="font-size: 11px"],
#device-wrap span[style*="color: #8A8A8E"][style*="font-size: 11px"] {
  color: #71717A !important;
}

/* 1.2.6 — Старая цена за упаковку (¥ 938) */
#device-wrap span[style*="color: rgb(138, 138, 142)"][style*="font-size: 10.5px"],
#device-wrap span[style*="color: #8a8a8e"][style*="font-size: 10.5px"],
#device-wrap span[style*="color: #8A8A8E"][style*="font-size: 10.5px"] {
  color: #71717A !important;
}


/* ──────────────────────────────────────────────────────────
   PATCH 1.3 — CTA-кнопки (В заявку / Рассчитать / Смотреть каталог)
   Variant A: затемнённый #C76200 + белый текст (4.52:1 ✓ AA strict)
   Touch-зоны: карточка 44px, hero 46px (was 36/32 ❌)
   ────────────────────────────────────────────────────────── */

/* 1.3.1 — Карточная "В заявку" */
#device-wrap button[style*="height: 36px"][style*="rgb(232, 123, 0)"],
#device-wrap button[style*="height: 36px"][style*="#e87b00"],
#device-wrap button[style*="height: 36px"][style*="#E87B00"] {
  height: auto !important;
  min-height: 44px !important;
  padding: 12px 16px !important;
  background: #C76200 !important;
  color: #FFFFFF !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  letter-spacing: 0 !important;
  transition: transform 0.12s ease, opacity 0.12s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}
#device-wrap button[style*="height: 36px"][style*="rgb(232, 123, 0)"]:active,
#device-wrap button[style*="height: 36px"][style*="#e87b00"]:active,
#device-wrap button[style*="height: 36px"][style*="#E87B00"]:active {
  transform: scale(0.97) !important;
  opacity: 0.85 !important;
}

/* 1.3.2 — Hero CTA "Рассчитать" + "Смотреть каталог"
   broader: матчим rgba(232, 123, 0, 0.4) в любом стиль-context */
#device-wrap button[style*="rgba(232, 123, 0, 0.4)"],
#device-wrap button[style*="rgba(232,123,0,0.4)"] {
  min-height: 46px !important;
  padding: 12px 20px !important;
  background: #C76200 !important;
  color: #FFFFFF !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(199, 98, 0, 0.35) !important;
  letter-spacing: 0 !important;
  margin-top: 12px !important;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}
#device-wrap button[style*="rgba(232, 123, 0, 0.4)"]:active,
#device-wrap button[style*="rgba(232,123,0,0.4)"]:active {
  transform: scale(0.97) !important;
  opacity: 0.85 !important;
  box-shadow: 0 2px 6px rgba(199, 98, 0, 0.4) !important;
}

/* 1.3.3 — Focus-visible a11y */
#device-wrap button[style*="rgb(232, 123, 0)"]:focus-visible,
#device-wrap button[style*="#e87b00"]:focus-visible,
#device-wrap button[style*="#E87B00"]:focus-visible,
#device-wrap button.vf-pressed:focus-visible {
  outline: 2px solid #0A0A0A !important;
  outline-offset: 2px !important;
}

/* 1.3.4 — iOS-safe pressed state (visual-fixes.js touchstart adds class) */
#device-wrap button.vf-cta-pressed {
  transform: scale(0.97) !important;
  opacity: 0.85 !important;
  transition: transform 0.12s ease, opacity 0.12s ease !important;
}
#device-wrap button[style*="rgba(232, 123, 0, 0.4)"].vf-cta-pressed,
#device-wrap button[style*="rgba(232,123,0,0.4)"].vf-cta-pressed {
  box-shadow: 0 2px 6px rgba(199, 98, 0, 0.4) !important;
}


/* ──────────────────────────────────────────────────────────
   PATCH 1.4 — Сердечко (favorite) на карточке товара
   30×30 → 44×44 hit-area, 14px → 20px иконка, frosted круг
   Селекторы — по размерным [style*="width: 30px"]... — без цвета,
   hex-варианты не нужны.
   ────────────────────────────────────────────────────────── */

/* 1.4.1 — Hit-area 44×44, прозрачный фон (круг рисуется ::before) */
#device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"] {
  width: 44px !important;
  height: 44px !important;
  top: 4px !important;
  right: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 50% !important;
  padding: 0 !important;
  position: absolute !important;
  transition: transform 0.12s ease, opacity 0.12s ease !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer !important;
}

/* 1.4.2 — Полупрозрачный круг 32×32 (frosted glass) через ::before */
#device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"]::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 32px !important;
  height: 32px !important;
  margin-top: -16px !important;
  margin-left: -16px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* 1.4.3 — SVG-иконка 14 → 20, поверх ::before */
#device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"] svg {
  width: 20px !important;
  height: 20px !important;
  position: relative !important;
  z-index: 1 !important;
  stroke-width: 2 !important;
}

/* 1.4.4 — Pressed state (iOS-safe через JS .vf-fav-pressed + fallback :active) */
#device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"]:active,
#device-wrap button.vf-fav-pressed {
  transform: scale(0.92) !important;
  opacity: 0.85 !important;
}

/* 1.4.5 — Focus-visible a11y */
#device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"]:focus-visible {
  outline: 2px solid #0A0A0A !important;
  outline-offset: 2px !important;
}

/* 1.4.6 — Reduce-motion */
@media (prefers-reduced-motion: reduce) {
  #device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"],
  #device-wrap button.vf-cta-pressed,
  #device-wrap button.vf-fav-pressed {
    transition: none !important;
  }
  #device-wrap button[style*="width: 30px"][style*="border-radius: 15px"][style*="top: 10px"]:active,
  #device-wrap button.vf-cta-pressed,
  #device-wrap button.vf-fav-pressed {
    transform: none !important;
  }
}

/* end of visual-fixes-v2.css */
