/* Products Page - Catalog Style */

.products-hero {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  margin-top: 70px;
  position: relative;
  overflow: hidden;
}

.products-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.products-hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  text-align: center;
  color: white;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* Products Main Section */
.products-main {
  padding: 0;
  background: var(--bg-primary);
  min-height: 80vh;
}

.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  align-items: start;
  min-height: calc(100vh - 40vh);
}

/* Categories Sidebar */
.categories-sidebar {
  background: var(--primary-color);
  padding: 2rem;
  color: white;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  scrollbar-width: none;
}

.categories-sidebar h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: white;
  text-align: left;
}

.category-filters {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Category Checkboxes */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 20px;
}

.category-checkbox {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
}

.category-checkbox:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding-left: 0.5rem;
}

.category-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.category-checkbox input[type="checkbox"]:checked + .checkmark {
  background: white;
  border-color: white;
}

.category-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: bold;
}

.category-name {
  font-size: 0.95rem;
  color: white;
  flex: 1;
}

/* Filter Buttons */
.apply-filter-btn,
.clear-filter-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.apply-filter-btn {
  background: white;
  color: var(--primary-color);
}

.apply-filter-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.clear-filter-btn {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.clear-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* Products Content */
.products-content {
  background: var(--bg-primary);
  padding: 2rem;
  min-height: calc(100vh - 70px);
}

/* Catalog Header */
.catalog-header {
  margin-bottom: 2rem;
}

.catalog-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.catalog-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  justify-content: flex-start;
}

.search-bar {
  flex: 1;
  position: relative;
  max-width: 500px;
}

.search-bar i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
}

.search-bar input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  /* margin-top: 1rem; */
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-color);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-tag .remove-filter {
  cursor: pointer;
  font-weight: bold;
  margin-left: 0.5rem;
}

.filter-tag .remove-filter:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-heavy);
}

.product-image {
  height: 250px;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.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);
}

.image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  position: absolute;
  top: 0;
  left: 0;
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

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

.view-btn {
  width: 50px;
  height: 50px;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: scale(0.8);
}

.product-card:hover .view-btn {
  transform: scale(1);
}

.view-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.product-info {
  background-color: var(-text-primary);
  padding: 1.5rem;
}

.product-info h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.product-info p {
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

/* Product Modal */
.product-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-card);
  margin: 10% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

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

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-secondary);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--primary-color);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

.modal-image {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

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

.modal-image .image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  position: absolute;
  top: 0;
  left: 0;
}

.modal-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.modal-info h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.modal-info p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-features {
  margin-bottom: 1.5rem;
}

.modal-features h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-features ul {
  list-style: none;
  padding: 0;
}

.modal-features li {
  padding: 0.3rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.modal-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

.modal-actions .btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Loading State */
.products-grid.loading {
  opacity: 0.5;
  pointer-events: none;
}

.products-grid.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

  .categories-sidebar {
    padding: 1.5rem;
  }
}

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

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

  .categories-sidebar {
    position: static;
    height: auto;
    order: 2;
  }

  .products-content {
    order: 1;
  }

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

  .search-bar {
    max-width: none;
  }

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

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

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .rotating-product {
    width: 200px;
    height: 200px;
  }

  .modal-actions {
    flex-direction: column;
  }
}
