/* Catalog Page Specific Styles */

/* Page Header */
.page-header {
  text-align: center;
  padding: 2rem 0;
  background: linear-gradient(135deg, #f9f1ea, #f3d3b4);
  border-radius: 1rem;
  margin-bottom: 2rem;
}
.messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
}

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

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}

/* Типы сообщений */
.alert-success {
    border-left-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.alert-success .alert-icon {
    color: #10b981;
}

.alert-error {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.alert-error .alert-icon {
    color: #ef4444;
}

.alert-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.alert-warning .alert-icon {
    color: #f59e0b;
}

.alert-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.alert-info .alert-icon {
    color: #3b82f6;
}

/* Автоматическое исчезновение */
.alert-dismissible {
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 4.7s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .messages-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 13px;
    }
}
.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e1b17;
  margin-bottom: 0.5rem;
}

.page-description {
  font-size: 1.125rem;
  color: #3c332c;
  max-width: 600px;
  margin: 0 auto;
}

/* Catalog Controls */
.catalog-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #1e1b17;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  position: relative;
}

.mobile-filter-toggle:hover {
  background: #3c332c;
}

.filter-count {
  background: #e74c3c;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -5px;
  right: -5px;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.filter-count.has-filters {
  transform: scale(1);
}

.view-toggle {
  display: flex;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  overflow: hidden;
}

.view-btn {
  padding: 0.75rem 1rem;
  border: none;
  background: white;
  cursor: pointer;
  color: #666;
  transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
  background: #1e1b17;
  color: white;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  font-weight: 500;
  color: #1e1b17;
  white-space: nowrap;
}

.sort-select {
  padding: 0.75rem 1rem;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  background: white;
  cursor: pointer;
  min-width: 200px;
}

.sort-select:focus {
  outline: none;
  border-color: #1e1b17;
}

.results-info {
  color: #666;
  font-size: 0.875rem;
}

.results-count strong {
  color: #1e1b17;
}

/* Catalog Layout */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar */
.catalog-sidebar {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3d3b4;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e1b17;
  margin: 0;
}

.clear-filters-btn {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease;
}

.clear-filters-btn:hover {
  background-color: #fef2f2;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 2rem;
}

.filter-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 1rem;
}

/* Search Filter */
.search-filter {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: #1e1b17;
}

.search-filter .search-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
}

/* Filter Options */
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease;
}

.filter-option:hover {
  background-color: #f9f1ea;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #f3d3b4;
  border-radius: 3px;
  position: relative;
  transition: all 0.3s ease;
}

.filter-option input:checked + .checkmark {
  background-color: #1e1b17;
  border-color: #1e1b17;
}

.filter-option input:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.option-text {
  flex: 1;
  color: #1e1b17;
  font-size: 0.875rem;
}

.option-count {
  color: #666;
  font-size: 0.75rem;
}

/* Price Filter */
.price-filter {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.price-range {
  position: relative;
  height: 6px;
  background: #f3d3b4;
  border-radius: 3px;
}

.price-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #1e1b17;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 2;
}

.price-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #1e1b17;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  border: none;
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.price-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.price-input-group label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

.price-input {
  padding: 0.5rem;
  border: 1px solid #f3d3b4;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  width: 100%;
}

.price-input:focus {
  outline: none;
  border-color: #1e1b17;
}

.currency {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.875rem;
  pointer-events: none;
}

.price-input-group {
  position: relative;
}

/* Color Filter */
.color-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-option {
  cursor: pointer;
  position: relative;
}

.color-option input {
  display: none;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #f3d3b4;
  display: block;
  transition: all 0.3s ease;
  position: relative;
}

.color-option:hover .color-swatch,
.color-option input:checked + .color-swatch {
  border-color: #1e1b17;
  transform: scale(1.1);
}

.color-option input:checked + .color-swatch::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #1e1b17;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 0 2px white;
}

/* Rating Filter */
.rating-filter {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rating-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease;
}

.rating-option:hover {
  background-color: #f9f1ea;
}

.rating-option input {
  display: none;
}

.rating-stars {
  display: flex;
  gap: 0.125rem;
}

.rating-stars i {
  color: #fbbf24;
  font-size: 0.875rem;
}

.rating-text {
  color: #1e1b17;
  font-size: 0.875rem;
}

.rating-option input:checked + .rating-stars + .rating-text {
  font-weight: 600;
}

/* Active Filters */
.active-filters {
  background: #f9f1ea;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.active-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.active-filters-title {
  font-weight: 600;
  color: #1e1b17;
  font-size: 0.875rem;
}

.clear-all-filters {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: underline;
}

