
/* products.css — Professional storefront UI (drop-in) */

/* ---------- Theme ---------- */
:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);

  --primary: #f23a2e;
  --primary-2: #1d4ed8;
  --good: #16a34a;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --shadow-1: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-2: 0 16px 44px rgba(15, 23, 42, 0.12);

  --focus: 0 0 0 3px rgba(37,99,235,.18);

  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
/* html,body{ height:100%; } */
body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(37,99,235,.12), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(99,102,241,.10), transparent 60%),
    var(--bg);
  color:var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Container ---------- */
.container{
  width:100%;
  margin: 0 auto;
  padding: 18px 24px 44px;
  
}
.center{
place-items: anchor-center;
}


/* ---------- Header (sticky, modern) ---------- */
.site-header{
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 6px;
  margin-bottom: 12px;

  background: rgba(246,247,251,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,23,42,.06);
}

.site-brand{
  display:flex;
  gap:12px;
  align-items:center;
  text-decoration:none;
  color:var(--text);
  min-width: 220px;
}

.logo-badge{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f23a2e 0%, #6366f1 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight: 800;
  box-shadow: var(--shadow-1);
}

.site-brand > div > div:first-child{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.site-brand small{
  display:block;
  margin-top:2px;
  font-size: 12px;
  color: var(--muted);
}

.site-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.view-toggle{
  display:flex;
  gap: 6px;
  background:#fff;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.view-toggle button{
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
}
.view-toggle button.active{
  background: rgba(37,99,235,.10);
  color: var(--primary);
}
.view-toggle button:focus{ outline:none; box-shadow: var(--focus); }

/* ---------- Layout ---------- */
.page-grid{
  display:grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items:start;
}

/* ---------- Sidebar ---------- */
.sidebar{
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 14px;
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 110px);
  overflow:auto;
}

.sidebar h4{
  margin: 8px 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #475569;
}

/* search */
.search{
  display:flex;
  align-items:center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
}
.search input{
  border:0;
  outline:0;
  background:transparent;
  font-size: 13px;
  flex:1;
  color: var(--text);
}
.search input::placeholder{ color:#94a3b8; }

#sortSelect{
  width:100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 13px;
  background:#fff;
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
  outline: none;
}
#sortSelect:focus{ box-shadow: var(--focus); }

/* category panel */
.category-list{
  margin: 8px 0 12px;
  padding: 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15,23,42,.06);
  font-size: 13px;
  color: #334155;
  max-height: 560px;
  overflow: auto;
}

.cat-all-btn{
  width: 100%;
  border: 1px solid rgba(37,99,235,.18);
  background: rgba(37,99,235,.10);
  color: var(--primary);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 10px;
}

.cat-all-btn{
  width: 100%;
  border: 1px solid rgba(37,99,235,.18);
  background: rgba(37,99,235,.10);
  color: var(--primary);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.cat-all-btn:hover{
  background: rgba(37,99,235,.16);
  border-color: rgba(37,99,235,.28);
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37,99,235,.10);
}

.cat-all-btn:focus{
  outline: none;
  box-shadow: var(--focus);
}

.cat-all-btn.cat-active{
  background: linear-gradient(135deg, #f23a2e 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37,99,235,.22);
}

.cat-all-btn.cat-active:hover{
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e40af;
  color: #fff;
}

.cat-node{
  margin-bottom: 4px;
}

.cat-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background .15s ease, color .15s ease;
}

.cat-row:hover{
  background: rgba(37,99,235,.05);
}

