:root {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(120deg, #f4f7ff, #eef3f6);
  color: #1f2937;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #d6dce5;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.topbar nav {
  display: flex;
  gap: 0.75rem;
}

.nav-link {
  text-decoration: none;
  color: #1e3a8a;
  font-weight: 600;
}

.nav-link.active {
  color: #ef4444;
}

.theme-button {
  border: 1px solid #93c5fd;
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.page-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem;
}

.panel {
  border: 1px solid #d6dce5;
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem;
}

.counter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.counter button,
.card-actions button,
.contact-form button {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  background: #0ea5e9;
  color: #ffffff;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.product-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
}

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

.price {
  margin: 0;
  font-weight: 700;
}

.category {
  margin: 0;
  color: #64748b;
}

.card-actions {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.details-page img {
  width: min(280px, 100%);
  display: block;
  margin: 0.75rem 0;
}

.contact-form {
  display: grid;
  gap: 0.55rem;
}

.error-message {
  margin: 0;
  color: #b91c1c;
}

.success-message {
  margin: 0;
  color: #15803d;
  font-weight: 700;
}

.app-shell.dark {
  background: #0f172a;
  color: #e2e8f0;
}

.app-shell.dark .topbar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: #334155;
}

.app-shell.dark .panel {
  background: #1e293b;
  border-color: #334155;
}

.app-shell.dark .product-card {
  background: #1f2937;
  border-color: #334155;
}

.app-shell.dark .nav-link {
  color: #93c5fd;
}

.app-shell.dark .nav-link.active {
  color: #fb7185;
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar nav {
    width: 100%;
    justify-content: space-between;
  }
}
