/* css/shop.css — Responsive Desktop & Mobile Shop Layout */

.page-container {
  padding-top: calc(var(--nav-height, 72px) + 24px);
  padding-bottom: 80px;
  min-height: 85vh;
}

.page-header {
  margin-bottom: 32px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.page-header h1 {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.page-header .text-muted {
  font-size: 0.95rem;
  color: var(--color-text-secondary, #a0a0a0);
  margin: 0;
}

/* ── Main Shop Layout (Sidebar + Product Grid) ── */
.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  align-items: start;
  width: 100%;
}

/* ── Sidebar Filters ── */
.shop-sidebar {
  background: var(--color-bg-surface, #141414);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  position: sticky;
  top: 96px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.filter-group {
  margin-bottom: 24px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group h3 {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary, #a0a0a0);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: left;
  cursor: pointer;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.category-btn.active {
  background: var(--color-brand-red-dim, rgba(230, 57, 70, 0.15));
  border-color: var(--color-accent, #e63946);
  color: #ffffff;
  font-weight: 800;
}

/* ── Main Product Grid Area ── */
.shop-main {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
}

/* ── 1440px+ Extra Large Desktop Screens ── */
@media (min-width: 1440px) {
  .shop-layout {
    grid-template-columns: 300px 1fr;
    gap: 40px;
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
}

/* ── 1024px to 1366px Standard Desktop ── */
@media (min-width: 1024px) and (max-width: 1439px) {
  .shop-layout {
    grid-template-columns: 260px 1fr;
    gap: 28px;
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* ── 768px to 1023px Tablet Layout ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .shop-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .shop-sidebar {
    position: static;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .shop-sidebar .filter-group:last-child {
    grid-column: 1 / -1;
  }
  .category-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .category-btn {
    width: auto;
    padding: 8px 16px;
    background: #1a1a1a;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* ── Mobile Layout (< 768px) ── */
@media (max-width: 767px) {
  .page-container {
    padding-top: calc(var(--nav-height, 72px) + 16px);
    padding-bottom: 50px;
    width: 100%;
    box-sizing: border-box;
  }

  .page-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .page-header .text-muted {
    font-size: 0.85rem;
  }

  .shop-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .shop-sidebar {
    position: static;
    padding: 14px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .filter-group {
    margin-bottom: 14px;
  }

  .filter-group:last-child {
    margin-bottom: 0;
  }

  .filter-group h3 {
    font-size: 0.78rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  /* Horizontal scrollable category pill bar on mobile */
  .category-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 4px 2px 10px 2px;
    scrollbar-width: none;
    width: 100%;
    box-sizing: border-box;
  }

  .category-list::-webkit-scrollbar {
    display: none;
  }

  .category-list li {
    flex-shrink: 0;
    list-style: none;
  }

  .category-btn {
    white-space: nowrap;
    width: auto;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    color: #cccccc;
    touch-action: manipulation;
  }

  .category-btn.active {
    background: var(--color-accent, #e63946);
    border-color: var(--color-accent, #e63946);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(230, 57, 70, 0.35);
  }

  /* Mobile 2-column clean product grid */
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Extra Small Mobile Screens (320px - 390px) */
@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .shop-sidebar {
    padding: 12px;
  }

  .category-btn {
    padding: 7px 12px;
    font-size: 0.75rem;
  }
}
