/* ============================================
   WOOCOMMERCE SEO TABS - DESIGN SYSTEM
   ============================================ */

/* ===== CSS Variables - Design System ===== */
:root {
  /* Base Colors */
  --seo-bg: #fff;
  --seo-bg-secondary: #f9fafb;
  --seo-bg-tertiary: #f3f4f6;
  --seo-border: #e5e7eb;
  --seo-border-light: #f3f4f6;
  --seo-border-dark: #d1d5db;
  
  /* Text Colors */
  --seo-ink: #111827; /* Dark gray - Elementor default */
  --seo-ink-secondary: #374151;
  --seo-muted: #6b7280;
  --seo-muted-light: #9ca3af;
  --seo-text-on-primary: #fff;
  
  /* Primary Color System (Orange #F7A984) */
  --seo-primary: #F7A984;
  --seo-primary-light: #fbc4a8;
  --seo-primary-dark: #e8926a;
  --seo-primary-hover: color-mix(in srgb, #F7A984, white 12%);
  --seo-primary-active: color-mix(in srgb, #F7A984, black 8%);
  --seo-primary-gradient: linear-gradient(135deg, #F7A984 0%, #fbc4a8 100%);
  --seo-primary-subtle: rgba(247, 169, 132, 0.1);
  
  /* Semantic Colors */
  --seo-success: #10b981;
  --seo-success-light: #d1fae5;
  --seo-success-dark: #059669;
  --seo-warning: #f59e0b;
  --seo-warning-light: #fef3c7;
  --seo-warning-dark: #d97706;
  --seo-error: #ef4444;
  --seo-error-light: #fee2e2;
  --seo-error-dark: #dc2626;
  --seo-info: #3b82f6;
  --seo-info-light: #dbeafe;
  --seo-info-dark: #2563eb;
  
  /* Focus & Interactive */
  --seo-focus: #3b82f6;
  --seo-focus-ring: rgba(59, 130, 246, 0.15);
  --seo-hover: #f7f9ff;
  --seo-hover-dark: #f0f4ff;
  
  /* Shadows - Elevation System */
  --seo-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --seo-shadow-sm: 0 2px 4px rgba(16, 24, 40, 0.06);
  --seo-shadow-md: 0 4px 8px rgba(16, 24, 40, 0.08);
  --seo-shadow-lg: 0 8px 16px rgba(16, 24, 40, 0.1);
  --seo-shadow-xl: 0 12px 24px rgba(16, 24, 40, 0.12);
  --seo-shadow-inner: inset 0 2px 4px rgba(16, 24, 40, 0.06);
  
  /* Typography Scale */
  --seo-font-size-xs: 11px;
  --seo-font-size-sm: 13px;
  --seo-font-size-base: 14px;
  --seo-font-size-md: 16px;
  --seo-font-size-lg: 18px;
  --seo-font-size-xl: 20px;
  --seo-font-size-2xl: 24px;
  
  --seo-line-height-tight: 1.25;
  --seo-line-height-normal: 1.5;
  --seo-line-height-relaxed: 1.75;
  
  --seo-font-weight-normal: 400;
  --seo-font-weight-medium: 500;
  --seo-font-weight-semibold: 600;
  --seo-font-weight-bold: 700;
  
  /* Spacing Scale */
  --seo-space-1: 4px;
  --seo-space-2: 8px;
  --seo-space-3: 12px;
  --seo-space-4: 16px;
  --seo-space-5: 20px;
  --seo-space-6: 24px;
  --seo-space-8: 32px;
  --seo-space-10: 40px;
  
  /* Border Radius */
  --seo-radius-sm: 6px;
  --seo-radius-md: 8px;
  --seo-radius-lg: 12px;
  --seo-radius-xl: 16px;
  --seo-radius-full: 9999px;
  
  /* Transitions */
  --seo-transition-fast: 150ms ease;
  --seo-transition-base: 200ms ease;
  --seo-transition-slow: 300ms ease;
  --seo-transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-index Scale */
  --seo-z-base: 1;
  --seo-z-dropdown: 10;
  --seo-z-sticky: 20;
  --seo-z-overlay: 30;
  --seo-z-modal: 40;
  --seo-z-tooltip: 50;
}

/* Ensure plugin scope keeps its own design tokens */
.wc-seo-plugin-scope {
  --seo-primary: #F7A984;
  --seo-primary-hover: color-mix(in srgb, #F7A984, white 12%);
  --seo-primary-active: color-mix(in srgb, #F7A984, black 8%);
  --seo-primary-gradient: linear-gradient(135deg, #F7A984 0%, #fbc4a8 100%);
  --seo-primary-subtle: rgba(247, 169, 132, 0.1);
  
  /* Reset text color to ensure Elementor compatibility */
  color: var(--seo-ink);
}

/* ===== SVG Icons (Base64 encoded) ===== */
.wc-seo-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
}

.wc-seo-icon--visits {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.wc-seo-icon--bounce {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Cpath d='M12 7v6'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.wc-seo-icon--time {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}

.wc-seo-icon--rank {
  /* Иконка стрелки вверх для вероятности вытеснения */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5'/%3E%3Cpath d='M5 12l7-7 7 7'/%3E%3C/svg%3E");
}

.wc-seo-icon--iks {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5z'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3C/svg%3E");
}

.wc-seo-icon--trust {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
}

.wc-seo-icon--link {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
}

.wc-seo-icon--info {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.wc-seo-icon--check {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.wc-seo-icon--alert {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

.wc-seo-icon--empty {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}

/* ===== Base Styles & Reset ===== */
.wc-seo-plugin-scope {
  /* CSS Containment for better isolation */
  contain: layout style paint;
  
  /* Ensure proper text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Reset common theme overrides */
  box-sizing: border-box;
  
  /* Isolate from theme font settings */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--seo-ink);
}

.wc-seo-plugin-scope *,
.wc-seo-plugin-scope *::before,
.wc-seo-plugin-scope *::after {
  box-sizing: inherit;
}

/* Selective reset for our components - avoid all:initial to prevent flickering */
.wc-seo-plugin-scope .woocommerce-seo-tab {
  display: block !important;
  background: var(--seo-bg) !important;
  border: 1px solid var(--seo-border) !important;
  border-radius: var(--seo-radius-lg) !important;
  padding: var(--seo-space-6) !important;
  box-shadow: var(--seo-shadow-md) !important;
  margin-top: var(--seo-space-4) !important;
  transition: box-shadow var(--seo-transition-base) !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: var(--seo-ink) !important;
}

/* ===== Product Tabs ===== */

.wc-seo-plugin-scope .woocommerce-seo-tab:hover {
  box-shadow: var(--seo-shadow-lg);
}

.wc-seo-plugin-scope .woocommerce-seo-tab .metric-updated {
  margin: 0 0 var(--seo-space-4) 0;
  color: var(--seo-muted);
  font-size: var(--seo-font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--seo-space-2);
}

.wc-seo-plugin-scope .woocommerce-seo-tab .metric-updated::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--seo-success);
  display: inline-block;
  flex-shrink: 0;
}

/* ===== Tables - Enhanced Design ===== */
/* Defensive overrides to resist aggressive theme styles */
.wc-seo-plugin-scope .woocommerce .woocommerce-seo-tab .shop_table,
.wc-seo-plugin-scope .woocommerce .woocommerce-seo-tab .wc-seo-shop-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 var(--seo-space-2) !important;
  background: transparent !important;
  margin: 0 !important;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table thead {
  display: none !important;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table tbody {
  display: table-row-group !important;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table tr {
  display: table-row !important;
  background: var(--seo-bg-secondary) !important;
  border-radius: var(--seo-radius-md) !important;
  transition: all var(--seo-transition-base) !important;
  position: relative;
  overflow: hidden;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table tr::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--seo-primary-gradient);
  opacity: 0;
  transition: opacity var(--seo-transition-base);
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table tr:hover {
  background: var(--seo-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--seo-shadow-sm);
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table tr:hover::before {
  opacity: 1;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table th,
.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table td {
  display: table-cell !important;
  background: transparent !important;
  padding: var(--seo-space-4) var(--seo-space-5) !important;
  color: var(--seo-ink) !important;
  border: none !important;
  vertical-align: middle !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table th {
  width: 45%;
  font-weight: var(--seo-font-weight-semibold);
  color: var(--seo-ink-secondary);
  text-align: left;
  font-size: var(--seo-font-size-base);
  position: relative;
  padding-left: var(--seo-space-6) !important;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table th .wc-seo-icon {
  flex-shrink: 0;
  opacity: 0.8;
  margin-right: var(--seo-space-2);
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table th::before {
  content: "";
  position: absolute;
  left: var(--seo-space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--seo-primary);
  opacity: 0.6;
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table td {
  font-weight: var(--seo-font-weight-medium);
  color: var(--seo-ink);
  font-size: var(--seo-font-size-base);
}

/* Value styling with badges */
.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table td strong {
  display: inline-flex;
  align-items: center;
  gap: var(--seo-space-1);
  padding: var(--seo-space-1) var(--seo-space-3);
  background: var(--seo-primary-subtle);
  color: var(--seo-primary-dark);
  border-radius: var(--seo-radius-sm);
  font-weight: var(--seo-font-weight-semibold);
  font-size: var(--seo-font-size-base);
}

/* Empty state styling */
.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table td em {
  color: var(--seo-muted-light);
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: var(--seo-space-2);
  padding: var(--seo-space-2) var(--seo-space-3);
}

.wc-seo-plugin-scope .woocommerce .wc-seo-shop-table td em::before {
  content: "";
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.5;
}

/* ===== Inline Metrics on Catalog ===== */
.wc-seo-plugin-scope .wc-seo-inline-metrics {
  display: inline-flex;
  gap: var(--seo-space-2);
  align-items: center;
  margin-top: var(--seo-space-2);
  font-size: var(--seo-font-size-sm);
  flex-wrap: wrap;
}

.wc-seo-plugin-scope .wc-seo-inline-metrics > span {
  display: inline-flex;
  align-items: center;
  gap: var(--seo-space-2);
  padding: var(--seo-space-2) var(--seo-space-3);
  background: var(--seo-bg-secondary);
  border: 1px solid var(--seo-border);
  border-radius: var(--seo-radius-md);
  color: var(--seo-ink);
  transition: all var(--seo-transition-base);
}

.wc-seo-plugin-scope .wc-seo-inline-metrics > span:hover {
  background: var(--seo-hover);
  border-color: var(--seo-primary);
  transform: translateY(-1px);
  box-shadow: var(--seo-shadow-xs);
}

.wc-seo-plugin-scope .wc-seo-inline-metrics strong {
  color: var(--seo-primary-dark);
  font-weight: var(--seo-font-weight-semibold);
  background: var(--seo-primary-subtle);
  padding: 2px var(--seo-space-2);
  border-radius: var(--seo-radius-sm);
  font-size: var(--seo-font-size-sm);
}

.wc-seo-plugin-scope .wc-seo-inline-metrics em {
  color: var(--seo-muted-light);
  font-style: normal;
}

/* ===== SERM Controls - Maximum Specificity ===== */
.wc-seo-plugin-scope .wc-seo-serm-controls,
body .wc-seo-plugin-scope .wc-seo-serm-controls,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-controls {
  display: block !important;
  margin: var(--seo-space-6) 0 !important;
  padding: var(--seo-space-4) !important;
  border: 1px solid var(--seo-border) !important;
  background: linear-gradient(180deg, #fbfbfb 0%, #f5f7fb 100%) !important;
  border-radius: var(--seo-radius-lg) !important;
  box-shadow: var(--seo-shadow-md) !important;
  position: relative !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: var(--seo-ink) !important;
}

/* Компактный режим для активной сортировки */
.wc-seo-plugin-scope .wc-seo-serm-controls--compact,
body .wc-seo-plugin-scope .wc-seo-serm-controls--compact,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-controls--compact {
  padding: var(--seo-space-3) !important;
  margin: var(--seo-space-4) 0 !important;
}

/* Дополнительное уменьшение отступов в компактном режиме */
.wc-seo-plugin-scope .wc-seo-serm-controls--compact .wc-seo-serm-row,
body .wc-seo-plugin-scope .wc-seo-serm-controls--compact .wc-seo-serm-row,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-controls--compact .wc-seo-serm-row {
  margin-bottom: var(--seo-space-1) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-controls--compact .wc-seo-field,
body .wc-seo-plugin-scope .wc-seo-serm-controls--compact .wc-seo-field,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-controls--compact .wc-seo-field {
  gap: var(--seo-space-1) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-controls::before,
body .wc-seo-plugin-scope .wc-seo-serm-controls::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  background: var(--seo-primary-gradient) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.wc-seo-plugin-scope .wc-seo-serm-form,
body .wc-seo-plugin-scope .wc-seo-serm-form,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form {
  display: flex !important;
  gap: var(--seo-space-1) !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  position: relative !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  /* Улучшенная организация элементов */
  row-gap: var(--seo-space-1) !important;
  overflow: visible !important;
}

/* Группировка элементов формы для лучшей организации */
.wc-seo-plugin-scope .wc-seo-serm-form > label + input,
.wc-seo-plugin-scope .wc-seo-serm-form > label + input[type="number"],
body .wc-seo-plugin-scope .wc-seo-serm-form > label + input,
body .wc-seo-plugin-scope .wc-seo-serm-form > label + input[type="number"] {
  margin-left: var(--seo-space-2) !important;
}

/* Улучшение отображения элементов в строку */
.wc-seo-plugin-scope .wc-seo-serm-form > label,
body .wc-seo-plugin-scope .wc-seo-serm-form > label,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form > label {
  flex-shrink: 0 !important;
  align-self: center !important;
}

.wc-seo-plugin-scope .wc-seo-group,
body .wc-seo-plugin-scope .wc-seo-group,
.woocommerce .wc-seo-plugin-scope .wc-seo-group {
  display: flex !important;
  align-items: center !important;
  gap: var(--seo-space-2) !important;
  flex-wrap: wrap !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
}

.wc-seo-plugin-scope .wc-seo-group label,
body .wc-seo-plugin-scope .wc-seo-group label,
.woocommerce .wc-seo-plugin-scope .wc-seo-group label {
  white-space: nowrap !important;
  font-weight: var(--seo-font-weight-semibold) !important;
  color: var(--seo-ink-secondary) !important;
  font-size: var(--seo-font-size-sm) !important;
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Защита для всех label в форме SERM */
.wc-seo-plugin-scope .wc-seo-serm-form > label,
.wc-seo-plugin-scope .wc-seo-serm-form label:not(.wc-seo-group label),
body .wc-seo-plugin-scope .wc-seo-serm-form > label,
body .wc-seo-plugin-scope .wc-seo-serm-form label:not(.wc-seo-group label),
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form > label,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form label:not(.wc-seo-group label) {
  font-weight: var(--seo-font-weight-semibold) !important;
  color: var(--seo-ink) !important;
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  font-size: var(--seo-font-size-sm) !important;
  line-height: 1.5 !important;
  white-space: nowrap !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Layout helpers for SERM form */
.wc-seo-plugin-scope .wc-seo-serm-row,
body .wc-seo-plugin-scope .wc-seo-serm-row,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-row {
  width: 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--seo-space-2) !important;
  align-items: flex-start !important;
  margin: 0 0 var(--seo-space-1) 0 !important;
  box-sizing: border-box !important;
}

/* Убираем нижний отступ у последней строки */
.wc-seo-plugin-scope .wc-seo-serm-row:last-child,
body .wc-seo-plugin-scope .wc-seo-serm-row:last-child,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-row:last-child {
  margin-bottom: 0 !important;
}

/* Визуальные разделители между группами полей */
.wc-seo-plugin-scope .wc-seo-serm-row:not(:first-child):not(.wc-seo-serm-row--primary):not(.wc-seo-serm-row--ghost-list),
body .wc-seo-plugin-scope .wc-seo-serm-row:not(:first-child):not(.wc-seo-serm-row--primary):not(.wc-seo-serm-row--ghost-list),
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-row:not(:first-child):not(.wc-seo-serm-row--primary):not(.wc-seo-serm-row--ghost-list) {
  padding-top: var(--seo-space-1) !important;
  border-top: 1px solid var(--seo-border-light) !important;
  margin-top: var(--seo-space-1) !important;
}

/* Убираем все отступы у ghost-list строки */
.wc-seo-plugin-scope .wc-seo-serm-row--ghost-list,
body .wc-seo-plugin-scope .wc-seo-serm-row--ghost-list,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-row--ghost-list {
  padding-top: 0 !important;
  margin-top: 0 !important;
  border-top: none !important;
}

/* Группировка связанных полей (поисковик + тип запроса) */
.wc-seo-plugin-scope .wc-seo-serm-row--selectors,
body .wc-seo-plugin-scope .wc-seo-serm-row--selectors,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-row--selectors {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: var(--seo-space-2) !important;
  margin-top: var(--seo-space-1) !important;
  padding-top: 0 !important;
  border-top: none !important;
}

/* Адаптивность для мобильных */
@media (max-width: 767px) {
  .wc-seo-plugin-scope .wc-seo-serm-row--selectors,
  body .wc-seo-plugin-scope .wc-seo-serm-row--selectors,
  .woocommerce .wc-seo-plugin-scope .wc-seo-serm-row--selectors {
    grid-template-columns: 1fr !important;
  }
}

.wc-seo-plugin-scope .wc-seo-serm-row:first-child,
body .wc-seo-plugin-scope .wc-seo-serm-row:first-child {
  margin-top: 0 !important;
}

.wc-seo-plugin-scope .wc-seo-field,
body .wc-seo-plugin-scope .wc-seo-field,
.woocommerce .wc-seo-plugin-scope .wc-seo-field {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--seo-space-1) !important;
  flex: 1 1 240px !important;
  min-width: 200px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.wc-seo-plugin-scope .wc-seo-field--ghost-list,
body .wc-seo-plugin-scope .wc-seo-field--ghost-list,
.woocommerce .wc-seo-plugin-scope .wc-seo-field--ghost-list {
  min-height: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  gap: var(--seo-space-1) !important;
}

.wc-seo-plugin-scope .wc-seo-field--actions,
body .wc-seo-plugin-scope .wc-seo-field--actions {
  flex: 0 0 auto !important;
  align-items: flex-end !important;
}

.wc-seo-plugin-scope .wc-seo-field__stack,
body .wc-seo-plugin-scope .wc-seo-field__stack,
.wc-seo-plugin-scope .wc-seo-field__inline,
body .wc-seo-plugin-scope .wc-seo-field__inline {
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  gap: var(--seo-space-2) !important;
}

.wc-seo-plugin-scope .wc-seo-field__stack,
body .wc-seo-plugin-scope .wc-seo-field__stack {
  flex-direction: column !important;
}

.wc-seo-plugin-scope .wc-seo-field__inline,
body .wc-seo-plugin-scope .wc-seo-field__inline {
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

.wc-seo-plugin-scope .wc-seo-serm-row--selectors .wc-seo-field,
body .wc-seo-plugin-scope .wc-seo-serm-row--selectors .wc-seo-field {
  flex: 1 1 220px !important;
}

.wc-seo-plugin-scope .wc-seo-serm-row--ghost-list,
body .wc-seo-plugin-scope .wc-seo-serm-row--ghost-list,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-row--ghost-list {
  flex-direction: column !important;
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  gap: 0 !important;
}

.wc-seo-plugin-scope .wc-seo-ghost-chips,
body .wc-seo-plugin-scope .wc-seo-ghost-chips {
  min-height: auto !important;
  padding: var(--seo-space-1) 0 !important;
}

.wc-seo-plugin-scope .wc-seo-serm-row--controls .wc-seo-field--sensitivity,
body .wc-seo-plugin-scope .wc-seo-serm-row--controls .wc-seo-field--sensitivity {
  flex: 1 1 200px !important;
}

.wc-seo-plugin-scope .wc-seo-serm-row--controls .wc-seo-field--actions,
body .wc-seo-plugin-scope .wc-seo-serm-row--controls .wc-seo-field--actions {
  flex: 0 0 auto !important;
}

/* ===== Form Inputs - Enhanced with Maximum Specificity ===== */
.wc-seo-plugin-scope .wc-seo-serm-form input[type="text"],
.wc-seo-plugin-scope .wc-seo-serm-form input[type="url"],
.wc-seo-plugin-scope .wc-seo-serm-form input[type="number"],
body .wc-seo-plugin-scope .wc-seo-serm-form input[type="text"],
body .wc-seo-plugin-scope .wc-seo-serm-form input[type="url"],
body .wc-seo-plugin-scope .wc-seo-serm-form input[type="number"],
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form input[type="text"],
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form input[type="url"],
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form input[type="number"] {
  min-width: 200px !important;
  padding: var(--seo-space-3) var(--seo-space-4) !important;
  border: 1px solid var(--seo-border) !important;
  border-radius: var(--seo-radius-md) !important;
  background: var(--seo-bg) !important;
  color: var(--seo-ink) !important;
  font-size: var(--seo-font-size-base) !important;
  transition: border-color var(--seo-transition-base), box-shadow var(--seo-transition-base), background-color var(--seo-transition-base) !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: middle !important;
  width: auto !important;
  max-width: 100% !important;
}

.wc-seo-plugin-scope .wc-seo-serm-form input[type="text"]:focus,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="url"]:focus,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="number"]:focus {
  outline: none;
  border-color: var(--seo-primary);
  box-shadow: 0 0 0 3px var(--seo-focus-ring);
  background: var(--seo-bg);
}

.wc-seo-plugin-scope .wc-seo-serm-form input[type="text"]:hover,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="url"]:hover,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="number"]:hover {
  border-color: var(--seo-border-dark);
}

.wc-seo-plugin-scope .wc-seo-serm-form input[type="text"]::placeholder,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="url"]::placeholder {
  color: var(--seo-muted-light);
}

/* Input states */
.wc-seo-plugin-scope .wc-seo-serm-form input[type="text"].wc-seo-input--error,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="url"].wc-seo-input--error {
  border-color: var(--seo-error);
  box-shadow: 0 0 0 3px var(--seo-error-light);
}

.wc-seo-plugin-scope .wc-seo-serm-form input[type="text"].wc-seo-input--success,
.wc-seo-plugin-scope .wc-seo-serm-form input[type="url"].wc-seo-input--success {
  border-color: var(--seo-success);
  box-shadow: 0 0 0 3px var(--seo-success-light);
}

/* ===== Select - Custom Styled with Maximum Specificity ===== */
.wc-seo-plugin-scope .wc-seo-serm-form select,
body .wc-seo-plugin-scope .wc-seo-serm-form select,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-form select {
  min-width: 150px !important;
  padding: var(--seo-space-3) var(--seo-space-4) !important;
  padding-right: var(--seo-space-10) !important;
  border: 1px solid var(--seo-border) !important;
  border-radius: var(--seo-radius-md) !important;
  background: var(--seo-bg) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right var(--seo-space-3) center !important;
  background-size: 16px !important;
  color: var(--seo-ink) !important;
  font-size: var(--seo-font-size-base) !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: border-color var(--seo-transition-base), box-shadow var(--seo-transition-base) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: middle !important;
  width: auto !important;
  max-width: 100% !important;
}

.wc-seo-plugin-scope .wc-seo-serm-form select:focus {
  outline: none;
  border-color: var(--seo-primary);
  box-shadow: 0 0 0 3px var(--seo-focus-ring);
}

.wc-seo-plugin-scope .wc-seo-serm-form select:hover {
  border-color: var(--seo-border-dark);
}

/* ===== Buttons - Enhanced with Variants (No Flickering) ===== */
.wc-seo-plugin-scope .wc-seo-btn,
.wc-seo-plugin-scope a.wc-seo-btn,
body .wc-seo-plugin-scope .wc-seo-btn,
body .wc-seo-plugin-scope a.wc-seo-btn,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn,
.woocommerce .wc-seo-plugin-scope a.wc-seo-btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding: var(--seo-space-3) var(--seo-space-5) !important;
  border-radius: var(--seo-radius-md) !important;
  border: 1px solid var(--seo-primary) !important;
  background: var(--seo-primary-gradient) !important;
  color: var(--seo-text-on-primary) !important;
  font-weight: var(--seo-font-weight-semibold) !important;
  font-size: var(--seo-font-size-base) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  transition: background var(--seo-transition-base), border-color var(--seo-transition-base), box-shadow var(--seo-transition-base), transform var(--seo-transition-base) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--seo-space-2) !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
  font-family: inherit !important;
  line-height: 1.5 !important;
  min-height: 40px !important; /* Touch-friendly */
  box-sizing: border-box !important;
  margin: 0 !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  /* Prevent flickering */
  visibility: visible !important;
  opacity: 1 !important;
}

.wc-seo-plugin-scope .wc-seo-btn::before,
body .wc-seo-plugin-scope .wc-seo-btn::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
  transition: left var(--seo-transition-slow) !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.wc-seo-plugin-scope .wc-seo-btn:hover,
body .wc-seo-plugin-scope .wc-seo-btn:hover,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn:hover {
  background: var(--seo-primary-hover) !important;
  border-color: var(--seo-primary-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--seo-shadow-md) !important;
  /* Prevent flickering on hover */
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn:hover::before,
body .wc-seo-plugin-scope .wc-seo-btn:hover::before {
  left: 100% !important;
}

.wc-seo-plugin-scope .wc-seo-btn:active,
body .wc-seo-plugin-scope .wc-seo-btn:active,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn:active {
  transform: translateY(0) !important;
  box-shadow: var(--seo-shadow-sm) !important;
  background: var(--seo-primary-active) !important;
  /* Prevent flickering on active */
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn:focus,
body .wc-seo-plugin-scope .wc-seo-btn:focus,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px var(--seo-focus-ring), var(--seo-shadow-md) !important;
  /* Prevent flickering on focus */
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn:disabled,
.wc-seo-plugin-scope .wc-seo-btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button variants - Maximum Specificity */
.wc-seo-plugin-scope .wc-seo-btn--primary,
body .wc-seo-plugin-scope .wc-seo-btn--primary,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--primary {
  background: var(--seo-primary-gradient) !important;
  border-color: var(--seo-primary) !important;
  color: var(--seo-text-on-primary) !important;
}

.wc-seo-plugin-scope .wc-seo-btn--primary:hover,
body .wc-seo-plugin-scope .wc-seo-btn--primary:hover,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--primary:hover {
  background: var(--seo-primary-hover) !important;
  border-color: var(--seo-primary-dark) !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn--secondary,
body .wc-seo-plugin-scope .wc-seo-btn--secondary,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--secondary {
  background: var(--seo-bg) !important;
  border-color: var(--seo-border) !important;
  color: var(--seo-ink) !important;
}

.wc-seo-plugin-scope .wc-seo-btn--secondary:hover,
body .wc-seo-plugin-scope .wc-seo-btn--secondary:hover,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--secondary:hover {
  background: var(--seo-bg-secondary) !important;
  border-color: var(--seo-border-dark) !important;
  color: var(--seo-ink) !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn--ghost,
body .wc-seo-plugin-scope .wc-seo-btn--ghost,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--ghost {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--seo-primary) !important;
}

.wc-seo-plugin-scope .wc-seo-btn--ghost:hover,
body .wc-seo-plugin-scope .wc-seo-btn--ghost:hover,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--ghost:hover {
  background: var(--seo-primary-subtle) !important;
  border-color: var(--seo-primary) !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn--small,
body .wc-seo-plugin-scope .wc-seo-btn--small,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--small {
  padding: var(--seo-space-2) var(--seo-space-3) !important;
  font-size: var(--seo-font-size-sm) !important;
  min-height: 32px !important;
}

.wc-seo-plugin-scope .wc-seo-btn--large,
body .wc-seo-plugin-scope .wc-seo-btn--large,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--large {
  padding: var(--seo-space-4) var(--seo-space-6) !important;
  font-size: var(--seo-font-size-md) !important;
  min-height: 48px !important;
}

/* Loading state - Maximum Specificity */
.wc-seo-plugin-scope .wc-seo-btn--loading,
body .wc-seo-plugin-scope .wc-seo-btn--loading,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--loading {
  position: relative !important;
  pointer-events: none !important;
  opacity: 0.85 !important;
  color: transparent !important;
  visibility: visible !important;
  display: inline-flex !important;
}

.wc-seo-plugin-scope .wc-seo-btn--disabled,
body .wc-seo-plugin-scope .wc-seo-btn--disabled,
.woocommerce .wc-seo-plugin-scope .wc-seo-btn--disabled {
  pointer-events: none !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.wc-seo-plugin-scope input.is-disabled,
body .wc-seo-plugin-scope input.is-disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

.wc-seo-plugin-scope .wc-seo-btn--loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-top-color: var(--seo-text-on-primary);
  border-radius: 50%;
  animation: wcSeoSpin 0.8s linear infinite;
}

@keyframes wcSeoSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Inline SERM URL Form - Better Positioning & Integration ===== */
/* Интеграция с областью фильтров WooCommerce */
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
body .woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
.woocommerce-page .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--seo-space-2) !important;
  margin: 0 var(--seo-space-3) 0 0 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 10 !important;
  flex-wrap: wrap !important;
  /* Интеграция с областью фильтров */
  float: none !important;
  clear: none !important;
}

/* Альтернативное расположение: если есть область с результатами/фильтрами */
.woocommerce-result-count + .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
.woocommerce-ordering + .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
.woocommerce .woocommerce-result-count ~ .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
.woocommerce .woocommerce-ordering ~ .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper {
  margin-left: var(--seo-space-4) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
body .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--seo-space-2) !important;
  margin: 0 var(--seo-space-3) var(--seo-space-4) 0 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 10 !important;
  flex-wrap: wrap !important;
}

.wc-seo-plugin-scope .wc-seo-serm-inline-url,
body .wc-seo-plugin-scope .wc-seo-serm-inline-url,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-url {
  display: inline-flex !important;
  gap: var(--seo-space-2) !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  margin: 0 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.wc-seo-plugin-scope .wc-seo-serm-inline-label,
body .wc-seo-plugin-scope .wc-seo-serm-inline-label,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-label {
  font-size: var(--seo-font-size-sm) !important;
  color: var(--seo-muted) !important;
  font-weight: var(--seo-font-weight-medium) !important;
  margin: 0 !important;
  white-space: nowrap !important;
  display: inline-block !important;
  box-sizing: border-box !important;
}

.wc-seo-plugin-scope .wc-seo-serm-inline-input,
.wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="text"],
.wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="url"],
body .wc-seo-plugin-scope .wc-seo-serm-inline-input,
body .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="text"],
body .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="url"],
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-input,
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="text"],
.woocommerce .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="url"] {
  min-width: 200px !important;
  max-width: 280px !important;
  padding: var(--seo-space-2) var(--seo-space-3) !important;
  border: 1px solid var(--seo-border) !important;
  border-radius: var(--seo-radius-md) !important;
  background: var(--seo-bg) !important;
  color: var(--seo-ink) !important;
  font-size: var(--seo-font-size-sm) !important;
  transition: border-color var(--seo-transition-base), box-shadow var(--seo-transition-base) !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: middle !important;
  width: auto !important;
}

.wc-seo-plugin-scope .wc-seo-serm-inline-input:focus,
.wc-seo-plugin-scope .wc-seo-serm-inline-url input:focus,
body .wc-seo-plugin-scope .wc-seo-serm-inline-input:focus,
body .wc-seo-plugin-scope .wc-seo-serm-inline-url input:focus {
  outline: none !important;
  border-color: var(--seo-primary) !important;
  box-shadow: 0 0 0 3px var(--seo-focus-ring) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-inline-url .wc-seo-btn,
body .wc-seo-plugin-scope .wc-seo-serm-inline-url .wc-seo-btn {
  padding: var(--seo-space-2) var(--seo-space-4) !important;
  min-height: 36px !important;
}

/* ===== SERM Topbar ===== */
.wc-seo-plugin-scope .wc-seo-serm-topbar,
body .wc-seo-plugin-scope .wc-seo-serm-topbar {
  width: 100% !important;
  margin: 0 0 var(--seo-space-4) 0 !important;
  background: linear-gradient(135deg, rgba(247, 169, 132, 0.12), rgba(255, 255, 255, 0.8)) !important;
  border: 1px solid var(--seo-border-light) !important;
  border-radius: var(--seo-radius-lg) !important;
  box-shadow: var(--seo-shadow-sm) !important;
  box-sizing: border-box !important;
  padding: var(--seo-space-5) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__container,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--seo-space-4) !important;
  align-items: flex-start !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__copy,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__copy {
  flex: 1 1 300px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--seo-space-2) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__eyebrow,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__eyebrow {
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-size: var(--seo-font-size-xs) !important;
  font-weight: var(--seo-font-weight-semibold) !important;
  color: var(--seo-primary-dark) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__title,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__title {
  margin: 0 !important;
  font-size: var(--seo-font-size-xl) !important;
  font-weight: var(--seo-font-weight-semibold) !important;
  color: var(--seo-ink) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__desc,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__desc {
  margin: 0 !important;
  font-size: var(--seo-font-size-sm) !important;
  color: var(--seo-muted) !important;
  max-width: 520px !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__form,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__form {
  flex: 1 1 360px !important;
  background: #fff !important;
  border-radius: var(--seo-radius-md) !important;
  padding: var(--seo-space-4) !important;
  border: 1px solid var(--seo-border) !important;
  box-shadow: var(--seo-shadow-xs) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--seo-space-2) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__fields,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__fields {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--seo-space-2) !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__input,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__input {
  display: flex !important;
  gap: var(--seo-space-2) !important;
  align-items: center !important;
}

.wc-seo-plugin-scope .wc-seo-serm-topbar__current,
body .wc-seo-plugin-scope .wc-seo-serm-topbar__current {
  margin: 0 !important;
  font-size: var(--seo-font-size-xs) !important;
  color: var(--seo-muted-light) !important;
}

/* ===== Help Tooltip ===== */
.wc-seo-plugin-scope .wc-seo-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--seo-primary-subtle);
  color: var(--seo-primary);
  font-size: var(--seo-font-size-xs);
  font-weight: var(--seo-font-weight-bold);
  line-height: 1;
  cursor: help;
  margin-left: var(--seo-space-2);
  transition: all var(--seo-transition-base);
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--seo-primary);
}

.wc-seo-plugin-scope .wc-seo-help:hover,
.wc-seo-plugin-scope .wc-seo-help:focus {
  background: var(--seo-primary);
  color: var(--seo-text-on-primary);
  transform: scale(1.1);
  outline: none;
}

.wc-seo-plugin-scope .wc-seo-help::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: center;
  transition: background-image var(--seo-transition-base);
}

/* При hover обычной иконки тоже меняем цвет на белый */
.wc-seo-plugin-scope .wc-seo-help:hover::before,
.wc-seo-plugin-scope .wc-seo-help:focus::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

/* Иконка настроек/шестеренки для чувствительности */
.wc-seo-plugin-scope .wc-seo-help--sensitivity::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7A984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 1v6m0 6v6M5.64 5.64l4.24 4.24m4.24 4.24l4.24 4.24M1 12h6m6 0h6M5.64 18.36l4.24-4.24m4.24-4.24l4.24-4.24'/%3E%3C/svg%3E");
  background-size: 14px 14px;
}

/* При hover иконка должна оставаться видимой - меняем цвет на белый */
.wc-seo-plugin-scope .wc-seo-help--sensitivity:hover::before,
.wc-seo-plugin-scope .wc-seo-help--sensitivity:focus::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 1v6m0 6v6M5.64 5.64l4.24 4.24m4.24 4.24l4.24 4.24M1 12h6m6 0h6M5.64 18.36l4.24-4.24m4.24-4.24l4.24-4.24'/%3E%3C/svg%3E");
}

/* CSS Tooltip для wc-seo-help */
.wc-seo-plugin-scope .wc-seo-help::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + var(--seo-space-2) + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--seo-bg);
  color: var(--seo-ink);
  padding: var(--seo-space-2) var(--seo-space-3);
  border-radius: var(--seo-radius-sm);
  border: 1px solid var(--seo-border);
  box-shadow: var(--seo-shadow-md);
  font-size: var(--seo-font-size-xs);
  font-weight: var(--seo-font-weight-normal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--seo-transition-base), transform var(--seo-transition-base);
  z-index: calc(var(--seo-z-tooltip) + 10);
  max-width: 280px;
  min-width: 200px;
  white-space: normal;
  text-align: left;
  line-height: var(--seo-line-height-normal);
  word-wrap: break-word;
}

.wc-seo-plugin-scope .wc-seo-help:hover::after,
.wc-seo-plugin-scope .wc-seo-help:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Стрелка tooltip (псевдоэлемент для стрелки) */
.wc-seo-plugin-scope .wc-seo-help:hover::before,
.wc-seo-plugin-scope .wc-seo-help:focus::before {
  z-index: calc(var(--seo-z-tooltip) + 11);
}

/* Убираем нативный tooltip браузера - удаляем title через JS, но на всякий случай */
.wc-seo-plugin-scope .wc-seo-help[data-tooltip] {
  position: relative;
}

/* Убираем нативный title при наличии data-tooltip */
.wc-seo-plugin-scope .wc-seo-help[data-tooltip][title] {
  cursor: help;
}

/* ===== Ghost URL Chips ===== */
.wc-seo-plugin-scope .wc-seo-ghost-chips,
body .wc-seo-plugin-scope .wc-seo-ghost-chips,
.woocommerce .wc-seo-plugin-scope .wc-seo-ghost-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--seo-space-1) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: auto !important;
  padding: var(--seo-space-1) 0 !important;
}

.wc-seo-plugin-scope .wc-seo-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--seo-space-2);
  background: var(--seo-bg-secondary);
  border: 1px solid var(--seo-border);
  border-radius: var(--seo-radius-full);
  padding: var(--seo-space-2) var(--seo-space-3);
  font-size: var(--seo-font-size-sm);
  color: var(--seo-ink);
  transition: all var(--seo-transition-base);
  animation: wcSeoChipIn var(--seo-transition-bounce);
  position: relative;
}