.active-filters-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid #f3d3b4;
  border-radius: 1rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: #1e1b17;
}

.filter-tag-remove {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.filter-tag-remove:hover {
  background: #e74c3c;
  color: white;
}

/* Products Container */
.catalog-content {
  min-height: 600px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.products-grid.list-view {
  grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

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

.product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9f1ea;
}

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

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

.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.badge-new {
  background: #22c55e;
}

.badge-sale {
  background: #e74c3c;
}

.badge-bestseller {
  background: #f59e0b;
}

.product-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.product-card:hover .product-actions {
  opacity: 1;
  transform: translateX(0);
}

.product-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.product-action-btn:hover {
  background: #1e1b17;
  color: white;
}

.product-action-btn i {
  font-size: 0.875rem;
}

.product-info {
  padding: 1rem;
}

.product-category {
  color: #666;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-title a {
  color: inherit;
  text-decoration: none;
}

.product-title a:hover {
  color: #3c332c;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-stars {
  display: flex;
  gap: 0.125rem;
}

.product-stars i {
  color: #fbbf24;
  font-size: 0.75rem;
}

.product-rating-text {
  color: #666;
  font-size: 0.75rem;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e1b17;
}

.old-price {
  font-size: 1rem;
  color: #999;
  text-decoration: line-through;
}

.discount-percent {
  background: #e74c3c;
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-features {
  margin-bottom: 1rem;
}

.product-features-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-feature {
  background: #f9f1ea;
  color: #1e1b17;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.product-card-actions {
  display: flex;
  gap: 0.5rem;
}

.add-to-cart-btn {
  flex: 1;
  padding: 0.75rem;
  background: #1e1b17;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
  background: #3c332c;
}

.quick-view-btn {
  padding: 0.75rem;
  background: none;
  color: #1e1b17;
  border: 1px solid #f3d3b4;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-view-btn:hover {
  background: #f3d3b4;
}

/* List View Styles */
.products-grid.list-view .product-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: center;
}

.products-grid.list-view .product-image {
  aspect-ratio: 1;
  width: 200px;
  height: 200px;
}

.products-grid.list-view .product-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.products-grid.list-view .product-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.products-grid.list-view .product-price-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #666;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3d3b4;
  border-top: 3px solid #1e1b17;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* No Results State */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.no-results-icon {
  width: 80px;
  height: 80px;
  background: #f3d3b4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.no-results-icon i {
  font-size: 2rem;
  color: #1e1b17;
}

.no-results h3 {
  color: #1e1b17;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: #666;
  margin-bottom: 1.5rem;
  max-width: 400px;
}

/* Pagination */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #f3d3b4;
  background: white;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #f3d3b4;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  gap: 0.25rem;
}

.pagination-page {
  width: 40px;
  height: 40px;
  border: 1px solid #f3d3b4;
  background: white;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  transition: all 0.3s ease;
}

.pagination-page:hover,
.pagination-page.active {
  background: #1e1b17;
  color: white;
  border-color: #1e1b17;
}

.pagination-info {
  color: #666;
  font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    max-height: none;
    overflow-y: auto;
  }

  .catalog-sidebar.open {
    left: 0;
  }

  .mobile-filter-toggle {
    display: flex;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }

  .catalog-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .catalog-controls > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sort-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .sort-select {
    min-width: auto;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .products-grid.list-view .product-card {
    grid-template-columns: 1fr;
  }

  .products-grid.list-view .product-image {
    width: 100%;
    height: 200px;
  }

  .products-grid.list-view .product-info {
    grid-template-columns: 1fr;
  }

  .products-grid.list-view .product-price-actions {
    align-items: stretch;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card-actions {
    flex-direction: column;
  }

  .pagination-pages {
    flex-wrap: wrap;
    justify-content: center;
  }
}
/* Additional styles for static product cards */
.product-availability {
    margin-bottom: 0.75rem;
}

.availability-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.availability-text.in-stock {
    color: #22c55e;
}

.availability-text.out-of-stock {
    color: #e74c3c;
}

/* Ensure proper data attribute styling */
.product-card[data-availability="out-of-stock"] .add-to-cart-btn {
    background: #999;
    cursor: not-allowed;
}

.product-card[data-availability="out-of-stock"] .add-to-cart-btn:hover {
    background: #999;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .product-card,
  .catalog-sidebar,
  .filter-option {
    border-width: 2px;
  }

  .checkmark,
  .color-swatch {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-image img,
  .product-actions,
  .catalog-sidebar {
    transition: none;
  }

  .loading-spinner {
    animation: none;
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .catalog-sidebar,
  .catalog-controls,
  .product-actions,
  .product-card-actions {
    display: none;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
