/*
 * КРИТИЧЕСКИЕ СТИЛИ COFFEERANKS v3.0
 * Дата: 2025-08-25
 * Объединенные критические стили для быстрой загрузки
 */

/* =============================================================================
   МЯГКАЯ ЦВЕТОВАЯ ПАЛИТРА - COFFEERANKS v4.0
   ============================================================================= */
:root {
  /* Основные цвета - мягкие и приятные */
    --primary-brown: #8B6F47;
    --primary-accent: #D2B48C;
    --primary-light: #E8DCC6;
    --primary-soft: #F5E9DA;
  
  /* Поверхности */
  --surface-white: #FBFBFB;
  --surface-elevated: #FFFFFF;
  --surface-overlay: rgba(255, 255, 255, 0.98);
  --surface-card: #F9F8F6;
  
  /* Текст */
  --text-primary: #3A3A3A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-accent: #5D4A37;
  
  /* Границы и тени */
  --border-subtle: #EFEFEF;
  --border-light: #F5F5F5;
  --border-soft: rgba(125, 101, 73, 0.1);
  --shadow-soft: 0 2px 8px rgba(125, 101, 73, 0.06);
  --shadow-medium: 0 4px 16px rgba(125, 101, 73, 0.08);
  --shadow-strong: 0 8px 24px rgba(125, 101, 73, 0.12);
  
  /* Состояния - приглушенные */
  --success: #4ADE80;
  --warning: #FCD34D;
  --error: #F87171;
  --info: #60A5FA;
  
  /* Градиенты - мягкие */
  --gradient-coffee: linear-gradient(135deg, var(--primary-brown) 0%, var(--primary-light) 100%);
  --gradient-surface: linear-gradient(135deg, #FBFBFB 0%, #F5F5F5 100%);
  --gradient-card: linear-gradient(135deg, #FFFFFF 0%, #F9F8F6 100%);


/* =============================================================================
   БАЗОВЫЕ СТИЛИ И ТИПОГРАФИКА
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  background: url('/static/images/coffee-texture.jpg') repeat, var(--primary-soft);
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5em;
}

h1 { font-size: 2.25rem; line-height: 1.2; }
h2 { font-size: 1.875rem; line-height: 1.3; }
h3 { font-size: 1.5rem; line-height: 1.4; }
h4 { font-size: 1.25rem; line-height: 1.4; }
h5 { font-size: 1.125rem; line-height: 1.5; }
h6 { font-size: 1rem; line-height: 1.5; }

/* Основные элементы */
p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}

a {
  color: var(--primary-brown);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-accent);
}

/* =============================================================================
   НАВИГАЦИЯ - COFFEERANKS v4.0 (СОВМЕСТИМОСТЬ С ШАБЛОНОМ)
   ============================================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s ease;
  padding: 12px 24px;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.25rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  filter: brightness(0) saturate(100%) invert(31%) sepia(20%) saturate(1225%) hue-rotate(345deg) brightness(93%) contrast(88%);
}

.brand-text {
  color: var(--primary-brown);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 40px;
}

.navbar-items {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s, background-color 0.3s;
  position: relative;
}

.navbar-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-brown);
}

.navbar-item.active {
  background: var(--primary-brown);
  color: white;
  box-shadow: var(--shadow-medium);
}

.navbar-item i {
  font-size: 16px;
  opacity: 0.8;
}

/* Переключатель темы */
.theme-toggle {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.theme-icon {
  font-size: 16px;
  transition: all 0.2s ease;
}

/* Мобильное меню */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  transition: all 0.2s ease;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: var(--primary-brown);
}

.mobile-menu-toggle:hover span {
  background: white;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Мобильная версия меню */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-overlay);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    padding: 20px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .navbar-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .navbar-items {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .navbar-item {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 16px;
  }
}

/* =============================================================================
   КОНТЕЙНЕРЫ И LAYOUT
   ============================================================================= */
.container,
.container-fluid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  min-height: calc(100vh - 200px);
  padding: 20px 0;
}

/* =============================================================================
   СЕТКА ДЛЯ СТРАНИЦЫ КОФЕ (АДАПТИВНАЯ) v4.0
   ============================================================================= */
.coffee-page-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  width: 100%;
  align-items: start;
}

/* Мобильная адаптация */
@media (max-width: 1024px) {
  .coffee-page-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .filters-section {
    position: static;
    order: 2;
    margin-top: 20px;
  }
  
  .catalog-content {
    order: 1;
  }
}

@media (max-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  
  .coffee-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

/* =============================================================================
   СОВРЕМЕННЫЕ ФИЛЬТРЫ
   ============================================================================= */
.filters-section {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 100px;
  height: fit-content;
}

.filters-section h2 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-brown);
}

.filter-group {
  margin-bottom: 24px;
}