@keyframes wcSeoChipIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wc-seo-plugin-scope .wc-seo-chip:hover {
  background: var(--seo-hover);
  border-color: var(--seo-primary);
  transform: translateY(-1px);
  box-shadow: var(--seo-shadow-xs);
}

.wc-seo-plugin-scope .wc-seo-chip-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--seo-muted);
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--seo-transition-fast);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.wc-seo-plugin-scope .wc-seo-chip-remove:hover {
  background: var(--seo-error-light);
  color: var(--seo-error);
  transform: scale(1.1);
}

.wc-seo-plugin-scope .wc-seo-chip-remove:focus {
  outline: 2px solid var(--seo-focus);
  outline-offset: 2px;
}

.wc-seo-plugin-scope .wc-seo-ghost-hint,
body .wc-seo-plugin-scope .wc-seo-ghost-hint,
.woocommerce .wc-seo-plugin-scope .wc-seo-ghost-hint {
  margin-top: var(--seo-space-1) !important;
  margin-bottom: 0 !important;
  font-size: var(--seo-font-size-sm);
  color: var(--seo-muted);
  padding: var(--seo-space-1) var(--seo-space-2) !important;
  background: var(--seo-bg-secondary);
  border-left: 3px solid var(--seo-info);
  border-radius: var(--seo-radius-sm);
  animation: wcSeoHintIn var(--seo-transition-base);
}

