/* =========================================
   HDPE Products Page Styles
   Modern, visually appealing design
   ========================================= */

/* =========================================
   Page Header
   ========================================= */

.page-header {
  position: relative;
  padding: 6rem 0 4rem;
  background: linear-gradient(135deg, var(--primary-dark, #083562) 0%, var(--primary-color, #0e4a86) 50%, var(--primary-light, #1a6fc2) 100%);
  color: white;
  text-align: center;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(13, 148, 136, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, rgba(248, 250, 252, 1), transparent);
  pointer-events: none;
}

.page-header h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.page-header p {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.3rem;
  line-height: 1.7;
  opacity: 0.95;
}

/* =========================================
   Filter Section
   ========================================= */

.filter-section {
  position: relative;
  z-index: 10;
  padding: 2rem 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.filter-btn {
  position: relative;
  padding: 0.75rem 1.75rem;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--primary-color, #0e4a86), var(--secondary-color, #0d9488));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--primary-color, #0e4a86);
  color: var(--primary-color, #0e4a86);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 74, 134, 0.15);
}

.filter-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-color, #0e4a86), var(--secondary-color, #0d9488));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 74, 134, 0.3);
}

.filter-btn.active::before {
  opacity: 1;
}

/* =========================================
   Products Container & Grid
   ========================================= */

.products-main-container {
  min-height: 60vh;
  padding: 3rem 0 5rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 30%, #f1f5f9 100%);
}

.products-wrapper {
  width: 100%;
  padding: 0 2rem;
}

.products-content-full {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 340px));
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  margin: 2rem 0;
  padding: 0;
}

/* =========================================
   Product Card
   ========================================= */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: 100%;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 10px 40px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: fadeInUp 0.6s ease-out backwards;
  text-decoration: none;
  color: inherit;
}

/* Gradient accent line */
.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color, #0e4a86), var(--secondary-color, #0d9488), var(--accent-color, #0891b2));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-card > * {
  position: relative;
  z-index: 2;
}

.product-card:hover {
  border-color: rgba(14, 74, 134, 0.2);
  transform: translateY(-16px) scale(1.02);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.12),
    0 15px 30px rgba(14, 74, 134, 0.08);
}

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

.product-card:focus,
.product-card:focus-within {
  outline: none;
}

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

/* =========================================
   Product Image Container
   ========================================= */

