/* Product Grid (Firebird) */

.product-archive {
  max-width: 1320px;
  margin-inline: auto;
  padding: 0 0 3rem;
  /*font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif;*/
}

.pa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.4rem;
}

.pa-title {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  color: #fbf7ff;
}

.pa-left {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.pa-filter-badge {
  background: #160b22;
  border: 1px solid #5b2a78;
  padding: .45rem .6rem;
  border-radius: 8px;
  font-size: .7rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  line-height: 1;
  color: #a855f7;
}
.pa-filter-badge strong { color: #fbf7ff; }
.pa-filter-badge .clear {
  display: inline-block;
  text-decoration: none;
  background: #2b143d;
  color: #a855f7;
  font-weight: 600;
  padding: 0 .35rem .05rem;
  border-radius: 4px;
  transition: .2s;
  font-size: .75rem;
  line-height: 1;
}
.pa-filter-badge .clear:hover { background: #2b143d; color: #fbf7ff; }

.pa-right {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.pa-search {
  display: flex;
  gap: .5rem;
  align-items: center;
  background: #160b22;
  border: 1px solid #5b2a78;
  padding: .4rem .5rem;
  border-radius: 8px;
}
.pa-search input[type=text] {
  border: 0;
  outline: none;
  font-size: .8rem;
  padding: .35rem .4rem;
  min-width: 200px;
}
.pa-search button {
  background: #8b5cf6;
  border: 0;
  color: #fbf7ff;
  font-size: .7rem;
  padding: .45rem .75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .3px;
  transition: .25s;
}
.pa-search button:hover { background: #6d28d9; }

.pa-sort {
  display: flex;
  gap: .4rem;
  align-items: center;
  font-size: .7rem;
  background: #160b22;
  border: 1px solid #5b2a78;
  padding: .4rem .55rem;
  border-radius: 8px;
}
.pa-sort select {
  font-size: .75rem;
  padding: .35rem .5rem;
  border: 1px solid #5b2a78;
  border-radius: 6px;
  background: #160b22;
  outline: none;
}

.pa-empty {
  border: 1px dashed #5b2a78;
  padding: 3rem 1rem;
  text-align: center;
  border-radius: 12px;
  background: #160b22;
}
.pa-empty p {
  margin: 0 0 1rem;
  font-size: .9rem;
  color: #a855f7;
}
.btn-reset {
  display: inline-block;
  background: #8b5cf6;
  color: #fbf7ff;
  font-size: .7rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .4px;
  transition: .25s;
}
.btn-reset:hover { background: #6d28d9; }

/* Grid */
.pa-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  align-items: stretch;
}

.pa-card {
  background: #160b22;
  border: 1px solid #5b2a78;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: .28s cubic-bezier(.4,0,.2,1);
  min-width: 0;
  padding: 0;
}
.pa-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px -8px rgba(0,0,0,0.15);
  border-color: #5b2a78;
}

.pa-card .thumb {
  aspect-ratio: 1/1;
  background: #160b22;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.pa-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.badge-disc {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #9333ea;
  color: #fbf7ff;
  font-size: .6rem;
  padding: 4px 6px 3px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: .4px;
}

.pa-card .body {
  padding: .65rem .7rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-height: 90px;
}

.pa-card .title {
  font-size: .75rem;
  line-height: 1.25;
  margin: 0;
  font-weight: 600;
  color: #fbf7ff;
  height: 2.4em;
  overflow: hidden;
}

.pa-card .prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem;
}
.pa-card .prices .final {
  font-size: .83rem;
  font-weight: 700;
  color: #8b5cf6;
}
.pa-card .prices .ori {
  font-size: .63rem;
  text-decoration: line-through;
  color: #a855f7;
  font-weight: 500;
}

.pa-card .cat {
  margin-top: auto;
  font-size: .55rem;
  letter-spacing: .6px;
  text-transform: uppercase;
  background: #160b22;
  border: 1px solid #5b2a78;
  padding: .28rem .45rem .25rem;
  border-radius: 20px;
  font-weight: 600;
  color: #a855f7;
  align-self: flex-start;
}
.pa-card .meta-line {
    margin-top: 4px;
    font-size: .65rem;
    color: #a855f7;
}
.pa-card .meta-line .sold {
    display: inline-block;
    background: #160b22;
    padding: 2px 6px 3px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #fbf7ff;
}

/* Pagination */
.pa-pagination {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  font-size: .7rem;
  align-items: center;
}
.pa-pagination a,
.pa-pagination span {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  padding: 0 .6rem;
  box-sizing: border-box;
  border: 1px solid #5b2a78;
  background: #160b22;
  color: #fbf7ff;
  transition: .25s;
}
.pa-pagination a:hover {
  background: #160b22;
  color: #fbf7ff;
}
.pa-pagination .current {
  background: #8b5cf6;
  color: #fbf7ff;
  border-color: #8b5cf6;
}
.pa-pagination .gap {
  border: none;
  background: transparent;
  font-weight: 400;
  color: #a855f7;
}

/* =============== Mobile Filter Bar (Tokopedia-like) =============== */
.pa-mobile-filterbar{display: none}
@media (max-width: 640px){
  /* sembunyikan tombol lama */
  .pa-btn-filter{display: none}

  .pa-mobile-filterbar{
    display: block;
    position: sticky;
    top: 0; /* sesuaikan jika ada header fixed di atas */
    z-index: 5;
    background: #160b22;
    border-bottom: 1px solid #5b2a78;
    padding: .4rem .5rem;
    margin: -.4rem -1rem .6rem; /* full-bleed di container mobile */
  }
  .pa-mobile-filterbar .mf-scroll{
    display: flex;align-items: center;gap: .5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pa-mobile-filterbar .mf-scroll::-webkit-scrollbar{display: none}

  .mf-chip{
    flex: 0 0 auto;
    background: #160b22;
    color: #fbf7ff;
    text-decoration: none;
    border: 1px solid #5b2a78;
    border-radius: 999px;
    padding: .44rem .7rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
  }
  .mf-chip:active{transform: scale(.98)}
  .mf-chip.active{
    background: #211032;
    border-color: #8b5cf6;
    color: #8b5cf6;
  }

  .mf-filter-btn{
    position: relative;
    flex: 0 0 auto;
    width: 38px;height: 38px;
    border-radius: 50%;
    border: 1.5px solid #8b5cf6;
    background: #160b22;
    display: inline-flex;align-items: center;justify-content: center;
    color: #8b5cf6;
    cursor: pointer;
  }
  .mf-filter-btn:active{transform: scale(.96)}
  .mf-filter-btn svg{width: 18px;height: 18px;display: block}
  .mf-filter-btn .mf-badge{
    position: absolute;top: 0;right: -4px;
    min-width: 18px;height: 18px;border-radius: 9px;
    background: #a855f7;color: #fbf7ff;
    font-size: .65rem;font-weight: 700;
    display: flex;align-items: center;justify-content: center;
    padding: 0 4px;line-height: 1;
    box-shadow: 0 2px 6px -2px rgba(168,85,247,0.6);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .product-archive { padding: 0 1rem 3rem; }
  .pa-grid { grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); }
  .pa-search input[type=text]{ min-width: 140px; }
  .pa-toolbar { flex-direction: column; align-items: stretch; margin-bottom: 0; display: none;}
  .pa-right { display: none; }
  .pa-sort { width: 100%; justify-content: center; }
  .pa-mobile-filterbar { display: flex !important; }
}

.pa-mobile-filterbar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 0 8px 12px;
  background: #160b22;
  width: 100vw;
}
.pa-mobile-filterbar .mf-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  flex: 1 1 auto; /* takes remaining width */
}
.pa-mobile-filterbar .mf-scroll::-webkit-scrollbar { display: none; } /* WebKit */
.pa-mobile-filterbar .mf-chip {
  flex: 0 0 auto; /* prevent shrinking, keep width based on content */
  white-space: nowrap;
}
.pa-mobile-filterbar .mf-filter-btn {
  flex: 0 0 auto; /* do not shrink */
  position: relative; /* keep in place, not inside scroller */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Optional: ensure on small screens the button stays visible with min width */
@media (max-width: 768px) {
  .pa-mobile-filterbar .mf-filter-btn {
    padding: 6px 10px;
  }
}

/* Product Specification Chips */
.pa-card .spec-chips {
  font-size: .6rem;
  color: #a855f7;
  font-weight: 500;
  letter-spacing: .2px;
  margin-top: 2px;
  margin-bottom: 4px;
  line-height: 1.2;
  opacity: 0.9;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa-card .spec-chips .spec-divider {
  color: #a855f7;
  font-weight: 400;
  margin: 0 1px;
}