.cat-row-label{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.cat-row-text{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-node[data-depth="0"] > .cat-row{
  background:#fff;
  border:1px solid rgba(15,23,42,.06);
  font-size: 13px;
  font-weight: 800;
  color:#334155;
}

.cat-node[data-depth="1"] > .cat-row{
  font-size: 12px;
  font-weight: 700;
  color:#475569;
}

.cat-node[data-depth="2"] > .cat-row,
.cat-node[data-depth="3"] > .cat-row{
  font-size: 12px;
  font-weight: 600;
  color:#475569;
}

.cat-checkbox{
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex: 0 0 auto;
}

.cat-toggle,
.cat-toggle-spacer{
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.cat-toggle{
  border:0;
  background: transparent;
  border-radius: 999px;
  cursor:pointer;
}

.cat-toggle::before{
  content:"▾";
  font-size:16px;
  color:#64748b;
  display:block;
  transition: transform .16s ease;
}

.cat-toggle.open::before{
  transform: rotate(-180deg);
}

.cat-toggle:hover{
  background: rgba(37,99,235,.08);
}

.cat-children{
  margin-left: 20px;
  padding-top: 4px;
}

.cat-active{
  background: rgba(37,99,235,.14) !important;
  color: var(--primary) !important;
  font-weight: 800;
}

.cat-root > summary,
.cat-mid > summary,
.cat-leaf {
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.cat-root > summary:hover,
.cat-mid > summary:hover,
.cat-leaf:hover {
  background: rgba(37,99,235,.05);
}

.cat-checkbox {
  transform: translateY(1px);
}

.cat-toggle {
  opacity: .8;
}

.cat-toggle:hover {
  opacity: 1;
  background: rgba(37,99,235,.08);
}

.cat-root,
.cat-mid{
  border-radius: 12px;
  margin-bottom: 4px;
}

.cat-root > summary,
.cat-mid > summary{
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
}

.cat-root > summary{
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  background: #fff;
  border: 1px solid rgba(15,23,42,.06);
}

.cat-mid > summary{
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.cat-label{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cat-root[open] > summary .cat-toggle::before,
.cat-mid[open] > summary .cat-toggle::before{
  transform: rotate(-180deg);
}

.cat-leaves{
  padding: 4px 0 8px 28px;
}

.cat-leaf{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  color: #475569;
}

.cat-leaf:hover{
  background: rgba(2,6,23,.04);
}

/* “All categories” pill */
.category-list > .cat-leaf:first-child{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.18);
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 10px;
}

.cat-root[open] > summary{
  background: rgba(37,99,235,.08);
  color: var(--primary);
}
.cat-mid[open] > summary{
  background: rgba(2,6,23,.05);
}

/* .cat-root > summary::after,
.cat-mid > summary::after{
  content:"▾";
  font-size: 25px;
  opacity: .75;
  transition: transform .16s ease;
}
.cat-root[open] > summary::after,
.cat-mid[open] > summary::after{
  transform: rotate(-180deg);
} */

.cat-root > summary::after,
.cat-mid > summary::after{
  content:"";
}

/* actions */
.filter-actions{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}
.btn-ghost, .btn-primary{
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor:pointer;
  border: 1px solid var(--line);
  background:#fff;
}
.btn-ghost:hover{ transform: translateY(-1px); }
.btn-ghost:focus{ outline:none; box-shadow: var(--focus); }

.btn-primary{
  border: 0;
  color:#fff;
  background: linear-gradient(135deg, #f23a2e 0%, #1d4ed8 100%);
  box-shadow: 0 10px 26px rgba(37,99,235,.22);
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 14px 34px rgba(37,99,235,.26); }
.btn-primary:focus{ outline:none; box-shadow: var(--focus); }


/* ---------- Main toolbar ---------- */
.toolbar{
  position: sticky;
  top: 72px;
  z-index: 40;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 14px;

  /* background: rgba(255,255,255,.78); */
  /* border: 1px solid rgba(15,23,42,.06); */
  /* border-radius: var(--radius-lg); */
  /* box-shadow: 0 10px 30px rgba(15,23,42,.08); */
  backdrop-filter: blur(10px);
  /* margin-bottom: 14px; */
}

.context-head{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width: 240px;
}

.context-title{
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.2;
  max-width: 520px;          /* adjust */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-sub{
  font-size: 13px;
  color: var(--muted);
}


.left-tools{
  font-size: 13px;
  color: var(--muted);
  display:flex;
  align-items:center;
  gap: 10px;
}
.controls{
  display:flex;
  align-items:center;
  gap: 10px;
}

.page-btn{
  padding: 9px 12px;
  background:#fff;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor:pointer;
  font-size: 13px;
  font-weight: 700;
  color:#334155;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.page-btn:hover{ transform: translateY(-1px); }
.page-btn:focus{ outline:none; box-shadow: var(--focus); }
.page-btn[disabled]{ opacity:.45; cursor:default; transform:none; box-shadow:none; }

#pageInfo{ font-weight: 800; color:#334155; }

/* ---------- Grid / Cards ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--shadow-1);
  display:flex;
  flex-direction:column;
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover{
  transform: translateY(-6px);
  box-shadow: var(--shadow-2);
  border-color: rgba(37,99,235,.22);
}

.card img{
  width:100%;
  height: 220px;
  object-fit: contain;
  background: #fff;
  display:block;
  padding: 10px;
}

.card-body{
  padding: 12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap: 6px;
  flex:1;
}

.card-title{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-row{
  margin-top:auto;
  display:flex;
  flex-direction: column;
  align-items:baseline;
  gap: 8px;
}
.sale-price{
  font-size: 16px;
  font-weight: 900;
  color: var(--good);
}
.retail-price{
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}

/* badge */
.badge{
  position:absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  color:#fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15,23,42,.18);
}
.badge-off{
  background: linear-gradient(135deg, #fb923c 0%, #ef4444 100%);
}
.badge-new{
  background: linear-gradient(135deg, #f23a2e 0%, #6366f1 100%);
}

/* Ensure badge overlay works with your current JS wrapper */
.card-outer,
.grid article > div:first-child{
  position: relative;
}

/* ---------- List view ---------- */
.list{
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.list .card{
  flex-direction: row;
  height: 140px;
}
.list .card img{
  width: 210px;
  height: 100%;
}
.list .card-body{
  padding: 14px 14px;
}

/* ---------- Bottom pagination ---------- */
.pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  margin-top: 18px;
}
#pageNumbers{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content:center;
  padding: 0 8px;
}
#pageNumbers .page-btn{
  min-width: 36px;
  padding: 8px 12px;
}
#pageNumbers .page-btn[style]{
  background: rgba(37,99,235,.10) !important;
  border-color: rgba(37,99,235,.18) !important;
  color: var(--primary) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px){
  .page-grid{ grid-template-columns: 1fr; }
  .sidebar{ position: static; top:auto; max-height:none; }
  .toolbar{ top: 64px; }
}
@media (max-width: 720px){
  .container{ padding: 12px 12px 26px; }
  .site-header{ padding: 10px 4px; }
  .toolbar{ position: static; backdrop-filter:none; }
  .list .card{ height: 130px; }
  .list .card img{ width: 170px; }
}
@media (max-width: 480px){
  .grid{ grid-template-columns: 1fr; }
  .card img{ height: 200px; }
}


/* ===== 4-view support ===== */

.media { position: relative; }

/* text helpers */
.card-desc, .list-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rating{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}
.rating .stars{ letter-spacing: 1px; }
.rating .count{ color: #94a3b8; }

.sku{
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.feature-list{
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 4px;
}

/* grid detail tweaks */
.card--detail img{ height: 200px; }
.card--detail .card-body{ gap: 8px; }
.card--detail .price-row{ margin-top: 8px; }

/* list layouts (not using .list .card clone anymore) */
.list-row{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 14px;
  display: grid;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.list-row:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: rgba(37,99,235,.18);
}

.list-media{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(2,6,23,.04);
  display:flex;
  align-items:center;
  justify-content:center;
}
.list-media img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

.list-title{
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -.01em;
}

.list-right{
  display:flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.action-btn{
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  box-shadow: 0 10px 24px rgba(15,23,42,.18);
}
.action-btn:hover{ transform: translateY(-1px); }

/* list-detail (like your 3rd screenshot) */
.list-row--detail{
  grid-template-columns: 220px minmax(0, 1fr) 260px;
}
.list-row--detail .list-media{ height: 200px; }

/* list-compact (like your 4th screenshot) */
.list-row--compact{
  grid-template-columns: 140px minmax(0, 1fr) 200px;
}
.list-row--compact .list-media{ height: 120px; }
.list-row--compact .list-desc,
.list-row--compact .feature-list,
.list-row--compact .rating,
.list-row--compact .sku{
  display:none;
}

@media (max-width: 900px){
  .list-row--detail,
  .list-row--compact{
    grid-template-columns: 140px minmax(0, 1fr);
  }
  .list-right{ align-items: flex-start; }
}

/* ===== Combined Active + Selected bar ===== */
.filter-summary{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  overflow:hidden;
}

.filter-summary-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  flex:0 0 auto;
}

.filter-summary-badge.applied{
  background: rgba(37,99,235,.10);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,.18);
}

.filter-summary-badge.pending{
  background: rgba(249,115,22,.10);
  color: #c2410c;
  border: 1px solid rgba(249,115,22,.18);
}

.filter-summary-text{
  font-size:14px;
  font-weight:700;
  color:#475569;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  min-width:0;
}

.fb-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  min-width:0;
}

.filters-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.filters-bar.no-filters .fb-left{
  display:none;
}

.filters-bar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  margin: 12px 0 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 10px 26px rgba(15,23,42,.07);
  backdrop-filter: blur(10px);
}

.fb-left{
  display:flex;
  /* flex-direction: column; */
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  align-self: center;
}

.fb-row{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.fb-label{
  font-size: 16px;
  font-weight: 900;
  color: #475569;
  min-width: 58px;
}

.fb-chips{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.fb-row--pending{
  padding: 10px 10px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(15,23,42,.18);
  background: rgba(2,6,23,.02);
}

.fb-hint{
  font-size: 13px;
  color: #64748b;
  font-weight: 700;
}

.fb-actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-shrink: 0;
}

/* chips */
.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.18);
  background: rgba(37,99,235,.08);
  color: #1e40af;
  font-size: 13px;
  font-weight: 800;
  max-width: 360px;
}

.chip--pending{
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.85);
  color: #334155;
}

.chip .chip-text{
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.chip button{
  border:0;
  background: transparent;
  cursor:pointer;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
}
.chip button:hover{ background: rgba(2,6,23,.06); }

@media (max-width: 760px){
  .filters-bar{ flex-direction: column; }
  .fb-actions{ width:100%; justify-content:flex-end; }
}


/* Theme 2 css */

body:not(.theme-topbar) #topFiltersBar { 
  display: none !important; 
}
body.theme-topbar #topFiltersBar { 
  display: flex !important; 
}


.theme-toggle{
  display:flex; gap:6px;
  background:#fff; padding:6px;
  border-radius:999px;
  border:1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.theme-toggle button{
  border:0; background:transparent; cursor:pointer;
  padding:8px 12px; border-radius:999px;
  font-weight:800; color:var(--muted);
}
.theme-toggle button.active{
  background: rgba(37,99,235,.10);
  color: var(--primary);
}

/* Theme 2 layout */
body.theme-topbar .page-grid{ grid-template-columns: 1fr; }
body.theme-topbar .sidebar{ display:none; }

.top-filters{
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  margin: 12px 0 14px;
}
.tf-left{
  display:flex;
  flex-wrap:wrap;
  gap: 12px;
  align-items:flex-end;
  flex: 1;
}
.tf-field{ display:flex; /*flex-direction:column;*/ gap:6px; min-width: 220px; align-items: anchor-center; }
.tf-field label{ font-size:15px; font-weight:900; color:#64748b; }
.tf-cats{ display:flex; gap:10px; flex-wrap:wrap; }
.tf-select{
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 16px;
  background:#fff;
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
  outline:none;
  min-width: 200px;
}
.tf-select:focus{ box-shadow: var(--focus); }
.top-bar-search-padding{padding: 0px 0px 0px 10px !important;}
.tf-actions{ display:flex; gap:10px; align-items:center; }
.tf-ico{ opacity:.65; font-size: 14px; }

/* Category path text (above title) */
.cat-path{
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Discount pill like screenshot (bottom-left on image) */
.badge--sale{
  top: auto !important;
  right: auto !important;
  left: 10px;
  bottom: 10px;
  background: #22c55e !important; /* green */
}

/* Optional: show discount near price too */
.disc-inline{
  margin-left: auto;
  font-size: 12px;
  font-weight: 900;
  color: #16a34a;
}

.search-bar{
  display:flex;
  align-items:center;
  width: min(760px, 100%);
  height: 46px;
  background:#fff;
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 999px;           /* pill */
  overflow: hidden;               /* join button + input */
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
}

.search-menu{
  width: 54px;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: #475569;
}

.search-input-wrap{
  flex: 1;
  height: 100%;
  display:flex;
  align-items:center;
}

.search-input-wrap input{
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  padding: 0 16px;
  font-size: 14px;
  color: #0f172a;
  background: transparent;
}

.search-btn{
  width: 64px;
  height: 100%;
  border: 0;
  padding: 0;                  /* important */
  margin: 0;
  cursor: pointer;
  background: #0b2a6f;
  color: #fff;

  display: grid;               /* best centering */
  place-items: center;

  border-left: 1px solid rgba(255,255,255,0.18); /* optional */
}

.search-icon{
  width: 27px;
  height: 27px;
  display: block;              /* important */
  fill: currentColor;
}



/* focus ring */
.search-bar:focus-within{
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12), 0 8px 22px rgba(15,23,42,0.06);
}
.filters-bar.no-filters .fb-left,
.filters-bar.no-filters .fb-actions{
  display: none;
}

/* optional: tighten spacing when hidden */
.filters-bar.no-filters{
  justify-content: space-between;
}

/* ===== Pro Store Header Upgrade ===== */
.pro-header{
  gap: 14px;
  padding: 12px 10px;
  border-radius: 16px;
  margin: 10px 0 14px;
  background: rgba(246,247,251,.78);
  border: 1px solid rgba(15,23,42,.07);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
}

.brand-logo{
  width: auto;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 8px 20px rgba(15,23,42,.08);
}

.brand-text{ display:flex; flex-direction:column; line-height:1.1; }
.brand-name{ font-weight: 900; font-size: 15px; letter-spacing: -.02em; }
.brand-tagline{ font-size: 12px; color: var(--muted); margin-top: 4px; }

.header-nav{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 0 6px;
  flex: 0 0 auto;
}
.nav-link{
  text-decoration:none;
  font-weight: 800;
  font-size: 13px;
  color: #334155;
  padding: 8px 10px;
  border-radius: 999px;
}
.nav-link:hover{
  background: rgba(2,6,23,.05);
}
.nav-link.active{
  background: rgba(37,99,235,.10);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,.18);
}

.pro-search{
  flex: 1 1 520px;
  width: auto; /* override fixed width */
  max-width: 760px;
}

.pro-actions{
  gap: 10px;
  flex: 0 0 auto;
}

.icon-btn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: #fff;
  cursor: pointer;
  display:grid;
  place-items:center;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  position: relative;
}
.icon-btn svg{
  width: 20px;
  height: 20px;
  fill: #334155;
}
.icon-btn:hover{ transform: translateY(-1px); }
.icon-btn:focus{ outline: none; box-shadow: var(--focus); }

.badge-dot{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 6px 14px rgba(34,197,94,.35);
}

/* Responsive: hide nav on small screens (like real stores) */
@media (max-width: 980px){
  .header-nav{ display:none; }
  .pro-search{ flex: 1 1 auto; }
}
@media (max-width: 640px){
  .brand-tagline{ display:none; }
  .pro-header{ border-radius: 14px; }
}


.center{
  display: block;
}

.site-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-shrink: 0;
}

#sortSelect{
  width:100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 13px;
  background:#fff;
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
  outline: none;
}

.card-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-price{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-end;
}

body.theme-topbar .page-grid{
  grid-template-columns: 1fr;
}

body.theme-topbar .sidebar{
  display:none;
}

@media (max-width: 980px){
  .page-grid{
    grid-template-columns: 1fr;
  }

  .sidebar{
    position: static;
    top:auto;
    max-height:none;
  }

  .toolbar{
    top: 64px;
  }
}

@media (max-width: 760px){
  .filters-bar{
    flex-direction: column;
  }

  .fb-actions{
    width:100%;
    justify-content:flex-end;
  }
}

/* ===== Product list page polish ===== */

.results-text{
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.pager-inline{
  display:flex;
  gap:8px;
  align-items:center;
}

.filter-summary{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  overflow:hidden;
}

.filter-summary-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  flex:0 0 auto;
}

.filter-summary-badge.applied{
  background: rgba(37,99,235,.10);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,.18);
}

