/* ========================================
   PRODUCTS PAGE STYLES
   ======================================== */

/* Container for product page sections */
.container-large {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Products Hero Section - modern gradient banner */
.products-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.75rem 1.5rem 5rem;
  min-height: 50px;
  background:
    linear-gradient(125deg, #0f2f4d 0%, #14507e 48%, #1c7a4a 100%);
  overflow: hidden;
  isolation: isolate;
}

/* Soft dotted texture overlay for depth */
.products-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.5;
  z-index: 0;
}

/* Glow accents */
.products-hero::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -160px;
  background: radial-gradient(circle, rgba(76, 175, 80, 0.35), transparent 70%);
  z-index: 0;
}

/* Curved bottom edge to separate hero from content below */
.products-hero-curve {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  line-height: 0;
  z-index: 1;
}

.products-hero-curve svg {
  display: block;
  width: 100%;
  height: 48px;
}

.products-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 0;
  max-width: 760px;
}

.products-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(6px);
}

.products-hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.18;
  margin-bottom: 1rem;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.products-hero p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Products Section */
.products-section {
  padding: 3rem 1.5rem;
}

/* Filter and Search Controls */
.products-controls {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.search-input {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3rem;
  border: 1px solid rgba(145, 158, 171, 0.25);
  border-radius: 1rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-input::placeholder {
  color: var(--muted);
}

/* Category Filter Select */
.filter-group {
  display: flex;
  align-items: center;
}

.category-select {
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: 1px solid rgba(145, 158, 171, 0.25);
  border-radius: 1rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23556a7f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.category-select:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.category-select option {
  color: var(--text);
  background: var(--bg);
}

/* Results Info */
.results-info {
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.results-info span {
  font-weight: 600;
  color: var(--text);
}

/* Products Grid Layout */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

/* Individual Product Card */
.product-card {
  background: var(--surface);
  border: 1px solid rgba(76, 175, 80, 0.14);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  cursor: pointer;
  animation: slideInUp 0.6s ease-out forwards;
  opacity: 0;
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.product-card-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 1rem;
}

.card-actions {
  display: grid;
  gap: 0.85rem;
  margin-top: auto;
}

.card-actions .button {
  width: 100%;
}

/* Stagger animation for product cards */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:nth-child(1) {
  animation-delay: 0.1s;
}
.product-card:nth-child(2) {
  animation-delay: 0.2s;
}
.product-card:nth-child(3) {
  animation-delay: 0.3s;
}
.product-card:nth-child(4) {
  animation-delay: 0.15s;
}
.product-card:nth-child(5) {
  animation-delay: 0.25s;
}
.product-card:nth-child(6) {
  animation-delay: 0.35s;
}
.product-card:nth-child(7) {
  animation-delay: 0.1s;
}
.product-card:nth-child(8) {
  animation-delay: 0.2s;
}
.product-card:nth-child(9) {
  animation-delay: 0.3s;
}

/* Product card hover effect */
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(76, 175, 80, 0.15);
  border-color: var(--green);
}

/* Product Image Container */
.product-image-container {
  position: relative;
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, rgba(255, 252, 241, 0.5), rgba(236, 245, 255, 0.5));
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

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

/* Product Badge */
.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(76, 175, 80, 0.15);
  color: var(--green-dark);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Product Info Section */
.product-info-wrapper {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-category-tag {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 500;
  margin-bottom: 1rem;
  text-transform: capitalize;
}

.product-description-short {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Product Card Buttons */
.product-card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: auto;
}

.btn-details,
.btn-quote {
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-details {
  background: rgba(33, 150, 243, 0.08);
  color: var(--blue);
}

.btn-details:hover {
  background: rgba(33, 150, 243, 0.15);
}

.btn-quote {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #fff;
  box-shadow: 0 8px 20px rgba(76, 175, 80, 0.2);
}

.btn-quote:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(76, 175, 80, 0.3);
}

/* Load More Button Container */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.load-more-container .button-primary {
  min-width: 200px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border-radius: 1.5rem;
  border: 1px solid rgba(76, 175, 80, 0.14);
}

.empty-state i {
  font-size: 3.5rem;
  color: var(--muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

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

.empty-state p {
  color: var(--muted);
  font-size: 1rem;
}

/* ========================================
   PRODUCT DETAILS PAGE STYLES
   ======================================== */

/* Breadcrumb */
.breadcrumb-section {
  padding: 1.5rem 1.5rem;
  background: var(--surface-strong);
  border-bottom: 1px solid rgba(145, 158, 171, 0.1);
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.25s ease;
}

.breadcrumb-link:hover {
  color: var(--green-dark);
}

/* Product Details Section */
.product-details-section {
  padding: 3rem 1.5rem;
}

.product-details-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

/* Product Gallery */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gallery-main {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 252, 241, 0.5), rgba(236, 245, 255, 0.5));
  border-radius: 1.5rem;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  animation: fadeIn 0.6s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}


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

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.gallery-badge {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Thumbnails */
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
}

.thumbnail {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.thumbnail:hover {
  border-color: var(--blue);
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Product Information */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.product-info h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.product-category {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--blue);
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 1rem;
}

.product-description {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
}

/* Product Sections */
.product-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-section h3 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Features List */
.features-list,
.applications-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.features-list li,
.applications-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
}

.features-list li:before,
.applications-list li:before {
  content: '✓';
  flex-shrink: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: -2px;
}

/* Specifications Table */
.specifications-table {
  background: var(--surface-strong);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(76, 175, 80, 0.14);
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(145, 158, 171, 0.1);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label,
.spec-value {
  padding: 1rem 1.25rem;
}

.spec-label {
  background: rgba(76, 175, 80, 0.05);
  font-weight: 600;
  color: var(--text);
}

.spec-value {
  color: var(--muted);
  display: flex;
  align-items: center;
}

/* Product Actions */
.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.product-actions .button {
  flex: 1 1 160px;
  min-width: 160px;
  min-height: 48px;
  padding: 0.9rem 1rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-actions .button.button-secondary,
.product-actions .button.button-primary {
  width: 100%;
}

/* Related Products Section */
.related-products {
  padding: 3rem 1.5rem;
  background: var(--surface-strong);
  border-top: 1px solid rgba(145, 158, 171, 0.1);
}

.related-products h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  .container-large {
    padding: 0 1rem;
  }

  .products-hero {
    padding: 2.75rem 1.25rem 3.5rem;
  }

  .products-hero h1 {
    font-size: 1.8rem;
  }

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

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

  .product-details-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-actions {
    grid-template-columns: 1fr;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .breadcrumb-section {
    padding: 0.85rem 1rem;
  }

  .breadcrumb-link {
    display: inline-flex;
    padding: 0.55rem 1rem;
    background: rgba(33, 150, 243, 0.08);
    border-radius: 999px;
    font-size: 0.9rem;
    transition: transform 0.15s ease, background 0.2s ease;
  }

  .breadcrumb-link:active {
    transform: scale(0.96);
    background: rgba(33, 150, 243, 0.16);
  }

  .product-info {
    gap: 0.6rem;
  }

  .product-info h1 {
    margin-bottom: 0;
  }

  .product-category {
    margin-bottom: 0;
  }

  .product-description {
    margin-bottom: 0.5rem;
  }

  .product-info > .product-section {
    margin-top: 1rem;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  .container-large {
    padding: 0 0.75rem;
  }

  .products-hero {
    padding: 2.25rem 1rem 3rem;
  }

  .products-hero h1 {
    font-size: 1.4rem;
  }

  .products-hero p {
    font-size: 0.95rem;
  }

  .search-box i {
    left: 0.75rem;
  }

  .search-input,
  .category-select {
    padding: 0.75rem 0.75rem 0.75rem 2.25rem;
    font-size: 16px; /* Prevents zoom on focus */
  }

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

  .product-card .image-wrapper {
    min-height: 170px;
  }

  .product-card-content {
    padding: 1rem;
    gap: 0.75rem;
  }

  .product-name {
    font-size: 1.05rem;
  }

  .card-actions {
    gap: 0.75rem;
  }

  .btn-details,
  .btn-quote {
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
  }
}

/* Extra small phones: keep Similar Products buttons side by side, no text wrap */
@media (max-width: 600px) {
  .product-card-buttons {
    gap: 0.5rem;
  }

  .btn-details,
  .btn-quote {
    padding: 0.6rem 0.4rem;
    font-size: 0.78rem;
    gap: 0.35rem;
    white-space: nowrap;
  }

  .btn-details i,
  .btn-quote i {
    font-size: 0.85rem;
  }
}

/* ========================================
   ACCESSIBILITY & ANIMATIONS
   ======================================== */

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .search-input,
  .category-select,
  .btn-details,
  .btn-quote,
  .thumbnail,
  .product-image,
  .social-link {
    transition: none;
  }

  .gallery-main {
    animation: none;
  }
}

/* Focus styles for keyboard navigation */
.search-input:focus,
.category-select:focus,
.button:focus,
.btn-details:focus,
.btn-quote:focus,
.thumbnail:focus,
.breadcrumb-link:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Lazy loading image placeholder */
img[data-src] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

img[data-src].loaded {
  animation: none;
  background: none;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-card .image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 220px;
  overflow: hidden;
  background: #f7f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.product-card .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-actions {
  display: flex;
  flex-direction: row;
  gap: 0.6rem;
  margin-top: auto;
}

.card-actions .button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 0.6rem 0.6rem;
  font-size: 0.85rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-actions .button.button-secondary,
.card-actions .button.button-primary {
  width: auto;
}
