/* Products Page Styles */

.products-hero {
  text-align: center;
  padding: 80px 20px;
  margin-top: 60px;
}

.products-hero h1 {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.products-subtitle {
  font-size: 1.125rem;
  color: #666;
  margin: 0;
}

.products-container {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  transition: opacity 0.3s ease;
}

.products-grid[data-state='loading'] {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #409eff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-spinner p {
  margin-top: 16px;
  color: #666;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.product-card {
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
}

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

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

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .card-overlay {
  opacity: 1;
}

.card-button {
  background: #409eff;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.card-button:hover {
  background: #66b1ff;
}

.card-body {
  padding: 16px;
}

.card-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-clamp: 2;
}

.card-code {
  margin: 4px 0;
  font-size: 12px;
  color: #999;
}

.card-brand {
  margin: 8px 0;
  font-size: 13px;
  color: #666;
}

.card-brand strong {
  color: #333;
}

.card-sku-count {
  margin: 8px 0;
  font-size: 13px;
  color: #666;
}

.card-price {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
}

.card-price strong {
  color: #ff7242;
  font-size: 14px;
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  background: none;
  border: none;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
}

.modal-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-main-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
}

.modal-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.modal-thumbnail {
  width: 70px;
  height: 70px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-thumbnail:hover {
  border-color: #409eff;
}

.modal-info h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.product-code,
.product-brand,
.product-category {
  margin: 8px 0;
  font-size: 14px;
  color: #666;
}

.product-code,
.product-brand strong {
  color: #333;
  font-weight: 600;
}

.skus-section {
  margin-top: 32px;
}

.skus-section h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.skus-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  font-size: 13px;
}

.skus-table thead {
  background: #f5f5f5;
}

.skus-table th {
  padding: 12px;
  text-align: left;
  color: #333;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.skus-table td {
  padding: 12px;
  color: #666;
  border-bottom: 1px solid #eee;
}

.skus-table tbody tr:last-child td {
  border-bottom: none;
}

.price-info {
  margin-top: 24px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 4px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 14px;
}

.price-row strong {
  color: #ff7242;
  font-size: 16px;
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.modal-actions .button {
  flex: 1;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .products-hero h1 {
    font-size: 2.4rem;
  }

  .products-subtitle {
    font-size: 1rem;
  }

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

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 14px;
  }
}
