:root {
  --primary-blue: #007bff;
  --secondary-blue: #0056b3;
  --white: #ffffff;
  --light-gray: #f5f5f5;
  --dark-gray: #333333;
  --card-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
  /* Keep orange variables for backward compatibility */
  --primary-orange: #007bff;
  --secondary-orange: #0056b3;
}

/* Fix untuk menghilangkan space kosong */
.product-cards-container {
  font-family: 'Poppins', sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  overflow: hidden;
}

.product-slider-nav .material-icons {
    font-size: 36px;
    line-height: 1;
}

/* Hide pseudo elements */
.product-slider-nav::before {
    display: none !important;
}
  
.product-slider-container {
  position: relative;
  overflow: hidden;
  margin: 10px 0;
  border-radius: 12px;
  height: auto !important;
  max-width: 100%;
}

.product-slider-wrapper {
  display: flex;
  transition: transform 0.3s ease;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  align-items: flex-start;
}

.product-slider-slide {
  min-width: 100%;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0 10px;
  margin: 0;
  height: auto !important;
  min-height: 0 !important;
  gap: 20px;
}

.product-mobile-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 100%;
  padding: 0 15px;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0; /* Menghilangkan margin yang tidak perlu */
  height: auto; /* Mengizinkan tinggi menyesuaikan konten */
}

.product-mobile-card-container {
  width: 100%;
  display: block;
  height: 100%; /* Memastikan container mengisi tinggi penuh */
}

.product-desktop-slide {
  justify-content: space-between;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
  min-width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0 10px;
  margin: 0;
  height: auto !important;
  min-height: 0 !important;
  gap: 20px;
}

/* CSS untuk menangani jumlah produk yang berbeda */
.product-desktop-slide {
  justify-content: flex-start !important;
  gap: 20px;
  padding: 0 10px;
}

/* Desktop specific slide styles */
.product-desktop-slide {
  justify-content: flex-start !important;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
  min-width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0 10px;
  margin: 0;
  gap: 24px;
}

/* Styling untuk jumlah kartu yang berbeda */
.product-desktop-slide.products-4 .product-card {
  flex: 0 0 calc(25% - 18px);
  max-width: calc(25% - 18px);
}

.product-desktop-slide.products-3 .product-card {
  flex: 0 0 calc(25% - 18px);
  max-width: calc(25% - 18px);
}

.product-desktop-slide.products-2 .product-card {
  flex: 0 0 calc(25% - 18px);
  max-width: calc(25% - 18px);
}

.product-desktop-slide.products-1 .product-card {
  flex: 0 0 calc(25% - 18px);
  max-width: calc(25% - 18px);
}

/* Card Styling */
.product-card {
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 380px;
}

/* Mobile card styling */
.product-mobile-slide .product-card {
  flex-basis: 100%;
  max-width: 100%;
  width: 100%;
  margin: 0 0 20px;
  min-height: auto;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* Card Image Container */
.product-card-image-container {
  position: relative;
  width: 100%;
  height: 220px; /* Menyesuaikan tinggi gambar */
  overflow: hidden;
  background-color: #f5f5f5;
}

.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

.product-card:hover .product-card-image {
  transform: scale(1.05);
}

.product-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
}

.product-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background-color: #f5f5f5;
  color: #666;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* Card Content */
.product-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.product-card-title {
  color: #333;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-description {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Button Styling */
.product-card-button-container {
  text-align: center;
  margin-top: auto; /* Push button ke bottom */
  flex-shrink: 0;
}

.product-card-button {
  display: inline-block;
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  transition: background-color var(--transition-speed);
}

.product-card-button:hover {
  background-color: var(--secondary-blue);
  text-decoration: none;
  color: var(--white);
}

/* Navigation Arrows - Diperbaiki agar selalu terlihat */
.product-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: var(--primary-blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100; /* Increased z-index */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-speed);
  border: 2px solid var(--white);
  opacity: 0.9;
}

.product-slider-nav:hover {
  background-color: var(--secondary-blue);
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.product-slider-nav.prev {
  left: 15px;
}

.product-slider-nav.next {
  right: 15px;
}

/* Progress Bar */
.product-slider-progress {
  position: relative;
  height: 4px;
  background-color: rgba(0, 123, 255, 0.2);
  margin-top: 20px;
  border-radius: 2px;
  overflow: hidden;
}

.product-slider-progress-bar {
  height: 100%;
  background-color: var(--primary-blue);
  width: 0;
  transition: width 0.3s ease;
}

/* Section Header - Matching other sections */
.products-section .title-container {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding: 10px 0;
}

.products-section .subtitle {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--primary-blue);
  margin-bottom: 5px;
  text-transform: uppercase;
}

