/* catalog/css/base.css */
/* Shared production styles for the catalog module */

:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15,23,42,.10);
  --line2: rgba(15,23,42,.14);

  --shadow: 0 10px 24px rgba(15,23,42,.06);
  --shadow2: 0 16px 40px rgba(15,23,42,.10);

  --radius: 18px;
  --radius2: 14px;

  --accent: #1d4ed8;
  --accent2: rgba(29,78,216,.14);

  --ok: #16a34a;
  --warn: #2563eb;
  --bad: #e11d48;

  --max: 1180px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

a{ color:inherit; text-decoration:none; }
img{ display:block; max-width:100%; height:auto; }

.sr{
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  border:0;
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 14px 36px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(246,247,251,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.brand{
  font-weight: 900;
  letter-spacing: .2px;
}
.brand span{
  font-weight: 700;
  color: var(--muted);
  margin-left: 6px;
}

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
}
.nav a{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 700;
}
.nav a:hover{
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.7);
}
.nav a.is-active{
  color: var(--text);
  border-color: rgba(29,78,216,.25);
  background: rgba(29,78,216,.06);
}

.lang{
  display:flex;
  gap: 8px;
}
.lang a{
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .4px;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.7);
}
.lang a:hover{ color: var(--text); }
.lang a.is-active{
  color: var(--text);
  border-color: rgba(29,78,216,.25);
  background: rgba(29,78,216,.06);
}

.panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__head{
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}

.panel__head h1{
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.2px;
  line-height: 1.15;
}

.muted{ color: var(--muted); }
.small{ font-size: 12px; }

.panel__body{
  padding: 16px 18px 18px;
}

.searchbar, .filters{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.input, .select{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--text);
  outline: none;
}
.input:focus, .select:focus{
  border-color: rgba(29,78,216,.45);
  box-shadow: 0 0 0 4px var(--accent2);
}
.input::placeholder{ color: rgba(100,116,139,.95); }

.input.tiny{ width: 110px; }

.pill{
  height: 40px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(255,255,255,.7);
  color: var(--text);
  font-size: 13px;
  user-select:none;
}
.pill input{ accent-color: var(--accent); }

.btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.16);
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .2px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
.btn:hover{ filter: brightness(1.05); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  border-color: transparent;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

.back{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-weight: 900;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.back:hover{
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.7);
}

.kpi{
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.empty{
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(15,23,42,.18);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(15,23,42,.02);
}

/* Product list (search/category) */
.list{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.item{
  display:grid;
  grid-template-columns: 74px 1fr auto;
  gap: 14px;
  align-items:center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:#fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.item:hover{
  transform: translateY(-1px);
  border-color: rgba(29,78,216,.18);
  box-shadow: var(--shadow2);
}

.thumb{
  width: 74px;
  height: 74px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
  overflow:hidden;
  display:grid;
  place-items:center;
}
.thumb img{
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.meta .name{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.25;
  margin: 0 0 6px;
}
.badges{ display:flex; gap: 8px; flex-wrap: wrap; }

.badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.02);
  font-weight: 800;
}
.badge.ok{ border-color: rgba(22,163,74,.25); color: #0f172a; }
.badge.warn{ border-color: rgba(37,99,235,.25); color: #0f172a; }
.badge.bad{ border-color: rgba(225,29,72,.25); color: #0f172a; }

.price{
  text-align: right;
  min-width: 120px;
}
.price .now{
  font-weight: 1000;
  font-size: 16px;
  letter-spacing: .2px;
}
.price .was{
  margin-top: 6px;
  color: rgba(100,116,139,.95);
  text-decoration: line-through;
  font-size: 12px;
}

.pager{
  margin-top: 16px;
  display:flex;
  justify-content:space-between;
  gap: 10px;
}
.pager a{
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(255,255,255,.7);
  font-weight: 900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.pager a:hover{
  border-color: rgba(29,78,216,.25);
  background: rgba(29,78,216,.06);
}

.footer{
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.75);
}
.footer__inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 820px){
  .panel__head{ flex-direction: column; align-items: stretch; }
  .searchbar, .filters{ justify-content: flex-start; }
}
@media (max-width: 520px){
  .item{
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "thumb meta"
      "price price";
    align-items: start;
  }
  .thumb{ width: 64px; height: 64px; }
  .thumb img{ width: 64px; height: 64px; }
  .price{ text-align: left; min-width: 0; margin-top: 6px; }
}
