:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #17243b;
  --muted: #66758c;
  --line: #dfe5ee;
  --brand: #1765d1;
  --brand-dark: #104ca3;
  --radius: 15px;
  --shadow: 0 5px 24px rgba(25,45,75,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
}

button { cursor: pointer; }

.container {
  width: min(1240px, calc(100% - 36px));
  margin: auto;
}

.site-header {
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 25px;
  min-height: 76px;
}

.logo {
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -1px;
  color: var(--brand);
  white-space: nowrap;
}

.logo span { color: var(--ink); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 23px;
  margin-left: auto;
}

.main-nav a {
  font-size: 14px;
  font-weight: 650;
}

.main-nav a:hover { color: var(--brand); }

.search-bar {
  display: flex;
  flex: 1;
  max-width: 450px;
}

.search-bar input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  outline-color: var(--brand);
}

.search-bar button {
  border-radius: 0 10px 10px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--brand);
  color: white;
  border-radius: 10px;
  padding: 11px 19px;
  font-weight: 700;
  transition: background .15s;
}

.btn:hover { background: var(--brand-dark); }

.btn.secondary {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.btn.secondary:hover { background: #edf2fa; }

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.hero {
  padding: 85px 0;
  background: linear-gradient(120deg, #112b59, #1765d1);
  color: white;
}

.hero h1 {
  font-size: clamp(35px, 5vw, 61px);
  letter-spacing: -2px;
  line-height: 1.1;
  margin: 0 0 18px;
  max-width: 780px;
}

.hero p {
  font-size: 18px;
  opacity: .9;
  max-width: 650px;
  margin-bottom: 28px;
}

.hero .btn {
  background: white;
  color: #153c80;
}

.section { padding: 45px 0; }

.section-title {
  font-size: 28px;
  letter-spacing: -.7px;
  margin: 0 0 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.product-card {
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s;
}

.product-card:hover { transform: translateY(-3px); }

.product-image {
  background: #eef2f7;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info { padding: 17px; }

.product-name {
  font-weight: 750;
  margin: 0 0 8px;
}

.product-price {
  color: var(--brand);
  font-weight: 850;
  font-size: 19px;
}

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

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.page-heading {
  padding: 40px 0 20px;
}

.page-heading h1 {
  font-size: 35px;
  margin: 0 0 7px;
  letter-spacing: -1px;
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.detail-image {
  aspect-ratio: 1;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.detail-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-title {
  font-size: 37px;
  letter-spacing: -1px;
  margin: 0 0 15px;
}

.detail-price {
  font-size: 30px;
  font-weight: 850;
  color: var(--brand);
  margin: 18px 0;
}

.form-field {
  display: block;
  margin-bottom: 17px;
}

.form-field span {
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.auth-panel {
  max-width: 480px;
  margin: 45px auto;
}

.auth-panel h1 { margin-top: 0; }

.alert {
  padding: 13px 15px;
  border-radius: 10px;
  background: #eef4fd;
  border: 1px solid #cbdcf5;
  margin: 15px 0;
}

.alert.error {
  background: #fff0f0;
  border-color: #f3cccc;
  color: #9d2424;
}

.basket-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.basket-row img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.basket-row .grow { flex: 1; }

.basket-row input {
  width: 75px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  margin-top: 65px;
  padding: 42px 0;
  background: #12233e;
  color: white;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-inner a {
  color: #c7d5e9;
  margin-right: 17px;
}

.empty-state {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.hidden { display: none !important; }

@media (max-width: 950px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; padding: 12px 0; }
  .search-bar { order: 3; max-width: none; flex-basis: 100%; }
}

@media (max-width: 620px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-info { padding: 11px; }
  .main-nav { gap: 11px; }
  .main-nav a { font-size: 12px; }
  .logo { font-size: 21px; }
  .hero { padding: 55px 0; }
  .section { padding: 25px 0; }
  .basket-row { flex-wrap: wrap; }
}
