/* ============================================
   PRODUCTS PAGE STYLES
   Interactive filtering and modern grid layout
   ============================================ */

.page-products {
  background: var(--bg-dark);
}

/* Hero Section */
.page-hero-products {
  position: relative;
  height: 60vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.hero-background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  z-index: 0;
}

.hero-overlay-dark {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 1;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  max-width: 800px;
  padding: 2rem;
}

/* Force white text in products page hero */
.page-hero-products .hero-badge,
.page-hero-products .hero-badge .mono,
.page-hero-products .hero-title-large,
.page-hero-products .hero-subtitle,
.page-hero-products .hero-subtitle.mono {
  color: #ffffff !important;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--accent-blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 50px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.hero-title-large {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.1em;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: #ffffff;
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

/* Filter Section (dark) */
.products-filter-section {
  padding: 3rem 0 2rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.products-grid-section {
  padding: 4rem 0;
  background: var(--bg-dark);
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filter-title {
  font-size: 0.875rem;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.filter-reset {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-heading);
}

.filter-reset:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
}

.filter-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-default);
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-btn i {
  font-size: 1rem;
}

.filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 94, 184, 0.15);
}

.filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 94, 184, 0.3);
}

/* Products Grid Section */
.products-grid-section {
  padding: 4rem 0;
  background: var(--bg-dark);
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.products-count {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.count-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-blue);
}

.products-count span:last-child {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-default);
}

.view-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.view-btn:hover {
  background: var(--bg-elevated);
  color: var(--accent-blue);
}

.view-btn.active {
  background: var(--accent-blue);
  color: white;
}

/* Products Container */
.products-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  transition: all 0.4s ease;
}

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

.products-container.list-view .product-card-enhanced {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

.products-container.list-view .product-image-wrapper {
  height: 100%;
}

/* Product Card Enhanced (dark) */
.product-card-enhanced {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: scale(1);
}

.product-card-enhanced.hidden {
  display: none;
}

.product-card-enhanced.fade-out {
  opacity: 0;
  transform: scale(0.95);
}

.product-card-enhanced:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border-color: var(--accent-blue);
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.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: opacity 0.3s ease;
}

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

.btn-view-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-view-details:hover {
  background: white;
  color: var(--accent-blue);
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-blue);
  color: white;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.product-content {
  padding: 2rem;
  background: var(--bg-card);
  color: var(--text-primary);
}

.product-category {
  font-size: 0.75rem;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.product-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.product-description {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.spec-item i {
  color: var(--accent-blue);
  width: 20px;
  text-align: center;
}

.btn-read-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: 2px solid var(--accent-blue);
  border-radius: 50px;
  color: var(--accent-blue);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-read-more:hover {
  background: var(--accent-blue);
  color: white;
  transform: translateX(5px);
}

.btn-read-more i {
  transition: transform 0.3s ease;
}

.btn-read-more:hover i {
  transform: translateX(5px);
}

/* Empty State */
.products-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.products-empty i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.products-empty h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ========== OUR LAST PROJECT (distinct from Product & Service) ========== */
.projects-last-section {
  padding: 4rem 0;
  background: linear-gradient(180deg, #1a1d24 0%, #252a33 100%);
  color: #e5e7eb;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] .projects-last-section {
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%);
  color: #0f1115;
}

.section-intro-projects {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.section-intro-projects .section-tag {
  background: rgba(0, 94, 184, 0.25);
  border: 1px solid rgba(0, 94, 184, 0.5);
  color: #93c5fd;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.section-intro-projects .section-title-large {
  color: #f8fafc;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.section-intro-projects .section-description {
  color: rgba(229, 231, 235, 0.85);
  font-size: 1rem;
  line-height: 1.65;
  transition: color 0.3s ease;
}

[data-theme="light"] .section-intro-projects .section-tag {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #2563eb;
}

[data-theme="light"] .section-intro-projects .section-title-large {
  color: #0f1115;
}

[data-theme="light"] .section-intro-projects .section-description {
  color: rgba(15, 17, 21, 0.85);
}

.projects-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.projects-filter-row .filter-label {
  font-size: 0.75rem;
  color: rgba(229, 231, 235, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.3s ease;
}

[data-theme="light"] .projects-filter-row .filter-label {
  color: rgba(15, 17, 21, 0.7);
}

.filter-buttons-inline {
  background: transparent;
  border: none;
  padding: 0;
  gap: 0.5rem;
}

.filter-btn-project {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(229, 231, 235, 0.9);
  transition: all 0.3s ease;
}

.filter-btn-project:hover {
  background: rgba(0, 94, 184, 0.25);
  border-color: rgba(0, 94, 184, 0.5);
  color: #93c5fd;
}

.filter-btn-project.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

[data-theme="light"] .filter-btn-project {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(15, 17, 21, 0.9);
}

[data-theme="light"] .filter-btn-project:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #2563eb;
}

.projects-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border-color: var(--accent-blue);
}

.project-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #2d333b;
  transition: background 0.3s ease;
}

[data-theme="light"] .project-card-image {
  background: #e5e7eb;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  opacity: 1;
}

.project-card-cat {
  font-size: 0.7rem;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: color 0.3s ease;
}

.btn-project-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-project-detail:hover {
  background: white;
  color: var(--accent-blue);
  transform: translateX(4px);
}

.project-card-body {
  padding: 1.25rem;
  flex: 1;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

.project-card-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.project-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  transition: color 0.3s ease;
}

.projects-last-section .products-empty {
  color: rgba(229, 231, 235, 0.6);
  transition: color 0.3s ease;
}

.projects-last-section .products-empty h3 {
  color: rgba(229, 231, 235, 0.8);
  transition: color 0.3s ease;
}

[data-theme="light"] .projects-last-section .products-empty {
  color: rgba(15, 17, 21, 0.6);
}

[data-theme="light"] .projects-last-section .products-empty h3 {
  color: rgba(15, 17, 21, 0.8);
}

/* Responsive */
@media (max-width: 1024px) {
  .products-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  .products-container.list-view .product-card-enhanced {
    grid-template-columns: 250px 1fr;
  }

  .projects-masonry {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .products-filter-section {
    top: 70px;
    padding: 2rem 0;
  }
  
  .filter-buttons {
    gap: 0.75rem;
  }
  
  .filter-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }
  
  .filter-btn span {
    display: none;
  }
  
  .products-container {
    grid-template-columns: 1fr;
  }
  
  .products-container.list-view .product-card-enhanced {
    grid-template-columns: 1fr;
  }
  
  .products-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .product-image-wrapper {
    height: 200px;
  }

  .projects-filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-btn-project span {
    display: inline;
  }

  .projects-masonry {
    grid-template-columns: 1fr;
  }
}
