:root {
    --tiffany: #0abab5;
    --tiffany-dark: #008b8b;
    --white: #fff;
    --light-gray: #f5f5f5;
    --dark: #333;
    --zip-gradient: linear-gradient(135deg, #0abab5 0%, #006d77 100%);
    --courier-gradient: linear-gradient(135deg, #ff9a8b 0%, #ff6b95 100%);
    --thermal-gradient: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  }
  
  /* ===== БАЗОВЫЕ СТИЛИ ===== */
  body {
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #e0f7fa;
  }
  
  /* ===== ШАПКА И НАВИГАЦИЯ ===== */
  .fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--tiffany);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
  }
  
  .header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .logo a {
    color: var(--white);
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
  }
  
  .desktop-nav {
    display: flex;
    gap: 20px;
  }
  
  .desktop-nav a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background 0.3s;
  }
  
  .desktop-nav a:hover,
  .desktop-nav a.active {
    background: rgba(255,255,255,0.2);
  }
  
  .mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
  }
  
  /* ===== КОНТЕНТ ===== */
  .main-container {
    margin-top: 140px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background-color: transparent;
  }
  
  /* ===== КАРТОЧКИ ===== */
  .categories-grid,
  .subcategories-grid {
    display: grid;
    gap: 30px;
    margin-top: 30px;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .subcategories-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .category-card,
  .subcategory-card {
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    color: var(--white);
    position: relative;
    overflow: hidden;
    text-decoration: none;
  }
  
  .category-card {
    padding: 40px 20px;
  }
  
  .subcategory-card {
    padding: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .category-card h2,
  .subcategory-card h2 {
    margin: 0;
    position: relative;
    z-index: 2;
  }
  
  .category-card:hover,
  .subcategory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  }
  
  /* Градиенты */
  .zip-gradient { background: var(--zip-gradient); }
  .courier-gradient { background: var(--courier-gradient); }
  .thermal-gradient { background: var(--thermal-gradient); }
  .zip-gradient-light { background: linear-gradient(135deg, #0abab5 0%, #4ecdc4 100%); }
  .zip-gradient-medium { background: linear-gradient(135deg, #0abab5 0%, #009999 100%); }
  .zip-gradient-dark { background: linear-gradient(135deg, #0abab5 0%, #006d77 100%); }
  
  /* ===== ТОВАРЫ ===== */
  .products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
  }
  
  .product-card {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  }
  
  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  }
  
  .product-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: var(--white);
  }
  
  .product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  
  .product-title {
    padding: 15px;
    text-align: center;
    background: var(--light-gray);
  }
  
  .product-title h3 {
    margin: 0;
    font-size: 16px;
    color: var(--dark);
    font-weight: 500;
  }
  
  /* ===== КОРЗИНА ===== */
  .cart-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 10px;
  }
  
  .cart-table-container {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
  }
  
  .cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
  }
  
  .cart-table th, 
  .cart-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .cart-table th {
    background: var(--tiffany);
    color: var(--white);
    font-weight: 500;
    text-align: left;
  }
  
  .col-price, 
  .col-sum {
    text-align: right;
    white-space: nowrap;
  }
  
  .cart-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 0 10px;
  }
  
  .btn {
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    flex: 1;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .btn-checkout {
    background: var(--tiffany);
    color: var(--white);
  }
  
  .btn-checkout:hover {
    background: var(--tiffany-dark);
  }
  
  /* ===== МЕДИА-ЗАПРОСЫ ===== */
  @media (max-width: 992px) {
    .desktop-nav {
      display: none;
    }
    
    .mobile-menu-btn {
      display: block;
    }
    
    .nav-links {
      flex-direction: column;
      gap: 10px;
    }
  }
  
  @media (max-width: 768px) {
    .main-container {
      margin-top: 150px;
    }
    
    .categories-grid,
    .subcategories-grid {
      grid-template-columns: 1fr;
    }
    
    .products-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
    }
    
    .product-image {
      height: 160px;
      padding: 10px;
    }
    
    .cart-buttons {
      flex-direction: column;
    }
    
    .cart-table th, 
    .cart-table td {
      padding: 12px 8px;
      font-size: 14px;
    }
    
    .col-num {
      display: none;
    }
  }
  
  @media (max-width: 480px) {
    .products-grid {
      grid-template-columns: 1fr;
    }
    
    .cart-table th.col-price::after {
      content: "ена";
    }
    
    .cart-table th.col-price {
      text-indent: -5px;
    }
    
    .cart-buttons .btn {
      width: 100%;
      padding: 10px;
      font-size: 14px;
    }
  }

  /* Исправление для изображений подкатегорий на мобильных */
.subcategory-images {
  display: flex;
  flex-wrap: wrap; /* Добавляем перенос на новую строку */
  justify-content: center;
  gap: 10px; /* Уменьшаем отступ между картинками */
  margin-top: 15px;
  padding: 0 10px; /* Добавляем отступы по бокам */
  box-sizing: border-box;
}

.subcategory-image {
  width: calc(50% - 10px); /* Занимает половину ширины с учетом gap */
  max-width: 150px; /* Ограничиваем максимальную ширину */
  height: auto; /* Сохраняем пропорции */
  aspect-ratio: 1/1; /* Сохраняем квадратную форму */
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Особые стили для iPhone (ширина до 430px) */
@media only screen and (max-width: 430px) {
  .subcategory-container {
    padding: 0 5px;
  }
  
  .subcategory-images {
    gap: 5px;
  }
  
  .subcategory-image {
    width: calc(50% - 5px);
    max-width: 120px;
  }
}

/* Для очень маленьких экранов */
@media only screen and (max-width: 350px) {
  .subcategory-image {
    width: 100%;
    max-width: 140px;
  }
}

/* Мобильная адаптация изображений подкатегорий */
.subcategory-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px auto 0;
  max-width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
}

.subcategory-image {
  width: 100%;
  max-width: 160px; /* Фиксированная максимальная ширина */
  height: auto;
  aspect-ratio: 1/1; /* Сохраняем квадратную форму */
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}

/* Особые настройки для iPhone */
@media only screen and (max-width: 430px) {
  .subcategory-images {
    gap: 8px;
    padding: 0 8px;
  }
  
  .subcategory-image {
    max-width: calc(50% - 10px); /* Две картинки в ряд с отступами */
  }
}

/* Фикс для iOS 14 и ниже */
@supports (-webkit-touch-callout: none) {
  .subcategory-image {
    max-height: 160px; /* Дополнительное ограничение для iOS */
  }
}

/* Стили для страницы категорий */
.category-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.subcategories-grid {
  display: grid;
  gap: 30px;
  margin-top: 30px;
}

.subcategory-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.subcategory-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  padding: 0 10px;
}

.subcategory-image {
  width: 100%;
  max-width: 160px;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}

.subcategory-desc {
  padding: 10px;
  text-align: center;
  color: #555;
  font-size: 14px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .subcategories-grid {
      grid-template-columns: 1fr;
      gap: 20px;
  }
  
  .subcategory-images {
      gap: 8px;
  }
  
  .subcategory-image {
      max-width: calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .subcategory-image {
      max-width: calc(50% - 5px);
  }
}

/* Фикс для iOS */
@supports (-webkit-touch-callout: none) {
  .subcategory-image {
      max-height: 160px;
  }
}