.wc-seo-plugin-scope .wc-seo-ghost-hint.wc-seo-ghost-hint--error {
  border-left-color: var(--seo-error);
  background: var(--seo-error-light);
  color: var(--seo-error-dark);
}

.wc-seo-plugin-scope .wc-seo-ghost-hint.wc-seo-ghost-hint--success {
  border-left-color: var(--seo-success);
  background: var(--seo-success-light);
  color: var(--seo-success-dark);
}

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

/* ===== Ghost Product Cards ===== */
.wc-seo-plugin-scope .products .product.wc-seo-ghost {
  opacity: 0.95;
  border: 2px dashed var(--seo-border);
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  border-radius: var(--seo-radius-lg);
  min-height: 180px;
  transition: all var(--seo-transition-base);
  position: relative;
  overflow: hidden;
  animation: wcSeoGhostIn var(--seo-transition-slow);
}

@keyframes wcSeoGhostIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 0.95;
    transform: translateY(0);
  }
}

.wc-seo-plugin-scope .products .product.wc-seo-ghost::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--seo-primary-gradient);
  opacity: 0.6;
}

.wc-seo-plugin-scope .woocommerce .products .product.wc-seo-ghost {
  border: 2px dashed var(--seo-border) !important;
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%) !important;
}

.wc-seo-plugin-scope .wc-seo-ghost-card {
  padding: var(--seo-space-5);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--seo-space-3);
}

