/* ============================================================
   ProductStyles-improved.css — improved design, fully responsive
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #151616;
  background: #f0f0f0;
  overflow-x: hidden;
}

body {
  padding-top: 120px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

li, ul, a {
  position: relative;
  font-weight: 500;
  font-size: 20px;
  color: #151616;
  text-decoration: none;
  background: transparent;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  font-size: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  border-bottom: 2px solid #000;
  background: #1e1e1e;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.navbar {
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.navbar ul { margin-bottom: 0; }
.navbar li { display: inline-block; padding: 0 6px; }
.navbar li a { transition: all 0.2s ease; padding: 8px 14px; border-radius: 8px; color: #ccc; font-weight: 600; font-size: 15px; background: transparent; }
.navbar li a.active-link { color: #ed8d1b; }

.logo { display: flex; align-items: center; height: 100%; overflow: hidden; padding-left: 4px; }
.logo img { display: block; max-height: 66px; width: auto; height: auto; background: transparent; border: none; transition: all 0.2s ease; }
.logo img:hover { transform: scale(0.96); }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar { display: flex; margin-top: 3vh; margin-bottom: 2vh; justify-content: center; }
.search-bar input { width: min(340px, 55vw); height: 46px; font-size: 15px; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 2px solid transparent; background: #2a2a2a; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: all 0.2s ease; }
.search-bar input::placeholder { color: #888; }
.search-bar input:focus { background: #333; outline: none; border-color: #ed8d1b; width: min(370px, 58vw); }
.search-icon { display: inline-block; position: relative; right: 58px; width: 46px; height: 46px; overflow: hidden; background: #ed8d1b !important; border-radius: 0 10px 10px 0; margin-left: 2px; cursor: pointer; transition: background 0.2s ease; }
.search-icon:hover { background: #c97415 !important; }
.search-icon img { background-color: transparent; display: block; margin: -25px 0 0 -25px; }
.search-bar button { cursor: pointer; border: none; background: transparent; }

/* ── User dropdown ───────────────────────────────────────── */
.user { position: relative; background-color: transparent; padding-bottom: 10px; }
.user:hover #dropdown, .user:focus-within #dropdown { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.user #dropdown { position: absolute !important; top: calc(100% + 8px) !important; right: 0 !important; left: auto !important; z-index: 1400 !important; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 160ms ease, transform 160ms ease, visibility 160ms; pointer-events: none; background: #1e1e1e !important; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); padding: 6px 0; width: 200px; border: 1px solid #ed8d1b; text-align: center; max-width: calc(100vw - 32px) !important; }
.user.open #dropdown { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; pointer-events: auto !important; }
.user #dropdown li { padding: 10px 14px; display: block; text-align: center; }
.user #dropdown li a { color: #fff !important; font-size: 14px; background: transparent; transition: color 0.15s; }
.user #dropdown li:hover { background: rgba(237,141,27,0.15); }

