* {
    box-sizing: border-box;
  }
  body {
    font-family:
      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
      Arial, sans-serif;
    margin: 0;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
  }
  .shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
  }
  /* Шапка сайта */
  .shop-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .shop-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .shop-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
  }
  .shop-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
  }
  .shop-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s;
  }
  .shop-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .cart-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .cart-btn:hover {
    background: rgba(255, 255, 255, 0.3);
  }
  .cart-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
  }
  /* Кнопка открытия фильтров на мобильных */
  .btn-toggle-filters {
    display: none;
    background: #667eea;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 1rem auto;
    transition: background 0.2s;
  }
  .btn-toggle-filters:hover {
    background: #5568d3;
  }
  
  /* Overlay для мобильного сайдбара */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
  }
  .sidebar-overlay.show {
    display: block;
  }

  /* Контейнер с сайдбаром и контентом */
  .shop-content-wrapper {
    display: flex;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
  }
  
  /* Левый сайдбар с фильтрами */
  .shop-sidebar {
    width: 280px;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
  }
  .sidebar-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
  }
  .sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
  }
  .search-box {
    position: relative;
  }
  .search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
  }
  .search-box::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }
  .filter-group {
    margin-bottom: 1rem;
  }
  .filter-group:last-child {
    margin-bottom: 0;
  }
  .filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
  }
  .filter-group select,
  .filter-group input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
  }
  .filter-group input[type="number"] {
    padding: 0.625rem;
  }
  .price-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  .price-range input {
    flex: 1;
  }
  .price-range span {
    color: #64748b;
    font-size: 0.875rem;
  }
  .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .filter-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
  }
  .filter-checkbox label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
  }
  .btn-apply-filters {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 1rem;
  }
  .btn-apply-filters:hover {
    background: #5568d3;
  }
  .btn-reset-filters {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
  }
  .btn-reset-filters:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
  }
  
  /* Каталог товаров */
  .shop-main {
    flex: 1;
    min-width: 0;
  }
  .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  .product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition:
      transform 0.2s,
      box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
  }
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }
  .product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f1f5f9;
  }
  .product-image-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
  }
  .product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .product-category {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }
  .product-code {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
  }
  .product-stock {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }
  .product-stock.in-stock {
    color: #10b981;
    font-weight: 600;
  }
  .product-stock.out-of-stock {
    color: #ef4444;
    font-weight: 600;
  }
  .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
    line-height: 1.4;
  }
  .product-description {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
    flex: 1;
  }
  .product-description p {
    margin: 0;
    line-height: 1.5;
  }
  .product-description p:not(:last-child) {
    margin-bottom: 0.5rem;
  }
  .product-description strong,
  .product-description b {
    font-weight: 600;
  }
  .product-description em,
  .product-description i {
    font-style: italic;
  }
  .product-description ul,
  .product-description ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
  }
  .product-description li {
    margin: 0.25rem 0;
  }
  /* Ограничение высоты для карточек товаров - используем простой overflow для HTML */
  .product-card .product-description {
    max-height: 3.5em;
    overflow: hidden;
    position: relative;
  }
  .product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
  }
  .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
  }
  .product-price-old {
    font-size: 1rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 0.5rem;
  }
  .btn-add-cart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .btn-add-cart:hover {
    opacity: 0.9;
  }
  .btn-add-cart:active {
    transform: scale(0.98);
  }
  .btn-preorder {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .btn-preorder:hover {
    opacity: 0.9;
  }
  .btn-preorder:active {
    transform: scale(0.98);
  }
  /* Модальное окно корзины */
  .cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
  }
  .cart-overlay.show {
    display: flex;
  }
  .cart-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
  .cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
  }
  .cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
  }
  .cart-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
  }
  .cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
  }
  .cart-item:last-child {
    border-bottom: none;
  }
  .cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #f1f5f9;
  }
  .cart-item-info {
    flex: 1;
  }
  .cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  .cart-item-price {
    color: #667eea;
    font-weight: 600;
  }
  .cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .cart-item-qty {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
  }
  .cart-item-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
  }
  .cart-item-remove:hover {
    background: #fecaca;
  }
  .cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
  }
  .cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
  }
  .cart-actions {
    display: flex;
    gap: 1rem;
  }
  .btn-checkout {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
  }
  .btn-checkout:hover {
    opacity: 0.9;
  }
  .btn-continue {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
  }
  .btn-continue:hover {
    background: #cbd5e1;
  }
  .cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
  }
  .cart-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
  }
  /* Страница товара */
  .product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
  }
  .product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  .product-detail-image {
    width: 100%;
    border-radius: 12px;
  }
  .product-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  .product-detail-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin: 1rem 0;
  }
  .product-detail-description {
    grid-column: 1 / -1;
    color: #64748b;
    line-height: 1.8;
    margin: 1.5rem 0 0;
  }
  .product-detail-description p {
    margin: 0.5rem 0;
  }
  .product-detail-description p:first-child {
    margin-top: 0;
  }
  .product-detail-description p:last-child {
    margin-bottom: 0;
  }
  .product-detail-description strong,
  .product-detail-description b {
    font-weight: 100%;
  }
  .product-detail-description em,
  .product-detail-description i {
    font-style: italic;
  }
  .product-detail-description ul,
  .product-detail-description ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
  }
  .product-detail-description li {
    margin: 0.5rem 0;
  }
  .product-detail-description h1,
  .product-detail-description h2,
  .product-detail-description h3 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
  }
  .product-detail-description h1:first-child,
  .product-detail-description h2:first-child,
  .product-detail-description h3:first-child {
    margin-top: 0;
  }
  .product-detail-description a {
    color: #667eea;
    text-decoration: underline;
  }
  .product-detail-description a:hover {
    color: #764ba2;
  }
  .product-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
  }
  .btn-buy {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
  }
  .btn-buy:hover {
    opacity: 0.9;
  }
  /* Оформление заказа */
  .checkout-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
  }
  .checkout-form {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  .form-section {
    margin-bottom: 2rem;
  }
  .form-section h3 {
    margin-bottom: 1rem;
    color: #1e293b;
  }
  .form-group {
    margin-bottom: 1rem;
  }
  .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #475569;
  }
  .form-group input,
  .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
  }
  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
  }
  .checkout-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
  }
  .checkout-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }
  .checkout-summary-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
  }
  .checkout-mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
  }
  .checkout-mode-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
  }
  .checkout-mode-tab input { display: none; }
  .checkout-mode-tab:hover { color: #475569; }
  .checkout-mode-tab input:checked + span { color: #667eea; }
  .checkout-mode-tab:has(input:checked) {
    color: #667eea;
    border-bottom-color: #667eea;
  }
  .checkout-mode-desc {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.95rem;
  }
  /* Загрузка */
  .loading {
    text-align: center;
    padding: 3rem;
    color: #64748b;
  }
  .loading-spinner {
    border: 4px solid #f1f5f9;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
  }
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  @keyframes slideIn {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  @keyframes slideOut {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(100%);
      opacity: 0;
    }
  }
  /* Адаптивность */
  @media (max-width: 768px) {
    .product-detail {
      grid-template-columns: 1fr;
    }
    .products-grid {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 1rem;
    }
    .shop-header {
      padding: 1rem;
    }
    .btn-toggle-filters {
      display: block;
    }
    .shop-content-wrapper {
      flex-direction: column;
      padding: 1rem;
    }
    .sidebar-overlay.show {
      display: block;
    }
    .shop-sidebar {
      width: 85%;
      max-width: 320px;
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 200;
      overflow-y: auto;
      transform: translateX(-100%);
      transition: transform 0.3s;
      margin-bottom: 0;
      border-radius: 0 12px 12px 0;
    }
    .shop-sidebar.show {
      transform: translateX(0);
    }
    .shop-main {
      padding: 0;
    }
  }