:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fb;
  --color-elev: #ffffff;
  --color-border: #e1e4e8;
  --color-text: #2c3e50;
  --color-text-dim: #546e7a;
  --color-accent: #2196f3;
  --color-accent-rgb: 33, 150, 243;
  --color-accent-hover: #1976d2;
  --color-accent-contrast: #ffffff;
  --color-secondary: #ff9800;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --blur: saturate(180%) blur(8px);
  --radius: 12px;
  --radius-lg: 16px;
  --container-width: 1200px;
  --space-1: 6px; --space-2: 10px; --space-3: 14px; --space-4: 18px; --space-5: 24px; --space-6: 32px; --space-7: 44px; --space-8: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background-color: var(--color-bg);
  color: var(--color-text);
  letter-spacing: 0.2px;
  line-height: 1.6;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-elev);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; height: 72px; gap: var(--space-4); }
.logo { font-weight: 800; font-size: 24px; text-decoration: none; color: var(--color-accent); letter-spacing: .4px; }
.spacer { flex: 1; }
.phone { margin-right: 12px; color: var(--color-text); text-decoration: none; opacity: .9; }
.cart { color: var(--color-text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: var(--shadow-sm); position: relative; transition: all 0.2s ease; }
.cart:hover { background: var(--color-elev); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.nav { display: inline-flex; gap: 16px; }
.nav a { color: var(--color-text-dim); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 700; font-size: 16px; }
.nav a:hover { color: var(--color-accent); background: var(--color-surface); }

.contacts { display:flex; align-items:center; gap: 12px; color: var(--color-text-dim); }
.contacts a { color: var(--color-text); transition: color .2s ease; font-size: 17px; font-weight: 700; }
.contacts a:hover { color: var(--color-accent); }
.btn-ghost { background: var(--color-surface); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-accent); color: var(--color-accent-contrast); border-color: var(--color-accent); }

/* Кнопка обратного звонка в хедере */
.btn[data-open-contact] {
  position: relative;
}

.btn[data-open-contact]::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  background: var(--color-accent);
  opacity: 0;
  animation: pulse-ring 2s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}
.badge { display:inline-flex; align-items:center; justify-content:center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-contrast); font-size: 12px; font-weight: 700; }

.site-main { padding: var(--space-7) 0; }

.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); margin-top: var(--space-8); }
.site-footer .container { padding: var(--space-6) 20px; color: var(--color-text-dim); }

.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); color: white; overflow: hidden; position: relative; min-height: 600px; display: flex; align-items: center; }
.hero::before { content: ''; position: absolute; inset: 0; background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect fill="white" fill-opacity="0.03" width="50" height="50"/></svg>'); opacity: .3; }
.hero-inner { padding: var(--space-8) var(--space-6); text-align: center; position: relative; z-index: 1; width: 100%; }
.hero-inner h1 { font-size: 52px; line-height: 1.2; margin: 0 0 var(--space-4); letter-spacing: .3px; font-weight: 800; }
.hero-inner p { font-size: 22px; opacity: .95; margin: 0 0 var(--space-6); }
.hero .actions { display:flex; gap: 16px; justify-content:center; flex-wrap: wrap; }

.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; text-decoration: none; border: 1px solid var(--color-border); background: var(--color-elev); color: var(--color-text); transition: all .2s ease; box-shadow: var(--shadow-sm); font-weight: 600; cursor: pointer; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-contrast); border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn-white { background: white; color: var(--color-accent); border-color: white; }
.btn-white:hover { background: rgba(255,255,255,.9); }

.section { margin-top: var(--space-7); }
.section-title { font-size: 38px; font-weight: 700; margin-bottom: var(--space-5); text-align: center; color: var(--color-text); }
.section-subtitle { font-size: 20px; color: var(--color-text-dim); text-align: center; margin-bottom: var(--space-6); max-width: 700px; margin-left: auto; margin-right: auto; }
.card { font-size: 16px; }
.card h3 { font-size: 20px; }
.card p { font-size: 16px; }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-elev); box-shadow: var(--shadow-sm); text-align: left; transition: all .2s ease; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.price { font-size: 22px; font-weight: 700; color: var(--color-accent); }
table { width: 100%; }
th, td { color: var(--color-text); }
thead th { color: var(--color-text-dim); }

input, textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-elev); color: var(--color-text); font-size: 15px; transition: border-color .2s ease; }
input:focus, textarea:focus { outline: none; border-color: var(--color-accent); }
label { display: block; margin-bottom: 6px; color: var(--color-text); font-weight: 500; }

/* Floating buttons */
.floating { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.floating .btn { padding: 12px 14px; }
.circle-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--color-elev); color: var(--color-text); border: 1px solid var(--color-border); box-shadow: var(--shadow-md); font-size: 18px; transition: all .2s ease; }
.circle-btn:hover { background: var(--color-accent); color: white; border-color: var(--color-accent); }
.circle-btn .icon { width: 18px; height: 18px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display:none; align-items:center; justify-content:center; z-index: 70; padding: 20px; animation: fadeIn 0.2s ease; }
.modal-backdrop[style*="display: flex"] { display:flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleUp { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

#consultation-success {
  animation: scaleUp 0.4s ease;
}

.modal { 
  width: 100%; 
  max-width: 520px; 
  background: var(--color-elev); 
  border-radius: 20px; 
  box-shadow: 0 20px 60px rgba(0,0,0,.3); 
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-dim);
  transition: all 0.2s ease;
  z-index: 1;
}

.modal-close:hover {
  background: var(--color-accent);
  color: white;
  transform: rotate(90deg);
}

