:root {
  --bg: #f7f3f7;
  --card: #ffffff;
  --text: #221b24;
  --muted: #766977;
  --accent: #cc3f8f;
  --accent-dark: #a92d73;
  --border: #eadfeb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 22px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ff73c6, #8f4fff);
  color: white;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(143, 79, 255, 0.25);
}

.site-header h1 {
  margin: 0;
  font-size: 32px;
}

.site-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-link,
.back-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 60px;
}

.hero {
  background: linear-gradient(135deg, #fff, #ffeaf6);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 34px;
  margin-bottom: 24px;
}

.hero h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 240px 130px;
  gap: 12px;
  margin-bottom: 28px;
}

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

.filters input,
.filters select,
.login-card input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

button,
.button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  display: inline-block;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: #34283a;
}

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

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(40, 20, 45, 0.06);
}

.preview {
  display: block;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.preview img,
.detail-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.placeholder-preview {
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  background: radial-gradient(circle at top left, #ff9bdd, #8f4fff);
}

.placeholder-preview.large {
  min-height: 480px;
  border-radius: 24px;
}

.product-info {
  padding: 18px;
}

.category {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-info h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.product-info h3 a {
  text-decoration: none;
}

.price {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
}

.price.big {
  font-size: 34px;
}

.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 34px;
  align-items: start;
}

.detail-preview,
.detail-info,
.admin-panel,
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
}

.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.small-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
}

.login-card h1,
.login-card h2 {
  margin-top: 0;
}

.login-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
}

.error {
  background: #ffe5e5;
  color: #a40000;
  border: 1px solid #ffb5b5;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px;
  text-align: left;
}

@media (max-width: 950px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

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

.secondary-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.admin-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.product-form {
  display: grid;
  gap: 18px;
  max-width: 760px;
}

.product-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.product-form input,
.product-form textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
}

.checkbox-row input {
  width: auto;
}

.danger-button {
  background: #b00020;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}

.danger-button:hover {
  background: #850018;
}

.actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.actions-cell form {
  margin: 0;
}

.small-button,
.toggle-button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #34283a;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.toggle-button {
  background: #6b4bb8;
}

.small-button:hover,
.toggle-button:hover {
  filter: brightness(0.9);
}

.status-shown {
  color: #147a2e;
}

.status-hidden {
  color: #a40000;
}

.edit-preview {
  max-width: 220px;
  max-height: 220px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