.filter-summary-badge.pending{
  background: rgba(249,115,22,.10);
  color: #c2410c;
  border: 1px solid rgba(249,115,22,.18);
}

.filter-summary-text{
  font-size:14px;
  font-weight:700;
  color:#475569;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  min-width:0;
}

.filters-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.fb-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  min-width:0;
}

.filters-bar.no-filters .fb-left{
  display:none;
}

/* ===== Better card consistency ===== */

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.card{
  min-height: 100%;
}

.media{
  position: relative;
  height: 240px;
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom: 1px solid rgba(15,23,42,.04);
}

.media img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  padding: 12px;
}

.card-body{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height: 190px;
}

.card-title{
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.card-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 54px;
}

.sku{
  font-size: 12px;
  color: #94a3b8;
  min-height: 18px;
}

.price-row{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
}

.sale-price{
  font-size: 17px;
  font-weight: 900;
  color: var(--good);
}

.retail-price{
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}

.cat-path{
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge--sale{
  top: auto !important;
  right: auto !important;
  left: 10px;
  bottom: 10px;
  background: #22c55e !important;
}

/* ===== List view polish ===== */

.list-row--detail{
  grid-template-columns: 220px minmax(0, 1fr) 220px;
}

.list-row--detail .list-media{
  height: 190px;
}

.list-title{
  font-weight: 900;
  font-size: 16px;
  line-height: 1.35;
}

.list-desc{
  font-size: 13px;
  line-height: 1.5;
}

.list-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:10px;
}