.modal-header {
  text-align: center;
  padding: 40px 30px 24px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.modal .content { 
  padding: 0 30px 30px; 
}

.contact-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  transition: all 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-footer {
  margin-top: 24px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-large:hover svg {
  transform: translateX(4px);
}

.btn-large svg {
  transition: transform 0.2s ease;
}

.category-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: var(--space-5); background: linear-gradient(135deg, var(--color-surface) 0%, #fff 100%); border-radius: var(--radius); border: 1px solid var(--color-border); transition: all .3s ease; cursor: pointer; }
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--color-accent); }
.category-icon { width: 64px; height: 64px; background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: white; }
.category-name { font-size: 18px; font-weight: 600; color: var(--color-text); }

.advantage-card { text-align: center; padding: var(--space-5); }
.advantage-icon { width: 72px; height: 72px; margin: 0 auto var(--space-3); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; color: white; }
.advantage-title { font-size: 20px; font-weight: 700; margin-bottom: var(--space-2); color: var(--color-text); }
.advantage-text { color: var(--color-text-dim); font-size: 15px; }

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-on-scroll {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fade {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.animate-scale {
  opacity: 0;
  animation: scaleIn 0.6s ease forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding: var(--space-7) var(--space-4); }
  .hero-inner h1 { font-size: 36px; }
}
/* Burger Menu */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.burger-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-text);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.burger-btn.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
  opacity: 0;
}

.burger-btn.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding: var(--space-7) var(--space-4); }
  .hero-inner h1 { font-size: 36px; }
}

@media (max-width: 768px) {
  .burger-btn { display: flex; }
  
  .logo-subtitle { display: none; }
  
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: var(--color-elev);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: height 0.3s ease;
    flex-direction: column;
    gap: 0;
    z-index: 90;
  }
  
  .nav.active {
    height: auto;
    padding: 20px 0;
  }
  
  .nav a {
    padding: 14px 20px;
    border-radius: 0;
    border-bottom: 1px solid var(--color-border);
  }
  
  .nav a:last-child {
    border-bottom: none;
  }
}

@media (max-width: 900px) {
  .header-inner { height: auto; padding: 12px 0; }
  .contacts a:not(.btn) { font-size: 15px; }
  .logo img { height: 36px !important; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .header-inner { height: 64px; flex-wrap: wrap; padding: 10px 0; gap: 8px; }
  .header-inner .logo { order: 1; flex-shrink: 0; }
  .logo img { height: 32px !important; }
  .header-inner .contacts { order: 2; gap: 6px; }
  .contacts a:not(.btn) { display: none; }
  .contacts .btn { padding: 8px 10px !important; }
  .contacts svg { width: 18px; height: 18px; }
  .header-inner .spacer { display: none !important; }
  
  .site-footer .container > div { grid-template-columns: 1fr !important; gap: 24px !important; }
  
  .header-inner .btn[data-open-contact] { 
    order: 3; 
    margin-left: auto; 
    margin-right: 8px;
    padding: 8px 10px !important;
    min-width: auto;
  }
  .header-inner .btn[data-open-contact] span { display: none; }
  .header-inner .btn[data-open-contact] svg { width: 18px; height: 18px; }
  
  .header-inner .cart { 
    order: 4; 
    padding: 8px 10px !important;
    min-width: auto;
  }
  .cart svg { width: 18px; height: 18px; }
  
  .hero .actions { 
    flex-direction: column;
    align-items: center;
  }
  .hero .actions .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
  
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero { min-height: 500px; }
  .hero-inner h1 { font-size: 32px; }
  .hero-inner p { font-size: 18px; }
  .section-title { font-size: 30px; }
  .section-subtitle { font-size: 18px; }
  
  form[action="/catalog/"] {
    flex: 1 1 auto !important;
    order: 5;
    width: 100%;
    margin-top: 10px;
  }
}

/* ===================== ПРЕМИАЛЬНЫЕ АНИМАЦИИ ===================== */

/* Keyframes для анимаций появления */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Базовые стили для элементов с анимацией */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: none;
}

.animate-on-scroll.scale-in {
  transform: scale(0.9);
}

.animate-on-scroll.slide-in-left {
  transform: translateX(-60px);
}

.animate-on-scroll.slide-in-right {
  transform: translateX(60px);
}

.animate-on-scroll.animated {
  animation-duration: 0.8s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

.fade-in-up {
  animation-name: fadeInUp;
}

.fade-in {
  animation-name: fadeIn;
}

.slide-in-left {
  animation-name: slideInLeft;
}

.slide-in-right {
  animation-name: slideInRight;
}

.scale-in {
  animation-name: scaleIn;
}

/* Задержки для каскадной анимации */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Улучшенные переходы для карточек */
.card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card:hover::before {
  left: 100%;
}

/* Улучшенные кнопки */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(33, 150, 243, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(33, 150, 243, 0.2);
}

/* Плавные переходы для ссылок */
a {
  transition: all 0.3s ease;
}

/* Плавное появление изображений */
img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.card img:hover {
  transform: scale(1.05);
}

/* Эффект свечения для акцентных элементов */
.btn-primary {
  box-shadow: 0 4px 14px 0 rgba(33, 150, 243, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px 0 rgba(33, 150, 243, 0.4);
  transform: translateY(-3px);
}

/* Анимация для иконок */
svg {
  transition: transform 0.3s ease;
}

.btn:hover svg {
  transform: translateX(4px);
}

/* Плавное появление модального окна */
#contact-modal {
  animation: fadeIn 0.3s ease-out;
}

#contact-modal .modal-content {
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Пульсирующий эффект для важных элементов */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Градиентная анимация для CTA блоков */
.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

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

/* Плавность для всех интерактивных элементов */
button, input, textarea, select {
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

/* Эффект ripple для кнопок */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

/* Плавное появление секций */
section {
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Микроанимации для hover эффектов */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

