/* Global */
:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  background: #f4f7ff;
  color: #12263f;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #f4f7ff;
  color: #102a43;
  line-height: 1.6;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1040px, calc(100% - 24px));
  margin: 0 auto;
  padding: 0 12px;
}

.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #e8eefc 100%);
  padding: 20px 0 14px;
}

.header-top {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.header-top h1 {
  font-size: 1.8rem;
  margin: 0;
}

.hero-panel {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
  margin-bottom: 18px;
}

.hero-card {
  margin-bottom: 16px;
}

.search-box {
  display: grid;
  gap: 10px;
}

.search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #f8fbff;
}

.search-box button {
  width: 100%;
}

.status-card {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 16px;
}

.status-card .eyebrow {
  margin-bottom: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-card h3 {
  margin: 0;
  font-size: 1rem;
}

.status-card .status-count {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.category-grid {
  width: 100%;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #102a43;
  text-decoration: none;
  flex: 1 1 calc(33% - 14px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.category-card.active,
.category-card:hover {
  border-color: transparent;
  background: #1d4ed8;
  color: #fff;
}

.category-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.category-card p {
  margin: 0;
  font-size: 0.95rem;
  color: inherit;
}

.brand-group {
  margin-top: 1.5rem;
}

.brand-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand-count {
  font-size: 0.9rem;
}

.category-code {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #e0e7ff;
  color: #1d4ed8;
  font-weight: 700;
}

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

.product-card {
  background: #ffffff;
  border: none;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-rows: auto 1fr;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 14px;
}

.product-category {
  display: inline-flex;
  margin-bottom: 12px;
  color: #0f46d4;
  font-weight: 700;
}

.product-description {
  color: #475569;
  margin: 14px 0 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.product-price {
  font-size: 1.1rem;
  color: #0f172a;
}

.store-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  margin-bottom: 56px;
}

.store-sidebar {
  display: grid;
  gap: 20px;
}

.sidebar-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.sidebar-header {
  margin-bottom: 18px;
}

.category-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 18px;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.category-panel[open] summary {
  background: #eff6ff;
}

.category-panel .category-list {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-content {
  display: grid;
  gap: 30px;
}

.store-intro {
  padding: 24px 0 8px;
}

.store-intro h2 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
}

.store-intro p {
  color: #475569;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1e3a8a;
  text-decoration: none;
}

.chip.active,
.chip:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: transparent;
}

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

  .category-card {
    flex: 1 1 100%;
  }
}

@media (max-width: 700px) {
  .site-header {
    padding: 20px 0 16px;
  }

  .category-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .category-code {
    width: 46px;
    height: 46px;
  }

  .search-box button,
  .btn,
  .button {
    width: 100%;
  }

  .hero-panel,
  .sidebar-panel,
  .panel {
    padding: 20px;
  }

  .product-card {
    border-radius: 22px;
  }

  .card-body {
    padding: 18px;
  }
}

@media (min-width: 720px) {
  .search-box {
    grid-template-columns: 1fr auto;
  }

  .search-box button {
    width: auto;
    min-width: 150px;
  }
}

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

@media (max-width: 700px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-top .button,
  .search-box button {
    width: 100%;
  }

  .hero-panel,
  .sidebar-panel,
  .panel {
    padding: 20px;
  }

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

  .product-card {
    border-radius: 22px;
  }

  .card-body {
    padding: 18px;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
}

/* Typography */
.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: #1d4ed8;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(1.7rem, 2.5vw + 0.9rem, 2.6rem);
}

h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

h3 {
  font-size: 1rem;
}

.lead {
  max-width: 620px;
  color: #334e68;
  margin: 12px 0 0;
}

/* Header */
.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #e8eefc 100%);
  padding: 40px 0 32px;
}

.admin-header {
  padding-bottom: 24px;
}

.header-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  cursor: pointer;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: #1d4ed8;
  color: #fff;
}

.button-secondary {
  background: #e0e7ff;
  color: #1d4ed8;
}

.button-ghost {
  background: transparent;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.16);
}

.button-danger {
  background: #dc2626;
  color: #fff;
}

/* Public page */
.products-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.product-card {
  background: #ffffff;
  border: none;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.product-image {
  min-height: 220px;
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 22px;
}

.product-category {
  display: inline-flex;
  margin-bottom: 12px;
  color: #0f46d4;
  font-weight: 700;
}

.product-description {
  color: #475569;
  margin: 14px 0 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.product-price {
  font-size: 1.1rem;
  color: #0f172a;
}

.store-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  margin-bottom: 56px;
}

.store-sidebar {
  display: grid;
  gap: 20px;
}

.sidebar-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.sidebar-header {
  margin-bottom: 18px;
}

.category-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 18px;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.category-panel[open] summary {
  background: #eff6ff;
}

.category-panel .category-list {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-box {
  display: grid;
  gap: 12px;
}

.search-box input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #cbd5e1;
  background: #f8fbff;
}

.search-box button {
  width: 100%;
}

.store-content {
  display: grid;
  gap: 30px;
}

.store-intro {
  padding: 24px 0 8px;
}

.store-intro h2 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
}

.store-intro p {
  color: #475569;
  max-width: 760px;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

/* Categories */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.chip {
  padding: 10px 18px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #1e3a8a;
}

.chip.active,
.chip:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: transparent;
}

/* Contact */
.contact-panel {
  margin: 48px 0 80px;
}

.panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.06);
}

.contact-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.contact-card {
  padding: 20px;
  border-radius: 18px;
  background: #f8fafc;
}

.site-footer {
  padding: 28px 0 36px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #64748b;
}

/* Login and admin */
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.login-panel {
  width: min(460px, calc(100% - 32px));
}

.login-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
  margin-bottom: 10px;
}

.login-card p {
  margin: 0 0 24px;
  color: #475569;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
}

textarea {
  resize: vertical;
}

.alert {
  padding: 16px;
  border-radius: 16px;
}

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
}

.hint {
  margin-top: 16px;
  color: #64748b;
}

.admin-grid {
  display: grid;
  gap: 28px;
  padding: 32px 0 80px;
}

.admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.06);
}

.admin-fullwidth {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  color: #0f172a;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

tbody td {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

table button {
  padding: 10px 16px;
}

.empty-state {
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  padding: 32px;
  border-radius: 20px;
  text-align: center;
}

@media (max-width: 860px) {
  .header-content,
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .button {
    width: 100%;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