.products-section .sociarmy-main-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--dark-gray);
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.products-section .highlight {
  color: var(--primary-blue);
  position: relative;
  margin-left: 2px;
}

.products-section .section-description {
  font-size: 18px;
  color: #666;
  max-width: 800px;
  margin: 15px auto 0;
}

/* Keep existing section header styles for backward compatibility */
.product-section-header {
  text-align: center;
  margin-bottom: 40px;
}

.product-section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--dark-gray);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.product-section-description {
  font-size: 18px;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .product-card {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
    min-height: 360px;
  }
  
  .product-slider-nav {
    width: 45px;
    height: 45px;
  }
  
  .product-section-title {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .product-card {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
    min-height: 340px;
  }
  
  .product-slider-slide {
    padding: 0 10px;
    gap: 20px;
  }
  
  .product-desktop-slide {
    padding: 0 10px;
    gap: 24px;
  }
  
  .product-slider-nav {
    width: 40px;
    height: 40px;
  }
  
  .product-slider-nav.prev {
    left: 10px;
  }
  
  .product-slider-nav.next {
    right: 10px;
  }
  
  .product-section-title {
    font-size: 28px;
  }
  
  .product-section-description {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .product-card {
    flex-basis: 100%;
    max-width: 100%;
    margin: 0 0 20px;
    width: 100%;
    min-height: 320px;
  }
  
  .product-mobile-slide {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10px;
    margin: 0;
    width: 100%;
    min-width: 100%;
    gap: 0;
    height: auto !important;
  }
  
  .product-mobile-card-container {
    width: 100%;
    display: block;
    height: auto !important;
    margin-bottom: 0;
  }
  
  .product-mobile-slide .product-card {
    width: 100%;
    margin: 0 0 20px;
    height: auto !important;
  }
  
  .product-slider-slide {
    padding: 0 10px;
    gap: 20px;
    height: auto !important;
  }
  
  .product-desktop-slide {
    padding: 0 10px;
    gap: 20px;
    height: auto !important;
  }
  
  .product-card-image-container {
    height: 180px;
  }
  
  .product-slider-nav {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .product-slider-nav.prev {
    left: 5px;
  }
  
  .product-slider-nav.next {
    right: 5px;
  }
  
  /* Improve mobile experience */
  .product-cards-container {
    padding: 10px 0;
    overflow: hidden;
  }
  
  .product-slider-container {
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    height: auto !important;
  }
  
  .product-card-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .product-card-description {
    font-size: 14px;
    margin-bottom: 15px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  
  .product-card-content {
    padding: 15px;
    height: auto !important;
  }
  
  .product-card-button {
    min-width: 100px;
    padding: 8px 16px;
  }
  
  .product-section-title {
    font-size: 24px;
  }
  
  .product-section-title::after {
    width: 60px;
  }
  
  .product-section-description {
    font-size: 14px;
  }
}

/* CSS khusus untuk desktop */
@media (min-width: 577px) {
  .product-slider-wrapper {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible;
  }
  
  .product-slider-slide {
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
  }
  
  .product-desktop-slide {
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
  }
  
  .product-card {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 20px !important;
  }
  
  .product-slider-container {
    overflow: hidden !important;
    height: auto !important;
  }
  
  /* Pastikan semua kartu dalam satu baris memiliki tinggi yang sama */
  .product-desktop-slide .product-card {
    display: flex;
    flex-direction: column;
  }
  
  .product-desktop-slide .product-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }
  
  .product-desktop-slide .product-card-description {
    flex-grow: 1;
  }
}

@media (min-width: 577px) {
  .product-card {
    flex: 0 0 calc(25% - 18px) !important;
    max-width: calc(25% - 18px) !important;
    margin: 0 !important;
  }

  .product-desktop-slide {
    justify-content: flex-start !important;
    gap: 24px !important;
  }

  /* Memastikan lebar card tetap konsisten di desktop */
  .product-desktop-slide.products-1 .product-card,
  .product-desktop-slide.products-2 .product-card,
  .product-desktop-slide.products-3 .product-card,
  .product-desktop-slide.products-4 .product-card {
    flex: 0 0 calc(25% - 18px) !important;
    max-width: calc(25% - 18px) !important;
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .product-desktop-slide.products-3 .product-card,
  .product-desktop-slide.products-2 .product-card,
  .product-desktop-slide.products-1 .product-card {
    flex: 0 0 calc(25% - 18px);
    max-width: calc(25% - 18px);
  }
}

@media (max-width: 768px) {
  .product-desktop-slide.products-2 .product-card,
  .product-desktop-slide.products-1 .product-card {
    flex: 0 0 calc(25% - 18px);
    max-width: calc(25% - 18px);
  }
}
