/* =========================================================
   SHOP.CSS (layout + topbar + sidebar + filters + grid)
========================================================= */

/* ---------- TOPBAR ---------- */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e6eaf2;
}

.topbar-inner{
  display:flex;
  align-items:center;
  gap: 18px;
  padding: 10px 0;
}

.logo{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 210px;
}

.logo img{
  width: 46px;
  height: 46px;
  object-fit: contain;
  display:block;
}

.logo-text{ line-height: 1.05; }
.logo-title{
  font-weight: 800;
  font-size: 18px;
  color: #111827;
}
.logo-sub{
  font-size: 13px;
  color:#6b7280;
  margin-top: 2px;
}

.search{
  flex: 1;
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 260px;
}

.search input{
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #d7dde6;
  background: #fff;
  outline: none;
}
.search input:focus{
  border-color:#9aa6b2;
  box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}

.search button{
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #111827;
  background:#111827;
  color:#fff;
  font-weight: 800;
  cursor:pointer;
}

.top-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.top-btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #d7dde6;
  background:#fff;
  font-weight: 800;
}
.top-btn:hover{ border-color:#b8c0cc; }

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background:#111827;
  color:#fff;
  font-size: 12px;
  font-weight: 900;
  transition: transform .2s ease;
}
.badge.is-bump{ transform: scale(1.15); }

/* ---------- LAYOUT ---------- */
.main-layout{
  display:grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items:start;
  padding: 18px 0 10px;
}

.sidebar{ position: sticky; top: 76px; }
.main-content{ min-width: 0; }

/* ---------- SIDEBAR ---------- */
.sidebar-box{
  background:#fff;
  border: 1px solid #e6eaf2;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(17,24,39,.04);
}

.sidebar-title{
  font-weight: 900;
  letter-spacing: .5px;
  margin: 0 0 10px;
  color:#111827;
}

/* ===== AKCIJA crveni tab ===== */
.sidebar-title--akcija{
  background:#b30000;
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  margin: -6px -6px 12px;   /* tab efekat unutar boxa */
  text-align:center;
  letter-spacing:1px;
}

.sidebar-menu{
  list-style:none;
  padding:0;
  margin:0;
}

.sidebar-menu > li{
  border-top: 1px solid #edf1f7;
}
.sidebar-menu > li:first-child{ border-top: 0; }

