:root {
  --blue: #1a9ed4;
  --dark: #222;
  --mid: #555;
  --light: #888;
  --border: #e8e8e8;
  --bg: #f5f5f5;
}

/* Product Shop */
#product-shop-section {
  padding: 0;
}

/* ── Layout ─────────────────────────────────────────────────────── */
.page-layout {
  display: flex;
  /* height: calc(100vh - 45px); */
  overflow: hidden;
  margin-bottom: 40px;
}

.sidebar {
  width: 350px;
  min-width: 150px;
  background-color: #fff;
  border: 1px solid var(--border);
  background-color: #fff;
  border-radius: 10px;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-block {
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}

.sidebar-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sidebar-block-header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 0;
}
.sidebar-block-header .toggle-btn {
  background: none;
  border: none;
  color: var(--light);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* Categories Tree */
.cat-tree {
  padding: 0;
  list-style: none;
  padding: 0;
}
.cat-tree > li {
  margin-bottom: 6px;
}
.cat-tree > li > .cat-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 600;
  color: var(--blue);
  padding: 2px 0;
  text-decoration: none;
}
.cat-tree > li > .cat-parent .cat-arrow {
  font-size: 11px;
  transition: transform 0.2s;
}
.cat-tree > li > .cat-parent.collapsed .cat-arrow {
  transform: rotate(-90deg);
}
.cat-tree > li.inactive > .cat-parent {
  color: var(--mid);
  font-weight: 500;
}

.cat-children {
  list-style: none;
  padding-left: 12px;
  margin-top: 6px;
  display: block;
}
.cat-children.hidden {
  display: none;
}
.cat-children li {
  margin-bottom: 4px;
}
.cat-children li a {
  font-size: clamp(14px, 2vw, 16px);
  color: var(--mid);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  transition: color 0.15s;
}
.cat-children li a:hover {
  color: var(--blue);
}
.cat-children li a.active-sub {
  color: var(--blue);
  font-weight: 600;
}

/* Price Slider */
.price-range-wrap {
  padding: 6px 0 14px;
}
.price-slider {
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--blue) 0%, var(--blue) 100%);
  border-radius: 2px;
  outline: none;
  margin-bottom: 14px;
}
.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--blue);
}
.price-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
}
.price-label {
  font-size: 12px;
  color: var(--mid);
}
.filter-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.filter-btn:hover {
  background: #1585b5;
}

/* Featured Products Slider in Sidebar */
.featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.featured-header h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 0;
}
.featured-nav {
  display: flex;
  gap: 4px;
}
.featured-nav button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  color: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.featured-nav button:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.featured-slider {
  overflow: hidden;
}
.featured-track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.35s ease;
}

.feat-product {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.feat-thumb {
  width: 60px;
  height: 60px;
  background: var(--bg);
  border-radius: 2px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feat-thumb .no-img {
  font-size: 22px;
  color: #ccc;
}
.feat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}
.feat-cond {
  font-size: 14px;
  color: var(--light);
  margin-bottom: 3px;
}
.feat-stars {
  color: #f4a100;
  font-size: 14px;
  margin-bottom: 3px;
}
.feat-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}

/* ── Main Content ───────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 20px 24px;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main-content::-webkit-scrollbar {
  display: none;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toolbar-label {
  font-size: 13px;
  color: var(--mid);
}
.toolbar-select {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  color: var(--dark);
  appearance: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  cursor: pointer;
  outline: none;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-btns {
  display: flex;
  gap: 4px;
}
.view-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--light);
  transition: all 0.15s;
}
.view-btn.active,
.view-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.25s;
  position: relative;
}
.product-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
}

.product-img {
  position: relative;
  height: 180px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-img img {
  /* width: 100%; */
  height: 300px;
  /* object-fit: cover; */
  transition: transform 0.3s;
}
.product-card:hover .product-img img {
  transform: scale(1.04);
}
.product-img .no-img {
  font-size: 48px;
  color: #ddd;
}

.product-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
}
.product-card:hover .product-overlay {
  opacity: 1;
  transform: translateY(0);
}
.overlay-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--dark);
  transition: all 0.2s;
}
.overlay-btn:hover {
  background: var(--blue);
  color: #fff;
}

.wishlist-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.wishlist-corner i {
  font-size: 16px;
  color: #aaa;
}
.wishlist-corner:hover i {
  color: #e53935;
}
.product-card:hover .wishlist-corner {
  opacity: 1;
}

.product-info {
  padding: 12px 14px;
}
.product-cat-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 4px;
}
.product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 3px;
}
.product-cond {
  font-size: 12px;
  color: var(--light);
  margin-bottom: 5px;
}
.product-stars {
  color: #f4a100;
  font-size: 12px;
  margin-bottom: 6px;
}
.product-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
}

.reset-btn {
  background: #fff;
  color: #888;
  border: 1px solid #ddd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  background: #f5f5f5;
  color: #444;
  border-color: #bbb;
}

.subcat-pill {
  padding: 0.5rem 1rem;
  color: #fff;
  cursor: pointer;
  font-size: 14px !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
}

.subcat-pill.active-top-sub {
  background-color: #000;
  padding: 0.5rem 1rem;
}

/* ── Mobile Filter Drawer (≤ 768px) ────────────────────────────── */
@media (max-width: 768px) {
  /* [CHANGE] Reset page-layout so products fill full width on mobile */
  .page-layout {
    height: auto;
    overflow: visible;
  }

  /* [CHANGE] Main content takes full width; its own scroll is removed on mobile */
  .main-content {
    height: auto;
    overflow-y: visible;
    padding: 12px 12px 80px; /* bottom padding leaves room for filter bar */
  }

  /* [CHANGE] Sidebar becomes a fixed off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -110%; /* hidden off-screen to the left */
    width: 82vw;
    max-width: 320px;
    height: 100dvh;
    z-index: 9999;
    background: #fff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    transition: left 0.3s ease;
    border: none;
    padding-top: 0;
  }

  /* [ADD] Drawer slides in when .mobile-open is toggled by JS */
  .sidebar.mobile-open {
    left: 0;
  }

  /* [ADD] Show the mobile filter bar at the bottom */
  .mobile-filter-bar {
    display: flex !important;
    position: fixed;
    top: 15.4%;
    /* bottom: 0; */
    left: 0;
    /* right: 0; */
    z-index: 999;
    /* background: #fff; */
    /* border-top: 1px solid var(--border); */
    /* padding: 10px 16px; */
    justify-content: center;
  }

  /* [ADD] The 3-dot/slider filter button style */
  .mobile-filter-btn {
      display: flex;
    flex-flow: column;
    align-items: center;
    gap: 8px;
    background: var(--blue);
    color: #fff;
    border: none;
    /* border-radius: 24px; */
    padding: 40px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    /* box-shadow: 0 2px 12px rgba(26, 158, 212, 0.35);*/
  }

  /* [ADD] Dark backdrop behind the drawer */
  .mobile-filter-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
  }

  .mobile-filter-backdrop.active {
    display: block;
  }

  /* [ADD] Header bar inside the drawer with title + close X */
  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }
  .sidebar-mobile-header span {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 0.5px;
  }
  .sidebar-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--mid);
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
}

/* [ADD] On desktop — hide the mobile-only elements entirely */
@media (min-width: 769px) {
  .mobile-filter-bar {
    display: none !important;
  }
  .mobile-filter-backdrop {
    display: none !important;
  }
  .sidebar-mobile-header {
    display: none;
  }
}


