* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fafaf9;
  color: #17211f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.configurator {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

.panel {
  width: min(100%, 760px);
  padding: 28px;
  background: #ffffff;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  box-shadow: 0 22px 48px rgba(24, 40, 37, 0.13);
}

.panel-header {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #111816;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.option-section {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  color: #253633;
  font-size: 0.98rem;
  font-weight: 800;
}

.option-grid,
.size-grid {
  display: grid;
  gap: 12px;
}

.option-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.size-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 126px;
  padding: 14px 10px;
  background: #ffffff;
  color: #17211f;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.option-card:hover {
  border-color: #0f766e;
  box-shadow: 0 10px 24px rgba(24, 40, 37, 0.12);
  transform: translateY(-1px);
}

.option-card.active {
  background: #173d3a;
  border-color: #173d3a;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(23, 61, 58, 0.24);
}

.option-card:focus-visible,
.primary-button:focus-visible {
  outline: 3px solid #c2995d;
  outline-offset: 3px;
}

.shape-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border: 2px solid currentColor;
}

.shape-round {
  border-radius: 50%;
}

.shape-square {
  transform: rotate(45deg) scale(0.82);
}

.shape-oval {
  width: 29px;
  height: 40px;
  border-radius: 50%;
}

.shape-pear {
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.option-name {
  display: block;
  color: inherit;
  font-weight: 800;
}

.option-price {
  display: block;
  margin-top: 6px;
  color: #9a5c13;
  font-size: 0.88rem;
  font-weight: 700;
}

.option-card.active .option-price {
  color: #f2c46d;
}

.size-card {
  min-height: 86px;
}

.size-card .option-name {
  font-size: 1.18rem;
}

.summary {
  margin-top: 8px;
  padding: 18px;
  background: #f6f8f8;
  border: 1px solid #d5dfdc;
  border-radius: 8px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.summary-row span {
  color: #526863;
  font-size: 0.84rem;
  font-weight: 700;
}

.summary-row strong {
  color: #17211f;
  font-size: 0.94rem;
  text-align: right;
  word-break: break-word;
}

.total-row {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #d5dfdc;
}

.total-row strong {
  color: #0f766e;
  font-size: 1.3rem;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  padding: 14px 22px;
  background: #111816;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition:
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.primary-button:hover {
  background: #0f766e;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

@media (max-width: 700px) {
  .configurator {
    align-items: stretch;
    padding: 16px;
  }

  .panel {
    padding: 20px;
  }

  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .size-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-row {
    display: grid;
    gap: 6px;
  }

  .summary-row strong {
    text-align: left;
  }

}