/* ====== KATEGORIJA (toggle button) ====== */
.sidebar-menu .has-submenu > .side-cat-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border:0;
  background:transparent;
  cursor:pointer;
  font:inherit;
  color:#111827;
  border-radius:12px;
  font-weight:800;
  text-align:left;
}
.sidebar-menu .has-submenu > .side-cat-toggle:hover{ background:#f5f7fb; }

.sidebar-menu .has-submenu .side-cat-name{ font-weight:800; }
.sidebar-menu .has-submenu .side-cat-arrow{
  font-weight:900;
  opacity:.7;
  transition:transform .15s ease;
}

/* KATEGORIJA bez submenu ostaje link */
.sidebar-menu > li > a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 10px;
  border-radius: 12px;
  font-weight: 800;
  color:#111827;
}
.sidebar-menu > li > a:hover{ background:#f5f7fb; }

.sidebar-menu > li > a.active,
.sidebar-menu .side-cat-toggle.active{
  background:#111827;
  color:#fff;
}

/* submenu default zatvoren */
.sidebar-submenu{
  list-style:none;
  padding: 0 0 8px 10px;
  margin: 0;
  display:none;
}

.has-submenu.open .sidebar-submenu{ display:block; }
.has-submenu.open .side-cat-arrow{ transform:rotate(180deg); }

.sidebar-submenu a{
  display:block;
  padding: 8px 10px;
  border-radius: 10px;
  color:#374151;
  font-weight: 700;
}
.sidebar-submenu a:hover{ background:#f5f7fb; }

.sidebar-submenu a.active{
  font-weight:900;
  text-decoration:underline;
}

.sidebar-submenu .allcat a{
  font-weight:800;
  opacity:.9;
}

/* ---------- FILTER (SIDEBAR) ---------- */
.filter-box .side-filter{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.sf-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.sf-label{ font-weight: 800; color:#111827; }
.sf-value{ color:#6b7280; font-weight: 800; }

.sf-sliders{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.sf-range{ width:100%; }

.sf-inputs{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sf-inputs label{
  display:flex;
  flex-direction:column;
  gap: 6px;
  font-size: 12px;
  color:#6b7280;
  font-weight: 700;
}

.sf-inputs input{
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #d7dde6;
  background:#fff;
  outline:none;
}

.sf-actions{ display:flex; gap: 10px; }
.sf-actions .btn{ width:100%; }

/* ---------- HEADERS ---------- */
.h1{
  font-size: 30px;
  font-weight: 900;
  margin: 8px 0 2px;
  color:#111827;
}
.sub{
  margin: 0 0 12px;
  color:#6b7280;
  font-weight: 700;
}

/* ---------- CATS (PILLS) - JEDAN RED + SKROL ---------- */
.cats{
  display:flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;

  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;

  padding: 6px 2px 10px;
  margin: 10px 0 14px;

  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.cats a{
  flex: 0 0 auto;
  display:inline-flex;
  align-items:center;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e6eaf2;
  background:#fff;
  font-weight: 900;
  color:#111827;
  box-shadow: 0 2px 10px rgba(17,24,39,.04);
}

.cats a:hover{ border-color:#cfd5dd; }

.cats a.active{
  background:#111827;
  border-color:#111827;
  color:#fff;
}

.cats::-webkit-scrollbar{ height: 8px; }
.cats::-webkit-scrollbar-thumb{ background:#cfd5dd; border-radius: 999px; }
.cats::-webkit-scrollbar-track{ background: transparent; }

/* ---------- FILTER ROW (GORE) ---------- */
.filter-row{
  background:#fff;
  border: 1px solid #e6eaf2;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(17,24,39,.04);

  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-row input[type="text"]{
  flex: 1;
  min-width: 220px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #d7dde6;
  outline: none;
}

.filter-row select{
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #d7dde6;
  background:#fff;
  font-weight: 800;
}

.price-range{
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 280px;
}

.price-range label{
  font-size: 12px;
  color:#6b7280;
  font-weight: 800;
}

.range-line{
  display:flex;
  gap: 10px;
  align-items:center;
}

.range-line input[type="range"]{ width: 160px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #111827;
  background:#111827;
  color:#fff;
  font-weight: 900;
  cursor:pointer;
}

.btn.secondary{
  background:#fff;
  color:#111827;
  border-color:#cfd5dd;
}

.btn:disabled{ opacity:.45; cursor:not-allowed; }

/* ---------- GRID + CARD ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card{
  background:#fff;
  border: 1px solid #e6eaf2;
  border-radius: 16px;
  overflow:hidden;
  box-shadow: 0 4px 14px rgba(17,24,39,.04);
  display:flex;
  flex-direction:column;
  min-height: 260px;
}

.cardlink{ display:block; padding: 12px; }

.imgwrap{
  width:100%;
  height: 150px;
  border-radius: 12px;
  background:#f5f7fb;
  display:grid;
  place-items:center;
  overflow:hidden;
  margin-bottom: 10px;
}

.imgwrap img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display:block;
}

.card h3{
  font-size: 14px;
  margin: 0 0 6px;
  font-weight: 900;
  color:#111827;
  line-height: 1.25;
}

.desc{
  font-size: 12px;
  color:#6b7280;
  font-weight: 700;
  margin-bottom: 8px;
}

.price{
  font-size: 16px;
  font-weight: 900;
  color:#111827;
}

.meta{
  margin-top:auto;
  padding: 10px 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border-top: 1px solid #edf1f7;
}

.pill{
  font-size: 12px;
  font-weight: 900;
  color:#111827;
  background:#f5f7fb;
  border: 1px solid #e6eaf2;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* ---------- PAGER ---------- */
.pager{
  margin: 18px 0 6px;
  display:flex;
  gap: 8px;
  justify-content:center;
  align-items:center;
}

.pg{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #e6eaf2;
  background:#fff;
  font-weight: 900;
  color:#111827;
}

.pg:hover{ border-color:#cfd5dd; }
.pg.active{
  background:#111827;
  color:#fff;
  border-color:#111827;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px){
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px){
  .main-layout{ grid-template-columns: 1fr; }
  .sidebar{ position: static; top:auto; } /* kad je 1 kolona, sticky nema smisla */
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .topbar-inner{
    flex-wrap:wrap;
    align-items:stretch;
    gap:10px;
  }
  .logo{ width:100%; min-width:0; }
  .search{ width:100%; min-width:0; }
  .top-actions{ width:100%; flex-wrap:wrap; justify-content:flex-start; }
  .top-btn{ flex:1 1 160px; justify-content:center; }
}

@media (max-width: 560px){
  .grid{ grid-template-columns: 1fr; }
  .price-range{ min-width: 100%; }
  .range-line input[type="range"]{ width: 100%; }

  /* filter row na mobilnom */
  .filter-row{ padding:10px; gap:8px; }
  .filter-row input[type="text"]{ width:100%; min-width:0; }
  .filter-row select{ width:100%; }
  .filter-row .btn{ width:100%; }
}

/* --- product card stabilno (2 reda naslov) --- */
.card h3{
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.meta{ flex-wrap:wrap; }
/* --- safety: da ništa ne probija layout --- */
.main-content{ min-width:0; }
.grid{ min-width:0; }
.cardlink{ min-width:0; }
.pill{ max-width:100%; overflow:hidden; text-overflow:ellipsis; }
