/* ============================================
   Минималистичный современный дизайн
   ============================================ */
:root {
  --primary: #1a7f5e;
  --primary-hover: #155d44;
  --text: #1a1a1a;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --bg: #ffffff;
  --bg-light: #fafafa;
  --bg-hover: #f5f5f5;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: #f5f5f5;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ============================================
   Навигация
   ============================================ */
.navbar {
  background: var(--bg) !important;
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.site-title {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.navbar-logo-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.navbar-logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
  max-width: 80px;
  transition: var(--transition);
}

.navbar-text-img {
  height: 30px;
  width: auto;
  object-fit: contain;
  max-width: 150px;
  transition: var(--transition);
}

.navbar-logo-img:hover,
.navbar-text-img:hover {
  opacity: 0.8;
}

.navbar-nav {
  gap: 0.25rem;
}

.navbar-nav .nav-link {
  color: var(--text-light) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary) !important;
  background: var(--bg-hover);
}

#cart-count {
  font-size: 0.6875rem;
  padding: 2px 6px;
  background: var(--primary);
  border: 2px solid var(--bg);
}

/* ============================================
   Кнопки
   ============================================ */
.btn {
  border-radius: var(--radius);
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-outline-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
}

.btn-outline-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  color: white;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
  position: relative;
  background-image: url('/kartinki/fon.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 5rem 0;
  border-bottom: 1px solid var(--border-light);
  min-height: 500px;
  display: flex;
  align-items: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2rem;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hero-section .lead {
  font-size: 1.125rem;
  color: var(--text-light);
  font-weight: 400;
  margin-bottom: 2rem;
}

/* ============================================
   Карточки
   ============================================ */
.category-card,
.catalog-card,
.product-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.catalog-card {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.catalog-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(3px);
  transform: scale(1.1);
  z-index: 0;
  transition: var(--transition);
}

.catalog-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
  transition: var(--transition);
}

.catalog-card-link {
  position: relative;
  z-index: 2;
  text-decoration: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.category-card:hover,
.catalog-card:hover,
.product-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.catalog-card:hover .catalog-card-overlay {
  background: rgba(0, 0, 0, 0.4);
}

.catalog-card:hover .catalog-card-bg {
  filter: blur(2px);
  transform: scale(1.05);
}

.category-image,
.product-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: var(--transition);
}

.category-card:hover .category-image,
.product-card:hover .product-image {
  transform: scale(1.02);
}

.category-title,
.catalog-title {
  padding: 1.25rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.catalog-title {
  color: #ffffff;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  padding: 0;
  letter-spacing: 0.5px;
}

.product-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-info h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.5rem 0 1rem 0;
}

.product-card .btn {
  width: 100%;
  margin-top: auto;
}

/* ============================================
   Placeholder
   ============================================ */
.product-image-placeholder {
  width: 100%;
  height: 240px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.3;
}

.placeholder-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-lighter);
}

/* ============================================
   Корзина
   ============================================ */
.cart-item {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.cart-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.cart-summary {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 100px;
}

.cart-summary h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.cart-summary hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1rem 0;
}

/* ============================================
   Формы
   ============================================ */
.form-control {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 127, 94, 0.1);
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ============================================
   Карточки форм
   ============================================ */
.card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: none;
}

.card-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.card-body {
  padding: 1.5rem;
}

/* ============================================
   Изображение категории
   ============================================ */
.category-header-image {
  max-height: 400px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.category-header-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   Hero секция категории
   ============================================ */
.category-hero-section {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  margin-bottom: 3rem;
  width: 100%;
  overflow: hidden;
}

.category-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(2px);
  transform: scale(1.05);
  z-index: 0;
}

.category-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 1;
}

.category-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2rem 1rem 3rem 1rem;
}

.category-hero-text {
  margin-top: 1.5rem;
}

.category-hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.category-hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  margin-top: 0.75rem;
  margin-bottom: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.btn-back {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 1);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-hero-image-wrapper {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  max-width: 600px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.category-hero-image {
  width: 100%;
  height: auto;
  max-height: 90%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* ============================================
   Алерты
   ============================================ */
.alert {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
}

.alert-info {
  background: #eff6ff;
  border-color: #dbeafe;
  color: #1e40af;
}

/* ============================================
   Подкатегории
   ============================================ */
.subcategory-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
}

.subcategory-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.subcategory-content {
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.subcategory-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.subcategory-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.subcategory-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
}

.badge-text {
  color: var(--text);
}

/* ============================================
   Утилиты
   ============================================ */
.text-gradient {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-muted {
  color: var(--text-light);
}

/* ============================================
   Футер
   ============================================ */
footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
  margin-top: 4rem;
}

footer p {
  color: var(--text-light);
  font-size: 0.875rem;
  margin: 0;
}

/* ============================================
   Контакты
   ============================================ */
.contact-info {
  border-left: 3px solid var(--primary);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
}

.contact-info a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.contact-info a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ============================================
   Анимации
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 1rem;
    min-height: 400px;
  }

  .hero-overlay {
    background: rgba(255, 255, 255, 0.4);
  }

  .hero-title {
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    margin-bottom: 1.5rem;
  }

  .category-hero-section {
    min-height: 300px;
  }

  .category-hero-content {
    padding: 1.5rem 0 2rem 0;
  }

  .category-hero-text {
    margin-top: 1rem;
  }

  .category-hero-image-wrapper {
    width: 45%;
    max-width: 400px;
  }

  .category-image,
  .product-image,
  .product-image-placeholder {
    height: 200px;
  }

  .catalog-card {
    min-height: 220px;
  }

  .cart-summary {
    position: static;
    margin-top: 1.5rem;
  }

  .subcategory-content {
    padding: 1.5rem 1rem;
    min-height: 120px;
  }

  .subcategory-icon {
    font-size: 2rem;
  }

  .navbar-logo-right {
    margin-top: 1rem;
    justify-content: center;
  }

  .navbar-logo-img {
    height: 40px;
    max-width: 60px;
  }

  .navbar-text-img {
    height: 25px;
    max-width: 120px;
  }
}

@media (max-width: 576px) {
  .navbar {
    padding: 0.75rem 0;
  }

  .site-title {
    font-size: 1rem;
  }

  .logo-img {
    width: 32px;
    height: 32px;
  }

  .product-info {
    padding: 1rem;
  }

  .cart-item {
    padding: 1rem;
  }

  .hero-section {
    padding: 2.5rem 1rem;
    min-height: 350px;
  }

  .category-hero-section {
    min-height: 250px;
  }

  .category-hero-content {
    padding: 1.25rem 0 1.75rem 0;
  }

  .btn-back {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .hero-overlay {
    background: rgba(255, 255, 255, 0.5);
  }

  .hero-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: clamp(0.9375rem, 3vw, 1.125rem);
    margin-bottom: 1.25rem;
  }

  .category-hero-section {
    min-height: 250px;
  }

  .category-hero-content {
    padding: 1.25rem 0 1.75rem 0;
  }

  .btn-back {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .category-hero-image-wrapper {
    width: 40%;
    max-width: 300px;
  }

  .catalog-card {
    min-height: 200px;
  }

  .catalog-title {
    font-size: 1.125rem;
  }

  .navbar-logo-img {
    height: 35px;
    max-width: 50px;
  }

  .navbar-text-img {
    height: 20px;
    max-width: 100px;
  }
}

/* ============================================
   Улучшения производительности
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Изображения
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}
