* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 40px;
  background: #f7f4ef;
  color: #1f1f1f;
}

a {
  color: #111;
}

h1, h2 {
  line-height: 1.2;
}

.page,
.box,
.cart,
.product {
  max-width: 1000px;
  margin: auto;
  background: #fff;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.07);
}

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

.card {
  background: #fff;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 8px 25px rgba(0,0,0,.06);
}

.card img,
.product img {
  max-width: 100%;
  border-radius: 14px;
}

.price,
.total {
  font-weight: 700;
  font-size: 1.15rem;
}

.button,
button {
  display: inline-block;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.secondary {
  background: #ddd;
  color: #111;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font: inherit;
}

textarea {
  min-height: 120px;
}

label {
  display: block;
  font-weight: 600;
  margin-top: 14px;
}

.item {
  border-bottom: 1px solid #eee;
  padding: 14px 0;
}

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

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

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

td,
th {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: white;
  padding: 32px;
  border-radius: 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.error {
  color: #b00020;
}

@media (max-width: 700px) {
  body {
    padding: 20px;
  }

  .page,
  .box,
  .cart,
  .product {
    padding: 22px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

.site-header {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #ece7df;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: -40px -40px 40px -40px;
}

.header-inner {
  max-width: 1100px;
  margin: auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav a {
  color: #555;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}

.main-nav a:hover {
  color: #111;
}

.site-footer {
  text-align: center;
  color: #777;
  padding: 40px 20px;
  font-size: .95rem;
}

@media (max-width: 700px) {

  .site-header {
    margin: -20px -20px 30px -20px;
  }

  .header-inner {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 14px;
  }

}

.admin-menu {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.admin-menu a {
  text-decoration: none;
  color: #555;
  font-weight: 600;
}

.admin-menu a:hover {
  color: #111;
}

select {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font: inherit;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 260px));
  gap: 4rem;
  justify-content: center;
  margin: 4rem auto;
}

.category-box {
  aspect-ratio: 1 / 1;
  border: 4px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  background: #fff;
}

.category-box span {
  font-size: 1.8rem;
  color: #990000;
}

.category-box:hover {
  background: #faf5f0;
}

@media (max-width: 800px) {
  .category-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    gap: 2rem;
  }
}
