* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  background-color: #4834d4;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
}

.logo-text {
  font-weight: bold;
  font-size: 16px;
}

.nav-icons {
  display: flex;
  gap: 12px;
}

.nav-icon {
  width: 35px;
  height: 35px;
  background-color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

/* Search & Filter Bar */
.search-container {
  position: relative;
  margin-bottom: 15px;
}

.search-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.search-input input {
  border: none;
  outline: none;
  padding: 6px 8px;
  width: 100%;
  font-size: 14px;
  color: #555;
}

.search-icon {
  color: #4834d4;
  margin-right: 8px;
}

.filter-btn {
  background-color: #4834d4;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  font-size: 13px;
}

.filter-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 12px;
  margin-top: 8px;
  z-index: 10;
  display: none;
}

.filter-panel.active {
  display: block;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 13px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-option {
  background-color: #f0f3ff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-option.active {
  background-color: #4834d4;
  color: white;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.filter-clear {
  background-color: #f0f3ff;
  color: #4834d4;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
}

.filter-apply {
  background-color: #4834d4;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
}

/* Featured Banner */
.featured-banner-container {
  position: relative;
  margin-bottom: 15px;
  border-radius: 12px;
  overflow: hidden;
}

.featured-banners {
  display: flex;
  transition: transform 0.5s ease;
}

.featured-banner {
  background: linear-gradient(135deg, #4834d4, #6c5ce7);
  color: white;
  min-width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
}

.banner-content {
  flex: 1;
}

.banner-badge {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  display: inline-block;
  margin-bottom: 6px;
}

.featured-banner h2 {
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: 600;
}

.featured-banner p {
  margin-bottom: 12px;
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.4;
}

.buy-btn {
  background-color: white;
  color: #4834d4;
  border: none;
  padding: 6px 12px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.product-image {
  width: 90px;
  height: 90px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 80%;
  height: auto;
}

.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.dot {
  width: 6px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
}

.dot.active {
  background-color: white;
  width: 16px;
  border-radius: 3px;
}

/* Category Section */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-all {
  color: #4834d4;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.category-item {
  background-color: white;
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s;
}

.category-item:hover {
  transform: translateY(-3px);
}

.category-icon {
  width: 40px;
  height: 40px;
  background-color: #f0f3ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.category-name {
  font-size: 10px;
  color: #333;
  margin-top: 3px;
  font-weight: 500;
}

.flash-sale {
  background-color: #ffecef;
}

.flash-sale .category-icon {
  background-color: #ffe0e5;
}

/* Products Section */
.products-container {
  margin-bottom: 20px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-3px);
}

.product-image-container {
  position: relative;
  height: 120px;
  background-color: #f0f3ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-container img {
  width: 60%;
  height: auto;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #4834d4;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.product-details {
  padding: 10px;
}

.product-category {
  font-size: 10px;
  color: #666;
  margin-bottom: 3px;
}

.product-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  color: #333;
}

.product-price {
  color: #4834d4;
  font-weight: 600;
  font-size: 13px;
}

/* Navigation Bar */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.nav-icon-container {
  color: #999;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .nav-icon-container {
  color: #4834d4;
}

.nav-label {
  font-size: 9px;
  color: #999;
}

.nav-item.active .nav-label {
  color: #4834d4;
  font-weight: 500;
}

/* Live chat */
.chat-icon {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: #4834d4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(72, 52, 212, 0.4);
  cursor: pointer;
  z-index: 99;
}

.chat-popup {
  position: fixed;
  bottom: 130px;
  right: 20px;
  width: 300px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  overflow: hidden;
  display: none;
}

.chat-popup.active {
  display: block;
}

.chat-header {
  background-color: #4834d4;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  font-weight: 600;
  font-size: 14px;
}

.close-chat {
  cursor: pointer;
  font-size: 18px;
}

.chat-messages {
  height: 250px;
  padding: 15px;
  overflow-y: auto;
}

.message {
  margin-bottom: 10px;
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.admin-message {
  background-color: #f0f3ff;
  color: #333;
  margin-right: auto;
  border-top-left-radius: 2px;
}

.user-message {
  background-color: #4834d4;
  color: white;
  margin-left: auto;
  border-top-right-radius: 2px;
}

.chat-input-container {
  padding: 10px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex-grow: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
}

.send-btn {
  background-color: #4834d4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  body {
    padding-bottom: 50px;
  }

  .featured-banner {
    height: 160px;
  }
}

@media (max-width: 576px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .category-name {
    font-size: 9px;
  }

  .featured-banner h2 {
    font-size: 16px;
  }

  .featured-banner p {
    font-size: 11px;
  }

  .header {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .nav-icons {
    justify-content: flex-end;
  }
}
/* Styling untuk container gambar produk */
.product-image-container {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transition: transform 0.3s ease;
}

.product-image-container:hover img {
  transform: scale(1.05);
}

/* Indikator loading yang dioptimalkan */
.product-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(240, 240, 240, 0.5);
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
  display: none; /* Sembunyikan secara default */
}

.product-image-container.loading::before {
  display: block; /* Tampilkan hanya saat loading */
}

/* Pastikan gambar yang sudah dimuat terlihat jelas */
.product-image-container.loaded::before {
  opacity: 0;
  pointer-events: none;
}

/* Modal Styles - Perbaikan */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-content {
  margin: auto;
  display: block;
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: 90vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  object-fit: contain;
  backface-visibility: hidden;
}

.modal.show .modal-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 1001;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.modal-close:hover {
  color: #f0f0f0;
  transform: scale(1.1);
}

/* Animasi loading untuk modal */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.show .modal-content.loading {
  animation: fadeIn 0.5s ease-in-out;
}

/* Responsive tweaks */
@media only screen and (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    max-height: 80vh;
  }

  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 32px;
  }
}

/* Sentuhan tambahan untuk memastikan tampilan yang baik */
img.product-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Menangani placeholder sementara gambar dimuat */
.product-image-container img.loading {
  opacity: 0.5;
}

.product-image-container img.loaded {
  opacity: 1;
}
/* Warna untuk kategori jasa */
.category-item[data-category='jasa'] .category-icon {
  background-color: #e6f8f0;
}

.category-item[data-category='jasa'] .category-icon svg {
  stroke: #20bf6b;
}
/* Warna untuk kategori kelas-privat */
.category-item[data-category="kelas-privat"] .category-icon {
  background-color: #e6f8f0;
}

.category-item[data-category="kelas-privat"] .category-icon svg {
  stroke: #f57d0c;
}

/* Styling khusus untuk cards layanan jasa */
.product-card.jasa-card {
  border-left: 3px solid #20bf6b;
}

.jasa-badge {
  background-color: #20bf6b !important;
}

.jasa-info {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 10px;
  color: #666;
}

.jasa-info svg {
  width: 12px;
  height: 12px;
  stroke: #20bf6b;
}
.logo-image {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  object-fit: contain;
  margin-right: 8px;
}