.wc-seo-plugin-scope .wc-seo-ghost-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--seo-space-1);
  background: var(--seo-primary-gradient);
  color: var(--seo-text-on-primary);
  font-size: var(--seo-font-size-xs);
  font-weight: var(--seo-font-weight-semibold);
  padding: var(--seo-space-1) var(--seo-space-3);
  border-radius: var(--seo-radius-full);
  margin-bottom: var(--seo-space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--seo-shadow-xs);
}

.wc-seo-plugin-scope .wc-seo-ghost-title {
  font-weight: var(--seo-font-weight-semibold);
  color: var(--seo-ink);
  font-size: var(--seo-font-size-md);
  margin: 0;
  word-break: break-word;
}

.wc-seo-plugin-scope .wc-seo-ghost-metrics {
  color: var(--seo-muted);
  font-size: var(--seo-font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--seo-space-2);
  flex-wrap: wrap;
}

.wc-seo-plugin-scope .wc-seo-ghost-metrics strong {
  color: var(--seo-primary-dark);
  font-weight: var(--seo-font-weight-semibold);
  background: var(--seo-primary-subtle);
  padding: var(--seo-space-1) var(--seo-space-2);
  border-radius: var(--seo-radius-sm);
}

/* Progress indicator for probability */
.wc-seo-plugin-scope .wc-seo-ghost-progress {
  width: 100%;
  height: 4px;
  background: var(--seo-bg-tertiary);
  border-radius: var(--seo-radius-full);
  overflow: hidden;
  margin-top: var(--seo-space-2);
}

