:root {
  --primary: #3930a2;
  --secondary: #36ce8a;
  --light-bg: #f8fafb;
  --card-bg: #fff;
  --text: #252537;
}
body {
  font-family: 'Inter', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--light-bg);
  color: var(--text);
}
.header {
  background: var(--card-bg);
  padding: 1.5rem 4vw 1rem 4vw;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  border-bottom: 1.5px solid #eceef4;
  width: 100%;
}
.logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -.01em;
  display: flex; 
  align-items: center; 
  gap: .55rem;
  text-decoration: none;
}
.logo img {
  width: 98px; height: 98px;
  border-radius: 50%;
  margin-right: 15px;
  background: var(--card-bg);
  box-shadow: 0 2px 8px #ccc2;
  vertical-align: middle;
}
.logo span { 
  color: var(--secondary); 
 }
.search-bar {
  margin-left: 3vw;
  flex: 1;
  display: flex; 
  align-items: center;
  background: #f3f6fa;
  border-radius: 1.2rem;
  padding: .7rem 1.2rem;
  font-size: 1rem;
  border: 1.2px solid #e0e7f1;
  max-width: 400px;
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
}
.header-nav {
  margin-left: auto;
  display: flex;
  gap: 1.3rem;
}
.header-nav a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.02rem;
  opacity: .86;
  transition: .2s;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.header-nav a.active,
