/* =========================================================
   LISTING PAGE – cleaned 2025-07-13
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Plus Jakarta Sans:wght@400;600&display=swap');

/* ---------- Root & Reset -------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  /* palette + scale */
  --bg: #fbf9f9;
  --text: #1d1103;
  --accent: #a50404;
  --accent-dark: #b69a74;
  --glass: #141313;
  --glass-alpha: .92;
  --blur: 16px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, .05);
  --nav-h: 80px;
  --filter-width: 280px;
  /* navbar height */
}

/* ---------- Base type & links --------------------------- */
html {
  scroll-behavior: smooth
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 1px;
  overflow-x: hidden;
}

a {
  color: #6d5e56;
  text-decoration: none;
  transition: color .25s
}

a:hover {
  color: #e0d9d5
}


/* ---------- Header Divider ------------------------------ */
.header-divider {
  position: sticky;
  margin-top: var(--nav-h);
  /* aligns with nav height */
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem .75rem;
  background-color: #121111;
  min-height: 32px;
  margin-left: var(--filter-width, 240px);
  /* aligns with filter-bar width */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-divider h1 {
  font-size: 1.2rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  flex: 1;
  text-align: center;
  color: #ffffff;
}

/* Back button */
.header-divider button {
  background: #121111e3;
  color: #ffffff;
  border-radius: 150px;
  border: none;
  padding: 0.25rem;
  margin-right: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-divider button:hover {
  background: rgba(233, 229, 229, 0.838);
  border-radius: 50%;
  transform: scale(1.05);
}

.header-divider button svg {
  stroke: currentColor;
  width: 36px;
  height: 36px;
}

/* Responsive */
@media (max-width: 992px) {
  .header-divider {
    margin-left: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 56px;
    justify-content: flex-start;
  }

  .header-divider h1 {
    font-size: 1.5rem;
    text-align: center;
    flex: 1;
  }

  .header-divider button {
    margin-right: 0.5rem;
  }
}

/* === Desktop: fixed-size, scrollable === */
.chip-bar {
  display: flex;
  gap: 1.5rem;
  padding: .65rem .85rem;
  align-items: stretch;
  justify-content: center;
  background: #121111;
  overflow-x: auto;
  margin-left: var(--filter-width, 240px);
}

.chip {
  flex: 0 0 auto;
  min-width: 160px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 .75rem 'Plus Jakarta Sans', sans-serif;
  color: #fff;
  background: #121111;
  border: 1px solid #2a2727d1;
  border-radius: 36px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.chip:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  background-color: #a50404;
  font-weight: 600;
  /* slightly lighter/darker for feedback */
}

.chip.active {
  background: #fcfcfc;
  border-color: #d38c1231;
  color: #121111fc;
}

.chip--icon {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: .5rem 1rem;
  text-align: center;
  gap: .01rem;
  text-transform: capitalize;
  overflow: hidden;
}

.chip--icon::before {
  content: "";
  width: 52px;
  height: 52px;
  /* make it a bit smaller */
  display: inline-block;
  flex-shrink: 0;
  background: currentColor;
  /* Shorthand mask + WebKit version (more reliable across Edge/Chrome) */
  -webkit-mask: var(--icon-url) center / 80% 80% no-repeat;
  mask: var(--icon-url) center / 80% 80% no-repeat;
  /* This can help for stroke-only SVGs on some engines */
  mask-mode: luminance;
}


/* === Mobile: equal-width, no scroll === */
@media (max-width:768px) {
  .chip-bar {
    margin-left: 0;
    overflow-x: hidden;
    flex-wrap: nowrap;
    justify-content: stretch;
    gap: .4rem;
  }

  .chip {
    flex: 1 1 0;
    font: 500 .45rem 'Plus Jakarta Sans', sans-serif;
    min-width: 0;
    height: 56px;
    /* equal width */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* tidy labels */
  }
}

/* === Filter Panel Hybrid Layout === */

/* Desktop: Vertical Sidebar */
.filter-bar {
  width: var(--filter-width);
  position: fixed;
  top: var(--nav-h);
  /* aligns below navbar */
  left: 0;
  height: calc(100vh - var(--nav-h));
  padding: 1.25rem 1rem;
  background: #121111;
  color: white;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.filter-menu {
  display: flex;
  flex-direction: column;
  gap: 1.0rem;
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 3em;
}

/* For WebKit browsers (Chrome, Edge, Safari) */
.filter-bar::-webkit-scrollbar {
  width: 18px;
  /* scrollbar width */
}

.filter-bar::-webkit-scrollbar-track {
  background: #0c0c0c;
  /* track color */
}

.filter-bar::-webkit-scrollbar-thumb {
  background-color: #171717;
  /* thumb color */
  border-radius: 4px;
}

.filter-bar::-webkit-scrollbar-thumb:hover {
  background-color: #e7dfdf;
}

.filter-bar::-webkit-scrollbar-thumb:active {
  background-color: #c1b2a0;
}

.filter-bar::-webkit-scrollbar-thumb:focus {
  background-color: #a89b8c;
}

.filter-bar::-webkit-scrollbar-thumb:focus-visible {
  background-color: #8f8274;
}

.filter-bar::-webkit-scrollbar-thumb:focus-within {
  background-color: #7a6d5f;
}

.filter-bar::-webkit-scrollbar-thumb:active:hover {
  background-color: #6b5f51;
}

.filter-bar::-webkit-scrollbar-thumb:active:focus {
  background-color: #5c5143;
}

.filter-bar::-webkit-scrollbar-thumb:active:focus-visible {
  background-color: #4e4335;
}

.filter-bar::-webkit-scrollbar-thumb:active:focus-within {
  background-color: #40352a;
}

.filter-bar::-webkit-scrollbar-thumb:hover {
  background-color: #555;
  /* thumb color on hover */
}

/* For Firefox */
.filter-bar {
  scrollbar-width: thin;
  scrollbar-color: #555 #1c1b1b;
  /* thumb color, track color */
}

.filter-menu li {
  margin-bottom: 1rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  text-decoration: none;
  font: 500 0.85rem 'Plus Jakarta Sans', sans-serif;
  gap: 0.5rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
  border-radius: 12px;
  width: 100%;
}

.filter-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  background-color: #a70101;
  color: #fff;
  font-weight: 600;
}


.filter-item.active {
  background: white;
  border-color: #ffffffd4;
  color: #000;

}

.filter-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.filter-item.active img {
  filter: brightness(10%) saturate(90%);
}

.filter-menu[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .filter-bar {
    position: sticky;
    top: var(--nav-h);
    /* aligns below navbar */
    z-index: 1100;
    background: #050505;
    padding: 0.3rem .5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    display: flex;
    gap: .1rem;
    max-height: 80px;
    margin-top: 1px;
    display: flex;
    flex-direction: row;
    /* ✅ ensures horizontal scroll */
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
  }

  .filter-menu {
    display: flex;
    flex-direction: row;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0.1rem;
    flex-shrink: 0;
    /* ✅ prevent shrinking */
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .filter-menu li {
    flex: .5;
    text-align: center;
    display: grid;

  }

  .filter-menu li a {
    font: 200 0.5rem 'Plus Jakarta Sans', sans-serif;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    display: inline-block;
    white-space: wrap;
  }


  .filter-menu li a:hover,
  .filter-menu li a.active {
    background: #a70101;
    color: #fff;
  }

  .filter-menu[hidden] {
    display: none !important;
  }

  .filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    text-decoration: none;
    font: 500 0.5rem 'Plus Jakarta Sans', sans-serif;
    gap: 0.50rem;
    padding: 0.75rem 0.5rem;
    transition: all 0.2s ease;
    border-radius: 12px;
    width: auto;
    min-width: 60px;
    max-width: 100px;
  }

  .filter-item img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin: 0 auto;
  }

  /* Makes sure main content doesn't get hidden below nav/filter */
  .main-content {
    margin-top: calc(var(--nav-h) + 90px);
    padding-inline: 1rem;
  }
}

/* ---------- Main Layout --------------------------------- */
.main-content {
  max-width: 1440px;
  margin: 0 0 0 280px;
  padding: 1rem 2rem 4rem;
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media(max-width:768px) {
  .main-content {
    margin: 0;
    padding-inline: 1rem;
    margin-top: 5rem;
  }
}

/* ---------- Product Grid & Card ------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 1rem 2rem;
  margin-top: 1rem;
  justify-items: center;
}


@media(max-width:768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, .5fr));
    gap: .5rem;
    padding: 0
  }
}

.product-card {
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: 0.3s ease;
  cursor: pointer;
  animation: fadeIn 0.4s ease-out;
  text-align: center;

}

.product-grid {
  overflow-anchor: none;
}



.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.385);
  background-color: #a70101;
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-title {
  font: 480 0.85rem 'Plus Jakarta Sans';
  color: #333333;
  margin: 0;
  text-align: center;
  text-transform: capitalize;

}

.product-card:hover {
  transform: translateY(-6px);
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-image {
    aspect-ratio: 1 / 1;
    max-height: 160px;
  }
}

/* ---------- Animations ---------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* ---------- Card defaults (inherit your palette if defined) ---------- */
:root {
  --card-bg: var(--bg, #e2e1ddf1);
  --card-text: var(--text, #37220b);
  --card-accent: var(--accent, #ece9e3);
  --card-accent-dark: var(--accent-dark, #cdbea9);
  --card-border: #ece9e3;
  --card-media-bg: #efefef;
  --card-radius: 16px;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, .06), 0 1px 0 rgba(0, 0, 0, .02);
  --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, .12), 0 2px 0 rgba(0, 0, 0, .02);
}

.product-card {
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: box-shadow .3s, transform .3s;
}


.product-card:focus-visible {
  outline: 2px solid var(--card-accent);
  outline-offset: 3px;
}

/* ---------- Media ---------- */
/* Constant-size media box */
.card-media {
  --media-ratio: 4 / 3;
  /* change to 1/1, 3/2, etc. */
  aspect-ratio: var(--media-ratio);
  position: relative;
  background: var(--card-media-bg, #1b1b1a);
  overflow: hidden;
}

/* Make any image fit consistently */
.card-media>img {
  position: absolute;
  inset: 0;
  /* top/right/bottom/left: 0 */
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* show all, keep aspect */
  object-position: center;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* Fallback for very old browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
  .card-media {
    height: 0;
    padding-top: 75%;
    /* 4:3 => 75% (adjust if you change ratio) */
  }
}

/* Placeholder (when no image) */
.img-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.25s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ---------- Body ---------- */
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-transform: capitalize;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: .2px;
  color: var(--card-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* allow up to 2 lines, ellipsis */
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.card-title a {
  color: inherit;
  text-decoration: none;
  transition: color .25s;
}


.card-meta {
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-transform: capitalize;
  font-size: .86rem;
  line-height: 1.4;
  color: color-mix(in oklab, var(--card-text) 80%, #fff);
  opacity: .9;
  margin-top: 2px;
}

.card-meta :hover {
  color: #f2efef;
}

/* ---------- Tags ---------- */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;

}

.card-tags span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .74rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--card-accent) 35%, #0000);
  background: color-mix(in oklab, var(--card-accent) 12%, #fff);
  color: color-mix(in oklab, var(--card-text) 85%, #fff);
  white-space: nowrap;

}

.card.text :hover {
  color: #fff;
  cursor: pointer;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  .card-body {
    padding: 12px 12px 14px;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-meta {
    font-size: .82rem;
  }

  .card-tags span {
    font-size: .7rem;
    padding: 5px 9px;
  }
}