.wc-seo-plugin-scope .wc-seo-ghost-progress-bar {
  height: 100%;
  background: var(--seo-primary-gradient);
  border-radius: var(--seo-radius-full);
  transition: width var(--seo-transition-slow);
  box-shadow: 0 0 8px rgba(247, 169, 132, 0.4);
}

/* No-data marker */
.wc-seo-plugin-scope .wc-seo-ghost-nodata {
  color: var(--seo-error-dark);
  font-weight: var(--seo-font-weight-semibold);
  display: inline-flex;
  align-items: center;
  gap: var(--seo-space-1);
  padding: var(--seo-space-1) var(--seo-space-2);
  background: var(--seo-error-light);
  border-radius: var(--seo-radius-sm);
}

/* ===== Input Error Messages ===== */
.wc-seo-plugin-scope .wc-seo-input-error {
  display: block;
  margin-top: var(--seo-space-1);
  font-size: var(--seo-font-size-sm);
  color: var(--seo-error-dark);
  background: var(--seo-error-light);
  padding: var(--seo-space-2) var(--seo-space-3);
  border-radius: var(--seo-radius-sm);
  border-left: 3px solid var(--seo-error);
  animation: wcSeoHintIn var(--seo-transition-base);
}

/* Screen reader only text */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== Skeleton Loading States ===== */
.wc-seo-plugin-scope .wc-seo-skeleton {
  background: linear-gradient(90deg, var(--seo-bg-secondary) 25%, var(--seo-bg-tertiary) 50%, var(--seo-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: wcSeoSkeleton 1.5s ease-in-out infinite;
  border-radius: var(--seo-radius-sm);
}

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

.wc-seo-plugin-scope .wc-seo-skeleton-text {
  height: 16px;
  margin: var(--seo-space-2) 0;
}

.wc-seo-plugin-scope .wc-seo-skeleton-text--short {
  width: 60%;
}

.wc-seo-plugin-scope .wc-seo-skeleton-text--long {
  width: 100%;
}

/* ===== Additional Protection from Theme Conflicts (Kitchor, Elementor) ===== */
/* Защита от Elementor - используем селективный reset вместо all:unset */
.elementor-page .wc-seo-plugin-scope .wc-seo-serm-controls,
.elementor-page .wc-seo-plugin-scope .wc-seo-serm-form {
  /* Селективный reset только критичных свойств */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  text-align: left !important;
  direction: ltr !important;
}

/* Переопределяем после reset */
.elementor-page .wc-seo-plugin-scope .wc-seo-serm-controls {
  display: block !important;
  margin: var(--seo-space-6) 0 !important;
  padding: var(--seo-space-6) !important;
  border: 1px solid var(--seo-border) !important;
  background: linear-gradient(180deg, #fbfbfb 0%, #f5f7fb 100%) !important;
  border-radius: var(--seo-radius-lg) !important;
  box-shadow: var(--seo-shadow-md) !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.elementor-page .wc-seo-plugin-scope .wc-seo-serm-form {
  display: flex !important;
  gap: var(--seo-space-3) !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.elementor-page .wc-seo-plugin-scope .wc-seo-btn {
  /* Селективный reset для кнопок */
  margin: 0 !important;
  padding: var(--seo-space-3) var(--seo-space-5) !important;
  border: 1px solid var(--seo-primary) !important;
  border-radius: var(--seo-radius-md) !important;
  background: var(--seo-primary-gradient) !important;
  color: var(--seo-text-on-primary) !important;
  font-weight: var(--seo-font-weight-semibold) !important;
  font-size: var(--seo-font-size-base) !important;
  font-family: inherit !important;
  text-decoration: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
  transition: background var(--seo-transition-base), border-color var(--seo-transition-base), box-shadow var(--seo-transition-base), transform var(--seo-transition-base) !important;
}

.elementor-page .wc-seo-plugin-scope .wc-seo-btn:hover {
  background: var(--seo-primary-hover) !important;
  border-color: var(--seo-primary-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--seo-shadow-md) !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
}

/* Защита от Kitchor theme */
.kitchor .wc-seo-plugin-scope .wc-seo-serm-controls,
.kitchor .wc-seo-plugin-scope .wc-seo-serm-form,
body.kitchor .wc-seo-plugin-scope .wc-seo-serm-controls,
body.kitchor .wc-seo-plugin-scope .wc-seo-serm-form {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Защита от общих переопределений тем */
body .wc-seo-plugin-scope .wc-seo-serm-controls *,
body .wc-seo-plugin-scope .wc-seo-serm-form * {
  box-sizing: border-box !important;
}

/* Предотвращение скрытия элементов - Maximum Protection */
body .wc-seo-plugin-scope .wc-seo-serm-controls,
body .wc-seo-plugin-scope .wc-seo-serm-form,
body .wc-seo-plugin-scope .wc-seo-btn,
body .wc-seo-plugin-scope .wc-seo-group,
body .wc-seo-plugin-scope .wc-seo-serm-form input,
body .wc-seo-plugin-scope .wc-seo-serm-form select,
body .wc-seo-plugin-scope .wc-seo-serm-form label,
body .wc-seo-plugin-scope .wc-seo-serm-form button {
  visibility: visible !important;
  opacity: 1 !important;
}

body .wc-seo-plugin-scope .wc-seo-serm-controls {
  display: block !important;
}

body .wc-seo-plugin-scope .wc-seo-serm-form {
  display: flex !important;
}

body .wc-seo-plugin-scope .wc-seo-btn {
  display: inline-flex !important;
}

body .wc-seo-plugin-scope .wc-seo-group {
  display: flex !important;
}

body .wc-seo-plugin-scope .wc-seo-serm-form input,
body .wc-seo-plugin-scope .wc-seo-serm-form select {
  display: inline-block !important;
}

body .wc-seo-plugin-scope .wc-seo-serm-form label {
  display: inline-block !important;
}

body .wc-seo-plugin-scope .wc-seo-serm-form button {
  display: inline-flex !important;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .wc-seo-plugin-scope .wc-seo-serm-form,
  body .wc-seo-plugin-scope .wc-seo-serm-form,
  .woocommerce .wc-seo-plugin-scope .wc-seo-serm-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--seo-space-4) !important;
  }
  
  .wc-seo-plugin-scope .wc-seo-group,
  body .wc-seo-plugin-scope .wc-seo-group,
  .woocommerce .wc-seo-plugin-scope .wc-seo-group {
    width: 100% !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--seo-space-2) !important;
  }
  
  .wc-seo-plugin-scope .wc-seo-serm-form input[type="text"],
  .wc-seo-plugin-scope .wc-seo-serm-form input[type="url"],
  .wc-seo-plugin-scope .wc-seo-serm-form input[type="number"],
  .wc-seo-plugin-scope .wc-seo-serm-form select,
  body .wc-seo-plugin-scope .wc-seo-serm-form input[type="text"],
  body .wc-seo-plugin-scope .wc-seo-serm-form input[type="url"],
  body .wc-seo-plugin-scope .wc-seo-serm-form input[type="number"],
  body .wc-seo-plugin-scope .wc-seo-serm-form select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  .wc-seo-plugin-scope .wc-seo-serm-inline-url,
  .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper,
  body .wc-seo-plugin-scope .wc-seo-serm-inline-url,
  body .wc-seo-plugin-scope .wc-seo-serm-inline-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--seo-space-2) !important;
    width: 100% !important;
    margin: 0 0 var(--seo-space-4) 0 !important;
  }
  
  .wc-seo-plugin-scope .wc-seo-serm-inline-input,
  .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="text"],
  .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="url"],
  body .wc-seo-plugin-scope .wc-seo-serm-inline-input,
  body .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="text"],
  body .wc-seo-plugin-scope .wc-seo-serm-inline-url input[type="url"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  .wc-seo-plugin-scope .wc-seo-btn,
  body .wc-seo-plugin-scope .wc-seo-btn,
  .woocommerce .wc-seo-plugin-scope .wc-seo-btn {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .wc-seo-plugin-scope .wc-seo-serm-topbar__container,
  body .wc-seo-plugin-scope .wc-seo-serm-topbar__container {
    flex-direction: column !important;
  }

  .wc-seo-plugin-scope .wc-seo-serm-topbar__input,
  body .wc-seo-plugin-scope .wc-seo-serm-topbar__input {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .wc-seo-plugin-scope .wc-seo-serm-topbar__form,
  body .wc-seo-plugin-scope .wc-seo-serm-topbar__form {
    flex: 1 1 auto !important;
  }
  
  .wc-seo-plugin-scope .woocommerce-seo-tab {
    padding: var(--seo-space-4) !important;
  }
  
  .wc-seo-plugin-scope .woocommerce .wc-seo-shop-table th,
  .wc-seo-plugin-scope .woocommerce .wc-seo-shop-table td {
    padding: var(--seo-space-3) var(--seo-space-4) !important;
    font-size: var(--seo-font-size-sm) !important;
  }
}

@media (max-width: 480px) {
  .wc-seo-plugin-scope .wc-seo-inline-metrics {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .wc-seo-plugin-scope .wc-seo-inline-metrics > span {
    width: 100%;
  }
}

/* ===== Print Styles ===== */
@media print {
  .wc-seo-plugin-scope .wc-seo-serm-controls,
  .wc-seo-plugin-scope .wc-seo-serm-inline-url,
  .wc-seo-plugin-scope .wc-seo-btn {
    display: none;
  }
  
  .wc-seo-plugin-scope .woocommerce-seo-tab {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
  .wc-seo-plugin-scope .woocommerce-seo-tab {
    border-width: 2px;
  }
  
  .wc-seo-plugin-scope .wc-seo-btn {
    border-width: 2px;
  }
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
  .wc-seo-plugin-scope *,
  .wc-seo-plugin-scope *::before,
  .wc-seo-plugin-scope *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
