/* ==========================================
   More-Fire Gas Website - Products Page Styles
   ========================================== */

/* --- Products Hero Section --- */
.products-hero {
  background: linear-gradient(135deg, var(--light-blue), var(--white));
  min-height: 40vh;
  display: flex;
  align-items: center;
  position: relative;
}

.products-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/hero-pattern.svg') center/cover;
  opacity: 0.1;
  z-index: 1;
}

.products-hero .container {
  position: relative;
  z-index: 2;
}

.products-hero .hero-title {
  font-size: 3.5rem;
  font-weight: var(--font-weight-extrabold);
  margin-bottom: 1rem;
}

.products-hero .hero-subtitle {
  font-size: 1.2rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Filter Buttons --- */
.filter-buttons {
  margin-bottom: 3rem;
}

.filter-btn {
  background: var(--white);
  border: 2px solid var(--light-blue);
  color: var(--primary-blue);
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  border-radius: var(--border-radius-lg);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  transition: var(--transition-normal);
  z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
  left: 0;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--white);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.filter-btn i {
  margin-right: 0.5rem;
}

/* --- Product Cards --- */
.product-card {
  background: var(--white);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-md);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.product-image {
  position: relative;
  overflow: hidden;
  height: 250px;
  flex-shrink: 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 102, 204, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-normal);
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-overlay .btn {
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.product-card:hover .product-overlay .btn {
  transform: translateY(0);
}

.product-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.75rem;
  color: var(--dark-gray);
}

.product-description {
  color: var(--gray);
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.6;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  background: linear-gradient(135deg, var(--light-blue), var(--primary-blue));
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-lg);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
}

/* --- Product Grid Animation --- */
.product-item {
  transition: var(--transition-normal);
}

.product-item.filter-hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.product-item.filter-show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: var(--white);
  padding: 3rem 2rem;
  border-radius: var(--border-radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.cta-section h3 {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  position: relative;
  z-index: 2;
}

.cta-section p {
  font-size: 1.1rem;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.cta-buttons {
  position: relative;
  z-index: 2;
}

.cta-buttons .btn {
  margin: 0.5rem;
}

/* --- Loading States --- */
.products-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--light-blue);
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  .products-hero .hero-title {
    font-size: 2.5rem;
  }
  
  .filter-btn {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .product-image {
    height: 200px;
  }
  
  .cta-section {
    padding: 2rem 1rem;
  }
  
  .cta-section h3 {
    font-size: 1.5rem;
  }
  
  .cta-buttons .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }
}

@media (max-width: 576px) {
  .products-hero {
    min-height: 30vh;
  }
  
  .products-hero .hero-title {
    font-size: 2rem;
  }
  
  .products-hero .hero-subtitle {
    font-size: 1rem;
  }
  
  .filter-buttons {
    margin-bottom: 2rem;
  }
  
  .product-info {
    padding: 1rem;
  }
  
  .product-title {
    font-size: 1.1rem;
  }
  
  .product-description {
    font-size: 0.9rem;
  }
}

/* --- Accessibility Improvements --- */
.filter-btn:focus,
.product-overlay .btn:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

.product-card:focus-within {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* --- Print Styles --- */
@media print {
  .filter-buttons,
  .product-overlay,
  .cta-section {
    display: none;
  }
  
  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--gray);
  }
  
  .product-image {
    height: 150px;
  }
}

/* --- Animations for Page Load --- */
@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.product-card {
  animation: slideInUp 0.6s ease-out forwards;
}

.product-item:nth-child(1) .product-card { animation-delay: 0.1s; }
.product-item:nth-child(2) .product-card { animation-delay: 0.2s; }
.product-item:nth-child(3) .product-card { animation-delay: 0.3s; }
.product-item:nth-child(4) .product-card { animation-delay: 0.4s; }
.product-item:nth-child(5) .product-card { animation-delay: 0.5s; }
.product-item:nth-child(6) .product-card { animation-delay: 0.6s; }

/* --- Glass Morphism for Product Cards --- */
.product-card.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
}
