* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #172033;
  font-family: Arial, sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 6%;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.brand {
  font-size: 23px;
  font-weight: bold;
  color: #4f46e5;
  text-decoration: none;
}

header a:not(.brand) {
  color: #4f46e5;
  text-decoration: none;
}

main {
  max-width: 1100px;
  margin: 35px auto;
  padding: 0 20px;
}

h1 {
  margin-top: 0;
}

.panel {
  padding: 26px;
  margin-bottom: 30px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 3px 15px #1720330a;
}

.hidden {
  display: none !important;
}

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: bold;
  font-size: 14px;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #dbe1ea;
  border-radius: 8px;
  font: inherit;
}

button,
.button {
  display: inline-block;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: #4f46e5;
  color: white;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: #4338ca;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondary {
  background: #e9eafe;
  color: #4338ca;
}

.secondary:hover {
  background: #dfe1ff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.muted {
  color: #64748b;
  line-height: 1.7;
}

.price {
  color: #4f46e5;
  font-size: 28px;
  font-weight: bold;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.product-card {
  overflow: hidden;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.product-card:hover {
  box-shadow: 0 8px 25px #17203312;
  transform: translateY(-2px);
}

.product-card:focus-visible {
  outline: 3px solid #818cf8;
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fff;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 10px;
}

.preview {
  display: block;
  max-width: 220px;
  max-height: 180px;
  margin-top: 12px;
  object-fit: contain;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.image-area {
  display: grid;
  place-items: center;
  min-height: 300px;
  background: #f8fafc;
  border-radius: 12px;
}

.image-area img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.hero-image {
  width: 100%;
  height: 350px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 12px;
}

.description {
  color: #374151;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.full-description {
  white-space: pre-wrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

#formMessage,
#status {
  white-space: pre-wrap;
}

@media (max-width: 750px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  header {
    padding: 16px 20px;
  }

  .panel {
    padding: 18px;
  }
}

.error {
  color: #dc2626;
}

.qr-section {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.qr-image {
  width: 280px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-top: 16px;
}