.product-image-container {
  position: relative;
  width: 100%;
  height: 320px;
  background: linear-gradient(145deg, #f8fafc, #e2e8f0);
  overflow: hidden;
}

.product-image-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 60px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-image-container::after {
  opacity: 1;
}

/* =========================================
   Image Carousel
   ========================================= */

.image-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .carousel-slide img {
  transform: scale(1.08);
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.product-image-container:hover .carousel-nav {
  opacity: 1;
}

.carousel-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.carousel-nav:focus {
  outline: none;
}

.carousel-nav.show-temporarily {
  opacity: 1 !important;
}

/* Arrow icons */
.carousel-nav::after {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid #374151;
  border-left: none;
  border-bottom: none;
  transition: all 0.3s ease;
}

.carousel-prev::after {
  margin-left: 3px;
  transform: rotate(-135deg);
}

.carousel-next::after {
  margin-right: 3px;
  transform: rotate(45deg);
}

.carousel-nav:hover::after {
  border-color: var(--primary-color, #0e4a86);
}

.carousel-nav i {
  display: none;
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 12px;
  left: 50%;
  z-index: 5;
  display: flex;
  gap: 6px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  transform: translateX(-50%);
  box-shadow: none;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

.carousel-dot.active {
  width: 16px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}

.carousel-dot:focus {
  outline: none;
}

/* =========================================
   Product Content
   ========================================= */

.product-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.75rem;
  background: white;
}

.product-header {
  margin-bottom: 1rem;
}

.product-name {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.3px;
  color: #1e293b;
  transition: color 0.3s ease;
}

.product-card:hover .product-name {
  color: var(--primary-color, #0e4a86);
}

.product-category {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 20px;
  color: var(--secondary-color, #0d9488);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.product-category::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--secondary-color, #0d9488);
  border-radius: 50%;
}

.product-card:hover .product-category {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-color, #0e4a86), var(--secondary-color, #0d9488));
  color: white;
}

.product-card:hover .product-category::before {
  background: white;
}

/* Product Intro */
.product-intro {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  position: relative;
  margin: 1rem 0;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.65;
  color: #64748b;
}

/* Product Meta */
.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.capacity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-dark, #083562), var(--primary-color, #0e4a86));
  border-radius: 8px;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(14, 74, 134, 0.25);
  transition: all 0.3s ease;
}

.capacity-badge::before {
  content: '📦';
  font-size: 0.7rem;
}

.capacity-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(14, 74, 134, 0.35);
}

/* Product Capacity Info - Simplified Display */
.product-capacity-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.product-capacity-info .capacity-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-capacity-info .capacity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.product-capacity-info .capacity-tag {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
}

.product-capacity-info .capacity-values {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-color, #0e4a86);
  line-height: 1.5;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.meta-divider {
  flex: 0 0 1px;
  height: 16px;
  margin: 0 6px;
  background: #e2e8f0;
}

.quick-detail {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-detail i {
  color: var(--primary-color, #0e4a86);
}

/* Card Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}

.cta-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: #e0f2f1;
  border-radius: 25px;
  color: var(--primary-color, #0e4a86);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.product-card:hover .cta-inline {
  background: linear-gradient(135deg, var(--primary-color, #0e4a86), var(--secondary-color, #0d9488));
  color: white;
  transform: translateX(4px);
}

.cta-inline i {
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.product-card:hover .cta-inline i {
  transform: translateX(4px);
}

/* Legacy styles - hidden */
.product-introduction,
.product-intro-text {
  display: none;
}

/* =========================================
   Loading & Error States
   ========================================= */

.loading-message,
.error-message {
  grid-column: 1 / -1;
  max-width: 500px;
  margin: 2rem auto;
  padding: 5rem 2rem;
  background: white;
  border-radius: 24px;
  color: #64748b;
  font-size: 1.2rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.loading-message::before {
  content: '';
  display: block;
  width: 50px;
  height: 50px;
  margin: 0 auto 1.5rem;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary-color, #0e4a86);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  text-align: center;
}

.no-results-icon {
  margin-bottom: 1.5rem;
  font-size: 4rem;
  color: #cbd5e1;
}

.no-results h3 {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  color: #475569;
}

.no-results p {
  font-size: 1.1rem;
  color: #94a3b8;
}

/* No Products Message */
.no-products-message {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 600px;
  margin: 3rem auto;
  padding: 4rem 2rem;
  background: white;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  animation: fadeInUp 0.5s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.no-products-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.no-products-content i {
  font-size: 4rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
  display: block;
}

.no-products-content h3 {
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #334155;
}

.no-products-content p {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #64748b;
  line-height: 1.6;
}

.no-products-content p strong {
  color: var(--primary-color, #0e4a86);
}

.no-products-content .view-all-btn {
  margin-top: 2rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary-color, #0e4a86) 0%, var(--primary-dark, #083562) 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(14, 74, 134, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.no-products-content .view-all-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(14, 74, 134, 0.4);
  background: linear-gradient(135deg, var(--primary-light, #1a6fc2) 0%, var(--primary-color, #0e4a86) 100%);
}

.no-products-content .view-all-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(14, 74, 134, 0.3);
}

/* =========================================
   Animations
   ========================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================
   Responsive Styles
   ========================================= */

@media (min-width: 768px) {
  .products-wrapper {
    padding: 0 3rem;
  }
}

@media (min-width: 900px) {
  .products-grid {
    gap: 1.75rem;
  }
}

@media (min-width: 1200px) {
  .products-wrapper {
    padding: 0 4rem;
  }

  .products-grid {
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 4rem 0 3rem;
  }

  .page-header h1 {
    font-size: 2.25rem;
  }

  .page-header p {
    padding: 0 1rem;
    font-size: 1.1rem;
  }

  .filter-section {
    position: relative;
    top: 0;
    padding: 1.5rem 0;
  }

  .filter-controls {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }

  .products-main-container {
    padding: 2rem 0 3rem;
  }

  .products-grid {
    gap: 1.5rem;
  }

  .product-card {
    width: 340px;
    border-radius: 20px;
  }

  .product-image-container {
    height: 280px;
  }

  .product-content {
    padding: 1.25rem;
  }

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

  .carousel-indicators {
    gap: 5px;
  }

  .carousel-dot.active {
    width: 14px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.85rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }

  .product-card {
    width: 100%;
  }

  .product-image-container {
    height: 260px;
  }

  .product-category {
    padding: 0.35rem 0.8rem;
    font-size: 0.7rem;
  }

  .capacity-badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
  }

  .cta-inline {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* =========================================
   Accessibility
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  .product-card {
    animation: none;
  }

  .carousel-slides,
  .carousel-slide img,
  .carousel-nav {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  .product-card {
    border: 2px solid #000;
  }

  .carousel-nav {
    background: #fff;
    border: 2px solid #000;
  }

  .filter-btn {
    border: 2px solid #000;
  }
}

/* =========================================
   Touch Devices
   ========================================= */

@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
  }

  .product-card:active {
    transform: scale(0.98);
  }

  .carousel-nav {
    width: 36px;
    height: 36px;
    opacity: 1;
  }

  .carousel-prev { left: 8px; }
  .carousel-next { right: 8px; }

  .filter-btn:hover {
    transform: none;
  }

  .filter-btn:active {
    transform: scale(0.95);
  }
}

/* =========================================
   Print Styles
   ========================================= */

@media print {
  .filter-section,
  .carousel-nav,
  .carousel-indicators {
    display: none;
  }

  .product-card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }

  .page-header {
    background: #333;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