.filter-group h3 {
  font-size: 0.875rem;
  color: var(--primary-brown);
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Современные чипсы фильтров */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-chip {
  background: var(--surface-white);
  border: 1.5px solid var(--border-subtle);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: var(--surface-elevated);
  border-color: var(--primary-brown);
  color: var(--primary-brown);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.filter-chip.active {
  background: var(--primary-brown);
  color: white;
  border-color: var(--primary-brown);
  box-shadow: var(--shadow-medium);
}

/* Кнопка "Показать больше" */
.show-more-btn {
  background: none;
  border: none;
  color: var(--primary-brown);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.show-more-btn:hover {
  color: var(--primary-accent);
}

/* =============================================================================
   СЕТКА КАТАЛОГА - МНОГОРЯДНАЯ КОМПОНОВКА v4.0
   ============================================================================= */
.catalog-content {
  flex: 1;
  min-width: 0;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.catalog-item {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.catalog-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-brown);
  text-decoration: none;
  color: inherit;
}

/* =============================================================================
   СОВРЕМЕННЫЕ КАРТОЧКИ КОФЕ v4.0
   ============================================================================= */
.coffee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.coffee-card {
  background: var(--surface-card);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.coffee-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.coffee-image {
  aspect-ratio: 4/3;
  background: var(--gradient-surface);
  overflow: hidden;
  position: relative;
}

.coffee-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.coffee-info {
  padding: 20px;
}

.coffee-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.coffee-roaster {
  font-size: 14px;
  color: var(--primary-brown);
  font-weight: 500;
  margin-bottom: 12px;
  display: block;
}

.coffee-details {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.coffee-roast {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Рейтинг */
.coffee-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.stars {
  display: flex;
  gap: 2px;
}

.stars i {
  font-size: 14px;
  color: #FFB800;
}

.rating-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Вкусовые ноты */
.taste-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.taste-note {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

.taste-note.fruity {
  background: #FEF3E2;
  border-color: #F59E0B;
  color: #B45309;
}

.taste-note.nutty {
  background: #F3F4F6;
  border-color: #6B7280;
  color: #374151;
}

.taste-note.chocolatey {
  background: #FDF2F8;
  border-color: #EC4899;
  color: #BE185D;
}

/* =============================================================================
   HERO SECTION - МЯГКИЙ ДИЗАЙН v4.0
   ============================================================================= */
.hero-section {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-accent));
  padding: 80px 20px;
  text-align: center;
  color: var(--text-primary);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* =============================================================================
   ПОПУЛЯРНЫЕ КАТЕГОРИИ - УЛУЧШЕННАЯ ЧИТАЕМОСТЬ v4.0
   ============================================================================= */
.quick-filters-section {
  padding: 60px 0;
  background: var(--surface-white);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.quick-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.filter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  min-height: 160px;
}

.filter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-brown);
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface-elevated);
}

.filter-card:active {
  transform: translateY(0);
}

.filter-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: var(--primary-brown);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.filter-card:hover .filter-icon {
  opacity: 1;
  transform: scale(1.1);
}

.filter-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
}

.filter-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  opacity: 0.8;
}

/* =============================================================================
   КАРТОЧКИ КОФЕ - УЛУЧШЕННЫЙ ДИЗАЙН БЕЗ КОРЗИНЫ v4.0
   ============================================================================= */
.featured-section {
  padding: 60px 0;
  background: white;
}

.coffee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 2rem;
  padding: 0 20px;
}

.coffee-card {
  background: var(--surface-card);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.coffee-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.coffee-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--surface-card);
}

.coffee-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.coffee-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-accent);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.coffee-info {
  padding: 28px 24px 20px 24px;
}

.coffee-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary-brown);
  line-height: 1.25;
}

.coffee-description {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  font-size: 0.9rem;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coffee-details {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.coffee-origin,
.coffee-roast {
  padding: 4px 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.coffee-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.stars {
  color: #F59E0B;
  font-size: 0.9rem;
}

.rating-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.coffee-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-brown);
}

.view-details-btn {
  background: var(--primary-brown);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(139, 111, 71, 0.08);
}

.view-details-btn:hover {
  background: var(--primary-accent);
  color: var(--primary-brown);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 16px rgba(139, 111, 71, 0.13);
  text-decoration: none;
}

/* СКРЫВАЕМ ВСЕ ЭЛЕМЕНТЫ КОРЗИНЫ */
.add-to-cart,
.cart-button,
.buy-button,
.purchase-button,
.add-cart,
.cart-icon,
.shopping-cart,
[class*="cart"],
[class*="buy"],
[class*="purchase"] {
  display: none !important;
  visibility: hidden !important;
}

/* =============================================================================
   ABOUT SECTION
   ============================================================================= */
.about-section {
  padding: 60px 0;
  background: var(--surface-white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-top: 2rem;
}

.feature-item {
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.feature-item h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-item p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* =============================================================================
   SECTION STYLES
   ============================================================================= */
.section-title {
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* =============================================================================
   Плавные переходы между секциями
   ============================================================================= */
section {
  padding: 60px 20px;
  transition: background-color 0.3s, padding 0.3s;
}
section:hover {
  background-color: var(--primary-light);
  padding: 70px 20px;
}

/* =============================================================================
   Оптимизация изображений
   ============================================================================= */
img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* =============================================================================
   Улучшение фильтров для мобильных устройств
   ============================================================================= */
@media (max-width: 768px) {
  .filter-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
  }
  .filter-card {
    flex: 1 1 calc(50% - 16px);
    max-width: calc(50% - 16px);
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
  }
  .filter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }
}

/* Улучшение контрастности каталога */
.catalog-page {
  background-color: #f5f5f5; /* Светлый фон для улучшения восприятия */
  color: #333; /* Тёмный текст для контраста */
}
.catalog-page .product-card {
  border: 1px solid #ddd; /* Добавление границ для визуального разделения */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Лёгкая тень для объёма */
}
