/* Products Page Layout */
.products-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 143px);
  max-width: 1600px;
  margin: 0 auto;
}

/* Sidebar */
.products-sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 32px 0;
  position: sticky;
  top: 143px;
  height: calc(100vh - 143px);
  overflow-y: auto;
}

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0a0a0a;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: white;
  color: #3b82f6;
  border-left-color: #3b82f6;
}

.sidebar-link.active {
  background: white;
  color: #3b82f6;
  border-left-color: #3b82f6;
  font-weight: 600;
}

.sidebar-link svg {
  opacity: 0;
  transition: opacity 0.2s;
}

.sidebar-link:hover svg,
.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-plaintext {
  padding: 16px 24px;
  color: #64748b;
  font-size: 14px;
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
}

/* Products Main Area */
.products-main {
  padding: 48px 40px;
}

.products-header {
  margin-bottom: 48px;
}

.products-header h1 {
  font-size: 42px;
  font-weight: 800;
  color: #0a0a0a;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.category-description {
  font-size: 18px;
  color: #64748b;
  line-height: 1.6;
}

.products-loading,
.products-empty,
.products-error {
  text-align: center;
  padding: 80px 40px;
}

.products-empty h2,
.products-error h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.products-empty p,
.products-error p {
  color: #64748b;
  font-size: 16px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid #e2e8f0;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-image {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  overflow: hidden;
}

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

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

.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

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

.btn-view-details {
  padding: 12px 24px;
  background: white;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-view-details:hover {
  background: #3b82f6;
  color: white;
  transform: translateY(-2px);
}

.product-info {
  padding: 20px;
}

.product-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #3b82f6;
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.product-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: #0a0a0a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-subtype {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: #0a0a0a;
}

/* Product Modal */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}

.product-modal.active {
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
  background: #f1f5f9;
  transform: rotate(90deg);
}

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

.modal-image {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 12px;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-details {
  display: flex;
  flex-direction: column;
}

.product-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #3b82f6;
  background: #eff6ff;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.modal-details h2 {
  font-size: 32px;
  font-weight: 700;
  color: #0a0a0a;
  margin-bottom: 12px;
  line-height: 1.2;
}

.modal-details .product-subtype {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 16px;
}

.modal-details .product-price {
  font-size: 28px;
  font-weight: 800;
  color: #0a0a0a;
  margin-bottom: 24px;
}

.product-description {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 32px;
  flex-grow: 1;
}

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

.btn {
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: white;
  color: #334155;
  border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

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

  .products-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .products-main {
    padding: 32px 20px;
  }

  .products-header h1 {
    font-size: 32px;
  }

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

  .modal-body {
    padding: 24px;
  }
}