/* ===== Empty state ===== */

.empty-state{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 340px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  margin-top: 8px;
}

.empty-state[hidden]{
  display: none !important;
}
.empty-state-inner{
  text-align:center;
  max-width: 360px;
  padding: 20px;
}

.empty-state-title{
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.empty-state-text{
  font-size: 14px;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ===== Responsive ===== */

@media (max-width: 1200px){
  .grid{
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

@media (max-width: 900px){
  .filters-bar{
    flex-wrap: wrap;
    align-items:flex-start;
  }

  .fb-actions{
    order: 3;
    width: 100%;
    justify-content:flex-end;
  }

  .controls{
    order: 2;
    margin-left:auto;
  }

  .list-row--detail{
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .list-right{
    align-items:flex-start;
  }
}

@media (max-width: 760px){
  .page-grid{
    grid-template-columns: 1fr;
  }

  .sidebar{
    position: static;
    top: auto;
    max-height: none;
  }

  .toolbar{
    position: static;
    backdrop-filter: none;
  }

  .filters-bar{
    flex-direction: column;
    align-items: stretch;
  }

  .fb-actions,
  .controls{
    width: 100%;
    justify-content: space-between;
  }

  .grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media{
    height: 180px;
  }

  .card-body{
    min-height: 170px;
  }
}

@media (max-width: 520px){
  .container{
    padding: 12px 12px 28px;
  }

  .site-header{
    flex-wrap: wrap;
    gap: 10px;
  }

  .site-brand{
    min-width: 0;
    flex: 1 1 100%;
  }

  .search-bar{
    width: 100%;
  }

  .site-actions{
    width: 100%;
    justify-content: flex-end;
  }

  .grid{
    grid-template-columns: 1fr;
  }

  .media{
    height: 210px;
  }

  .filter-summary-text{
    white-space: normal;
  }
}

.d-none {
  display: none !important;
}

.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app-overlay-box {
  width: min(420px, 92vw);
  background: #ffffff;
  color: #111827;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 32px 26px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: appOverlayPop 0.22s ease-out;
}

.app-overlay-accent {
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #0f172a, #2563eb, #38bdf8);
}

.app-spinner {
  width: 58px;
  height: 58px;
  border: 5px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: appSpin 0.8s linear infinite;
}

.app-icon-success,
.app-icon-error,
.app-icon-warning {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
}

.app-icon-success {
  background: #dcfce7;
  color: #16a34a;
  border: 2px solid #86efac;
}

.app-icon-error {
  background: #fee2e2;
  color: #dc2626;
  border: 2px solid #fca5a5;
}

.app-icon-warning {
  background: #fef3c7;
  color: #d97706;
  border: 2px solid #fcd34d;
}

.app-overlay-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}

.app-overlay-text {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.55;
  margin-bottom: 20px;
}

.app-overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.app-overlay-ok-btn {
  border: none;
  outline: none;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.app-overlay-ok-btn:hover {
  transform: translateY(-1px);
  background: #2563eb;
}

@keyframes appSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes appOverlayPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}