/* ── Hamburger ───────────────────────────────────────────── */
.nav-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 10px; margin-left: 8px; align-self: center; }
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: #ffffff !important; margin: 4px 0; transition: transform .18s ease, opacity .18s ease; }
header.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
header.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
header.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Page title bar ──────────────────────────────────────── */
.header-border {
  display: flex;
  width: 100%;
  background: linear-gradient(90deg, #1e1e1e 0%, #2d2d2d 100%);
  padding: 0 28px;
  box-sizing: border-box;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #ed8d1b;
}

.header-border p {
  display: inline;
  background-color: transparent;
  color: #ffffff;
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 800 !important;
  padding: 22px 0;
  margin-bottom: 0;
  letter-spacing: -0.5px;
}

/* ── Products layout ─────────────────────────────────────── */
.products-container {
  display: flex;
  gap: 24px;
  padding: 24px 28px;
  align-items: flex-start;
}

/* ── Filter sidebar ──────────────────────────────────────── */
.filter-sidebar {
  width: 220px;
  min-width: 220px;
  background: #1e1e1e;
  color: #e0e0e0;
  padding: 20px;
  margin-top: 20px;
  border-radius: 14px;
  height: fit-content;
  flex-shrink: 0;
  border: 1px solid #333;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.filter-sidebar h4 { margin-bottom: 14px; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: 0.3px; }

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #ccc;
  transition: color 0.15s;
}
.filter-group label:hover { color: #fff; }
.filter-group label input[type="checkbox"] { accent-color: #ed8d1b; width: 15px; height: 15px; }

.filter-group p { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: #ed8d1b; margin: 14px 0 10px; background: transparent; }

.apply-btn {
  margin-top: 14px;
  padding: 9px 18px;
  border: none;
  background: #ed8d1b;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  color: #fff;
  letter-spacing: 0.3px;
  transition: background 0.2s ease, transform 0.1s ease;
}
.apply-btn:hover { background: #c97415; }
.apply-btn:active { transform: scale(0.97); }

.filter-scroll { max-height: 148px; overflow: hidden; transition: max-height 0.3s ease; }
.filter-scroll.expanded { max-height: 600px; }

.view-more-btn {
  background: none;
  border: none;
  color: #ed8d1b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  margin: 4px 0 10px;
  padding: 0;
  letter-spacing: 0.3px;
}
.view-more-btn:hover { color: #c97415; }

/* Mobile filter toggle */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin: 14px 16px 0;
  width: calc(100% - 32px);
  justify-content: center;
  transition: background 0.2s;
}
.mobile-filter-btn:hover { background: #2a2a2a; }
.mobile-filter-btn span { font-size: 16px; }

/* ── Products content ────────────────────────────────────── */
.products-content { flex: 1; min-width: 0; }

.sort-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0 4px;
  margin-bottom: 18px;
  align-items: center;
  gap: 8px;
}
.sort-bar label { font-weight: 700; font-size: 14px; color: #444; }
.sort-bar select { padding: 7px 10px; border-radius: 8px; border: 1px solid #ccc; font-size: 14px; font-weight: 600; background: #fff; cursor: pointer; }

/* ── Cards ───────────────────────────────────────────────── */
.items ul, li, a, p, h2 { background-color: transparent; list-style: none; }
.items { display: flex; padding: 0 4px; justify-content: center; align-items: flex-start; overflow-x: hidden; }

.card-wrapper { width: 100%; display: flex; justify-content: center; }

.card-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  padding: 0;
  margin: 0 auto;
  list-style: none;
  max-width: 1400px;
  width: 100%;
}

.card-item { width: 240px; max-width: 100%; }

.card-list .card-item .card-link {
  width: 100%;
  display: block;
  background: #1e1e1e;
  padding: 0;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid #2e2e2e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.card-list .card-item .card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  border-color: #ed8d1b;
}

.card-list .card-item .card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: none;
  display: block;
  background-color: #2a2a2a;
  transform: scaleX(1.2);
}

.card-list .card-item .badge {
  color: #fff;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 12px 14px 6px;
  background-color: #ed8d1b;
  width: fit-content;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.card-list .card-item .card-title {
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 700;
  padding: 0 14px 14px;
  margin-top: 4px;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 28px 0 48px;
  gap: 6px;
  padding: 0 12px;
}

.pagination a {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid #d0d0d0;
  width: 36px;
  height: 36px;
  text-align: center;
  border-radius: 8px;
  transition: all 0.15s ease;
  background: #fff;
  color: #333;
}

.pagination img { background-color: transparent; display: block; width: 55%; height: 55%; object-fit: fill; }

.pagination a.active { background: #ed8d1b; color: #fff; border-color: #ed8d1b; font-weight: 800; }
.pagination a:hover { background: #ed8d1b; color: #fff; border-color: #ed8d1b; transform: scale(0.95); }

.pagination .dots { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; font-size: 16px; color: #666; }

/* ── Responsive: nav ─────────────────────────────────────── */
@media (max-width: 992px) {
  .nav-toggle { display: inline-flex; }
  .navbar > ul { display: none; }
  header.nav-open .navbar > ul { display: flex !important; width: 220px !important; max-height: 70vh; overflow-y: auto; flex-direction: column; gap: 6px; padding: 10px 0; background: #1e1e1e !important; box-shadow: 0 8px 28px rgba(0,0,0,0.35) !important; border-radius: 12px !important; z-index: 1400 !important; list-style: none; border: 1px solid #ed8d1b !important; text-align: center; }
  header.nav-open .navbar > ul li { padding: 10px 12px; border-radius: 8px; }
  header.nav-open .navbar > ul li a { display: block; padding: 6px 8px; }
}
@media (min-width: 993px) {
  .navbar > ul { display: flex !important; flex-direction: row !important; position: static !important; background: transparent !important; box-shadow: none !important; border: none !important; }
  .nav-toggle { display: none; }
}

/* ── Responsive: tablet ──────────────────────────────────── */
@media (max-width: 900px) {
  .products-container { padding: 16px; gap: 16px; }
  .filter-sidebar { width: 200px; min-width: 200px; }
  .card-item { width: 210px; }
}

/* ── Responsive: mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  body { padding-top: 120px; }
  .mobile-filter-btn { display: flex; }
  .products-container { flex-direction: column; padding: 0; }
  .filter-sidebar { display: none; width: 100%; min-width: unset; margin-top: 0; border-radius: 0; border-top: none; border-left: none; border-right: none; border-bottom: 1px solid #333; }
  .products-container.filter-open .filter-sidebar { display: block; }
  .products-content { width: 100%; padding: 0 12px; }
  .sort-bar { padding: 8px 4px; justify-content: flex-start; }
  .items { padding: 12px 0; }
  .card-list { gap: 14px; }
  .card-item { width: 100%; max-width: 340px; }
  .search-bar input { width: min(250px, 58vw); }
  .search-bar input:focus { width: min(280px, 63vw); }
  .logo img { max-height: 54px; }
  .nav-toggle { display: block; }
  header { padding: 14px 20px; }
  .card-list .card-item .card-image{ object-fit: cover; }
}

/* ── Responsive: small mobile ────────────────────────────── */
@media (max-width: 480px) {
  body { padding-top: 120px; }
  header { padding: 12px 14px; }
  .logo img { max-height: 42px; }
  .search-bar input { width: min(190px, 50vw); height: 42px; font-size: 14px; }
  .search-icon { width: 42px; height: 42px; right: 50px; }
  .card-item { max-width: 100%; }
  .pagination a { width: 32px; height: 32px; font-size: 13px; }
  .pagination .dots { width: 32px; height: 32px; }
}
@media (max-width: 420px) {
  .user #dropdown { right: 8px !important; max-width: calc(100vw - 16px) !important; }
}
