/* ==============================
   Collection Section & Banner
   ============================== */
.collection-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.collection-banner {
  width: 100%;
  margin-bottom: 30px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.collection-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ==============================
   Kontrol: Search
   ============================== */
.controls {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 16px;
}
.search-container {
  position: relative;
  width: 280px;
  max-width: 100%;
}
.search-container .search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--primary);
  pointer-events: none;
}
.search-container input {
  width: 100%;
  padding: 10px 12px 10px 50px; /* ruang utk ikon */
  border: none;
  border-radius: 5px;
  background: #f2f2f2;
  box-shadow:
    inset 2px 2px 6px rgba(0,0,0,0.1),
    inset -2px -2px 6px rgba(255,255,255,0.7);
  font-size: 1rem;
  transition: box-shadow .3s, background .3s;
}
.search-container input::placeholder {
  color: #999;
  font-style: italic;
}
.search-container input:focus {
  outline: none;
  background: #fff;
  box-shadow:
    inset 1px 1px 3px rgba(0,0,0,0.1),
    0 0 6px var(--primary);
}

/* ==============================
   Layout: Sidebar kiri & Produk kanan
   ============================== */
.collection-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 0;
}
@media (max-width: 768px) {
  .collection-body {
    display: block;
  }
}

/* ==============================
   Sidebar Controls (kosong untuk fitur lain)
   ============================== */
.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==============================
   Produk Grid
   ============================== */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 1024px) {
  .product-list { gap: 8px; }
}
@media (max-width: 768px) {
  .product-list {
    grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
    gap: 6px;
  }
}

/* Card Outline & Hover */
.product-list li {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  transition: border-color .3s ease;
}
.product-list li::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 2px solid transparent;
  border-radius: 8px;
  box-sizing: border-box;
  pointer-events: none;
  transition: border-color .3s ease;
}
.product-list li:hover::after {
  border-color: var(--primary);
}

/* Product Card Inner */
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 5px;
  box-sizing: border-box;
  height: 100%;
}
.product-card .img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  border-radius: 4px;
}
.product-card .img-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .4s ease;
}
.product-card .img-secondary { opacity: 0; }
.product-card:hover .img-secondary { opacity: 1; }
.product-card:hover .img-primary  { opacity: 0; }
.product-card h3 {
  margin: 8px 0 0;
  font-size: 1rem;
  text-align: center;
  color: #333;
}

/* ==============================
   FULL-BLEED OVERRIDES
   ============================== */
/* 1) container jadi full width tanpa padding */
#collection .container {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* 2) hilangkan space horizontal di .controls */
.controls {
  margin-left: 0;
  margin-right: 0;
  padding-left: 16px;
  padding-right: 16px;
}
/* 3) grid tetap gap antar kolom, tapi mulai dari tepi */
.collection-body {
  margin-left: 0;
  margin-right: 0;
  padding-left: 10px;
  padding-right: 10px;
}
/* 4) beri padding ringan di product-list agar card tak nempel sepenuhnya */
.product-list {
  padding: 0 16px 16px;
}
/* Mobile: jaga agar tidak overflow */
@media (max-width: 768px) {
  .controls,
  .product-list {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ==============================
   Badge Styles
   ============================== */
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 4px;
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.badge-new {
  background-color: #28a745; /* Green */
}
.badge-best-seller {
  background-color: #17a2b8; /* Teal */
}
.badge-sale {
  background-color: #dc3545; /* Red */
}