* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f6f8;
  color: #222;
}

header {
  background: #1f4e79;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

header .logo { font-size: 20px; font-weight: 700; }

nav { display: flex; gap: 6px; flex-wrap: wrap; }

nav button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  padding: 7px 13px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

nav button.active { background: #fff; color: #1f4e79; font-weight: 600; }

.burger {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  font-size: 18px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.header-right button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

main { max-width: 1000px; margin: 22px auto; padding: 0 16px; }

.page { display: none; }
.page.active { display: block; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .09);
  margin-bottom: 18px;
}

h2 { margin: 0 0 14px; font-size: 19px; color: #1f4e79; }

label { display: block; font-size: 13px; margin: 10px 0 4px; font-weight: 600; }

input[type=text], input[type=password], input[type=email], input[type=number], select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #ccd3da;
  border-radius: 6px;
  font-size: 14px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 180px; }

button.primary {
  background: #1f4e79;
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 16px;
}

button.primary:disabled { background: #9aa7b4; cursor: not-allowed; }

button.small {
  background: #eef2f6;
  border: 1px solid #ccd3da;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}

.msg { margin-top: 12px; padding: 10px 12px; border-radius: 6px; font-size: 14px; display: none; }
.msg.err { background: #fdecea; color: #a3201a; display: block; }
.msg.ok { background: #e8f5e9; color: #256029; display: block; }

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

.prod {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .09);
  cursor: pointer;
}

.prod .cover { font-size: 38px; }
.prod .t { font-weight: 600; margin: 8px 0 3px; font-size: 14px; }
.prod .a { color: #667; font-size: 12.5px; }
.prod .p { margin-top: 8px; font-weight: 700; color: #1f4e79; }

.old { text-decoration: line-through; color: #999; font-weight: 400; font-size: 13px; margin-left: 6px; }
.out { color: #a3201a; font-size: 12.5px; margin-top: 5px; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }

th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid #e6eaee; font-size: 14px; }
th { color: #667; font-weight: 600; font-size: 12.5px; text-transform: uppercase; }

.total { font-size: 17px; font-weight: 700; margin-top: 14px; }
.hint { color: #778; font-size: 12.5px; margin-top: 5px; }

.summary { margin-top: 14px; font-size: 14px; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; max-width: 340px; }
.summary .grand { font-size: 17px; font-weight: 700; border-top: 1px solid #e6eaee; padding-top: 8px; margin-top: 6px; }

/* [B24] фиксированная минимальная ширина баннера вызывает горизонтальную
   прокрутку страницы на экранах уже 520px */
.banner {
  background: linear-gradient(90deg, #1f4e79, #3a7ca8);
  color: #fff;
  padding: 14px 18px;
  border-radius: 9px;
  margin-bottom: 18px;
  min-width: 520px;
  font-size: 14px;
}

/* [B12] длинное название выводится без переноса — ломает вёрстку карточки */
.detail-title { font-size: 22px; font-weight: 700; white-space: nowrap; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { min-width: 150px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  background: #eef2f6;
  color: #445;
}

.badge.new { background: #e3f2fd; color: #1565c0; }
.badge.paid { background: #e8f5e9; color: #256029; }
.badge.shipping { background: #fff3e0; color: #e65100; }
.badge.done { background: #ede7f6; color: #4527a0; }
.badge.cancelled { background: #fdecea; color: #a3201a; }

.loader { color: #778; font-size: 13px; padding: 12px 0; }

@media (max-width: 720px) {
  nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #1f4e79;
    padding: 12px;
    flex-direction: column;
    z-index: 5;
  }
  nav.open { display: flex; }
  .burger { display: block; }
}
