/* ===========================================
   CATEGORY / EXPLORE PAGE STYLES
   =========================================== */

/* ---- Hero Banner ---- */
.cat-hero {
  position: relative;
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 0 0 36px 0;
}

.cat-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cat-hero-emoji {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 140px;
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 1;
}

.cat-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 0;
  color: #fff;
}

/* breadcrumb inside hero */
.cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cat-breadcrumb a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color .2s;
}
.cat-breadcrumb a:hover { color: #fff; }
.cat-breadcrumb span { color: rgba(255,255,255,0.4); }

.cat-hero-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.cat-hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  max-width: 500px;
  line-height: 1.5;
  margin: 0 0 18px;
}

.cat-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-badge {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.cat-badge.red {
  background: var(--red);
  border-color: var(--red);
}

/* ---- Sub-category pill bar ---- */
.sub-cat-bar {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  position: sticky;
  top: var(--navbar-h, 64px);
  z-index: 90;
}

.sub-cat-bar-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  height: 52px;
}
.sub-cat-bar-inner::-webkit-scrollbar { display: none; }

.sub-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  border: 1.5px solid #ddd;
  background: #fff;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
  flex-shrink: 0;
}
.sub-cat-pill:hover,
.sub-cat-pill.active {
  border-color: var(--black);
  color: var(--black);
  background: #f5f5f5;
}
.sub-cat-pill.active {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

/* ---- Category page wrapper (reuses search layout) ---- */
.cat-page-wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ---- Results header ---- */
.cat-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-results-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
}

.cat-results-count {
  font-size: 13px;
  color: #777;
  font-weight: 400;
}

/* ---- Mobile filter button ---- */
.cat-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
}

/* ---- Sort select ---- */
.cat-sort-select {
  border: 1.5px solid #ddd;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.cat-sort-select:focus { border-color: var(--black); }

/* ---- Layout ---- */
.cat-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.cat-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--navbar-h, 64px) + 52px);
  max-height: calc(100vh - 64px - 52px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.cat-main { flex: 1; min-width: 0; }

/* ---- Active filter chips ---- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--black);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.filter-chip:hover { background: #333; color: #fff; }
.filter-chip .chip-x { font-size: 14px; line-height: 1; opacity: .7; }

/* ---- Product grid ---- */
.cat-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cat-product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: box-shadow .2s, transform .2s;
  position: relative;
}
.cat-product-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.cat-product-thumb {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--gray-light, #f1f2f2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  position: relative;
}

.cat-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}

.cat-wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  font-size: 15px;
  transition: transform .2s;
  color: #999;
}
.cat-wishlist-btn:hover { transform: scale(1.15); color: var(--red); }
.cat-wishlist-btn.active { color: var(--red); }

.cat-product-info {
  padding: 12px 14px 14px;
}

.cat-product-brand {
  font-size: 10px;
  font-weight: 700;
  color: #999;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.cat-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-product-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-price-current {
  font-size: 15px;
  font-weight: 800;
  color: var(--black);
}

.cat-price-mrp {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
}

.cat-price-off {
  font-size: 11px;
  font-weight: 700;
  color: #2a9d4f;
}

.cat-product-colors {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.cat-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.12);
  display: inline-block;
}

/* ---- No Results ---- */
.cat-no-results {
  text-align: center;
  padding: 80px 20px;
  color: #555;
}
.cat-no-results .icon { font-size: 48px; margin-bottom: 16px; }
.cat-no-results h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--black); }
.cat-no-results p { font-size: 14px; color: #777; margin-bottom: 24px; }
.cat-continue-btn {
  display: inline-block;
  background: var(--black);
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

/* ---- Pagination ---- */
.cat-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.cat-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--black);
  border: 1.5px solid #ddd;
  background: #fff;
  transition: all .2s;
}
.cat-page-btn:hover { border-color: var(--black); background: #f5f5f5; }
.cat-page-btn.active { background: var(--black); color: #fff; border-color: var(--black); }
.cat-page-btn.disabled { opacity: .35; pointer-events: none; }
.cat-page-btn.ellipsis { border: none; background: none; pointer-events: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .cat-product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cat-sidebar { width: 210px; }
  .cat-hero-title { font-size: 30px; }
  .cat-hero-emoji { font-size: 100px; }
}

@media (max-width: 768px) {
  .cat-hero { min-height: 200px; }
  .cat-hero-title { font-size: 24px; }
  .cat-hero-desc { font-size: 13px; }
  .cat-hero-emoji { font-size: 70px; right: 4%; }
  .cat-hero-content { padding: 32px 16px 0; }

  .cat-filter-btn { display: inline-flex; }

  .cat-layout { display: block; }

  /* sidebar becomes mobile drawer */
  .cat-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    background: #fff;
    z-index: 1100;
    box-shadow: 4px 0 20px rgba(0,0,0,.18);
    padding: 20px 16px;
    overflow-y: auto;
    transition: left .3s ease;
  }
  .cat-sidebar.open { left: 0; }

  .cat-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1099;
  }
  .cat-sidebar-overlay.show { display: block; }

  .cat-sidebar-close {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
  }
  .cat-sidebar-close button {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    line-height: 1;
  }

  .cat-product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-page-wrap { padding: 16px 12px; }
  .cat-results-header { gap: 8px; }
}

@media (max-width: 480px) {
  .cat-hero-title { font-size: 20px; }
  .cat-hero { min-height: 160px; }
  .cat-hero-emoji { display: none; }
  .cat-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-product-info { padding: 8px 10px 10px; }
  .cat-price-current { font-size: 13px; }
  .sub-cat-bar-inner { height: 46px; }
  .sub-cat-pill { font-size: 12px; padding: 5px 12px; }
}
