:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --accent: #2563eb;
  --dark: #1e293b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  background: var(--dark);
  color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: #fff;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  background: #dbeafe;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card > img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.card h2,
.card h3 {
  margin: 0.5rem 0;
  font-size: 1.05rem;
}

.price {
  font-weight: 700;
  color: var(--accent);
  margin-top: auto;
}

button,
.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font: inherit;
}

button.secondary {
  background: #64748b;
}

button:hover,
.btn:hover {
  opacity: 0.9;
}

footer {
  background: var(--dark);
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.form-group {
  margin-bottom: 1rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

textarea {
  min-height: 100px;
}

[hidden] {
  display: none;
}

#account-form {
  max-width: 420px;
}

#account-form button {
  margin-bottom: 0.5rem;
}

.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: end;
}

.filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  min-width: 180px;
}

.specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}

.message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
}

.success {
  background: #dcfce7;
  color: #166534;
}

.error {
  background: #fee2e2;
  color: #991b1b;
}

img {
  max-width: 100%;
}

@media (max-width: 600px) {
  .hero {
    padding: 1rem;
  }
  .filters label {
    min-width: 100%;
  }
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto; 
}

.card-actions .btn,
.card-actions button {
  flex: 1; 
  text-align: center;
  font-size: 0.9rem;
  padding: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: calc(100% - 40px);
  background: #10b981;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Блок с цитатой на главной */
.promo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}


.promo-image img {
  width: 100%;
  height: 100%;
  max-height: 400px;
  object-fit: cover; 
  border-radius: 8px;
  display: block;
}

.promo-quote {
  margin: 0;
  font-size: 1.25rem;
  font-style: italic;
  color: #334155;
  line-height: 1.6;
}

.promo-quote footer {
  background: transparent;
  color: var(--accent);
  text-align: left;
  padding: 0;
  margin-top: 1.5rem;
  font-weight: 600;
  font-style: normal;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .promo {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
}

/* Стили для отзывов */
.reviews-section {
  margin-top: 2rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.reviews-section h3 {
  margin-top: 0;
}

.review {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.review:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f1f5f9; /* Легкий фон на случай прозрачной картинки */
}

.review-content strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--dark);
}

.review-content p {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

/* Большая картинка на странице товара (не обрезается, вписывается целиком) */
.card > img.main-image {
  height: auto;
  max-height: 400px;
  object-fit: contain; /* Картинка будет видна целиком */
  background-color: #f8fafc; /* Легкий фон, если пропорции картинки не совпадают */
}