.header-nav a:hover {
  color: var(--secondary);
  border-bottom: 2px solid var(--secondary);
  opacity: 1;
}
.main-content {
  display: flex;
  gap: 2.7vw;
  max-width: 1300px;
  margin: 3vw auto 0 auto;
  padding: 0 2vw;
}
.sidebar {
  min-width: 210px;
  max-width: 270px;
  background: var(--card-bg);
  border-radius: 1.3rem;
  box-shadow: 0 4px 20px #bfc7e821;
  padding: 2.2rem 1.3rem 2rem 1.3rem;
  height: max-content;
}
.sidebar h3 {
  font-size: 1.01rem;
  color: var(--primary);
  margin-bottom: .6rem;
  font-weight: 700;
  border-bottom: 1.5px solid #f2f4fa;
  padding-bottom: .45rem;
}
.sidebar ul {
  list-style: none;
  padding: 0; margin: 0;
}
.sidebar li { 
  margin-bottom: 1.1rem; 
}
.sidebar a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: .16s;
  border-radius: .8rem;
  padding: .25em .7em;
  display: inline-block;
}
.sidebar a.active,
.sidebar a:hover {
  background: rgba(54, 206, 138, 0.07);
  color: var(--primary);
}
.catalog {
  flex: 1;
}
.catalog-header {
  margin-bottom: 1vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.catalog-header h2 {
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--primary);
}
.catalog-header select {
  padding: .36em 1.2em;
  border-radius: .9em;
  border: 1px solid #e0e7f1;
}
/* --------- Katalog Grid 3 Kolom Fixed --------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* Selalu 3 kolom di desktop */
  gap: 1.8rem;
  justify-items: stretch;
  align-items: stretch;
  min-height: 280px;
  max-width: 1050px;
  margin: 0 auto;
  width: 100%;
}
.product-card {
  background: var(--card-bg);
  border-radius: 1.3rem;
  box-shadow: 0 6px 32px #8ed3b416;
  padding: 1.1rem .7rem 1rem .7rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 262px;
  position: relative;
  transition: .13s;
}
.product-card:hover {
  box-shadow: 0 12px 40px rgba(54, 206, 138, .14);
  transform: translateY(-3px) scale(1.013);
}
.favorite-btn {
  position: absolute;
  top: 15px;
  right: 18px;
  background: var(--card-bg);
  border-radius: 50%;
  border: 1.1px solid #f0f1fa;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: #b2b5c4; font-size: 1.23rem; cursor: pointer;
  transition: .14s;
}
.favorite-btn.active,
.favorite-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}
.prod-img {
  width: 100%; height: 110px;
  background: #f4f8ff;
  border-radius: .9em;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .7em; color: #b0b0c7; font-size: 1.6rem;
  border: 1.2px solid #eceef4;
}
.prod-img img {
  max-width: 100%; max-height: 80px;
}
.prod-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: .33em;
}
.prod-harga {
  color: var(--secondary);
  font-weight: 800;
  font-size: 1.06rem;
  margin-bottom: .18em;
}
.prod-lokasi {
  font-size: .94rem;
  color: #6b7b9b;
  margin-bottom: .7em;
}
.detail-btn {
  background: var(--secondary);
  color: #fff;
  font-weight: 700;
  padding: .59em 1.4em;
  border-radius: 1.1em;
  text-decoration: none;
  border: none;
  transition: .11s;
  font-size: .96rem;
  margin-top: auto;
  display: inline-block;
}
.detail-btn:hover { background: #269d69; }
#footer, footer {
  margin-top: 2vw;
  color: #6b7b9b;
  font-size: .96rem;
  padding: 12px 4px;
  text-align: center;
}
/* ----------- RESPONSIVE ----------- */
@media (max-width: 1100px) {
  .catalog-grid {
    max-width: 98vw;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 95vw;
  }
}
@media (max-width: 480px) {
  .header {
    flex-direction: column;
    padding: 1rem 16px;
    gap: 12px;
  }
  .logo {
    font-size: 1.5rem;
    gap: 6px;
  }
  .logo img {
    width: 50px !important;
    height: 50px !important;
  }
  .search-bar {
    width: 100%;
    margin-left: 0;
    padding: .3rem .3rem .3rem 1rem;
  }
  .header-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    background: #fff;
    border-top: 1.5px solid #eceef4;
    box-shadow: 0 -2px 12px #8ed3b415;
    z-index: 999;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 0 2vw;
    min-height: 54px;
    height: 54px;
    align-items: center;
  }
  .header-nav a {
    flex: 1;
    text-align: center;
    font-size: 1.07rem;
    padding: 9px 0 7px 0;
    border: none;
    border-bottom: none !important;
    border-radius: 0;
    background: none;
    transition: .2s;
    opacity: 1;
    color: #3930a2;
    font-weight: 700;
  }
  .header-nav a.active,
  .header-nav a:active,
  .header-nav a:focus {
    background: #36ce8a15;
    color: #36ce8a;
    border: none;
  }
  .header {
    padding-bottom: 62px;
  }
  .sidebar {
    width: 100%;
    max-width: 100vw;
    min-width: unset;
    border-radius: .7rem;
    padding: .2rem .4rem .2rem .4rem;
    margin-bottom: 6px;
    box-shadow: none;
    background: transparent;
    overflow-x: auto;
    white-space: nowrap;
  }
  .sidebar h3 { display: none; }
  .sidebar ul {
    display: flex;
    flex-wrap: nowrap;
    gap: .6rem;
    padding-bottom: .1rem;
    width: max-content;
    margin: 0 auto;
  }
  .sidebar li { margin-bottom: 0; }
  .sidebar a {
    font-size: .93rem;
    padding: .2em .7em;
    white-space: nowrap;
    border-radius: .7em;
    border: 1px solid #eceef4;
    background: var(--card-bg);
  }
  .sidebar a.active,
  .sidebar a:hover {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
  }
  .main-content {
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin-top: 8px;
  }
  .catalog-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 12px;
  }
  .catalog-header h2 {
    font-size: 1rem;
    margin: 0;
  }
  .catalog-header select {
    max-width: 140px;
    font-size: .9rem;
  }
  .catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px 16px 16px;
  }
  .product-card {
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    min-height: 280px;
    /* PERUBAHAN: Mengatur semua elemen di dalamnya agar ke tengah */
    display: flex;
    flex-direction: column;
    align-items: center; /* Membuat item (termasuk tombol) menjadi center secara horizontal */
    text-align: center;   /* Membuat semua teks menjadi center */
  }
  .prod-img {
    height: 100px;
    width: 100%; /* Pastikan gambar memenuhi lebar card */
    border-radius: 8px;
    margin-bottom: 12px;
  }
  .prod-img svg {
      width: 40px;
      height: 40px;
  }
  .prod-title {
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
    white-space: normal;
    height: 40px;
    overflow: hidden;
  }
  .prod-harga {
    font-size: .80rem; 
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--secondary-color);
  }
  .prod-lokasi {
    font-size: .8rem;
    margin-bottom: 12px;
  }
  .detail-btn {
    padding: .38em .91em;
    font-size: .88rem;
    border-radius: .6em;
    margin-top: .1em;
    font-weight: 600;
    background: var(--secondary);
    color: #fff;
    border: none;
    outline: none;
    text-align: center;
    display: inline-block;
  }
  .detail-btn:hover {
    background: #2fa471;
  }
  .favorite-btn {
    top: 10px;
    right: 10px;
    width: 21px;
    height: 21px;
    font-size: .94rem;
  }
}