body {
  padding: var(--size-5);
}

header {
  display: flex;
  align-items: center;
  gap: var(--size-2);
}

main {
  width: 100%;
  max-width: var(--width-sm);
  margin-inline: auto;
  padding-block: var(--size-6) var(--size-10);

  h1 {
    display: flex;
    align-items: center;
    gap: var(--size-3);
    font-size: var(--scale-fluid-5);
    letter-spacing: var(--letter-sm);
    margin-bottom: var(--size-6);
  }
}

/* the configurator card: option rows, then a divider, then the order
   summary (price, what the selection buys, buy button) */
#plan-selector {
  display: flex;
  flex-direction: column;
  gap: var(--size-5);
  padding: var(--size-6);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (max-width: 480px) {
  #plan-selector {
    padding: var(--size-4);
  }
}

/* micro-label shared by the option rows and the price: tiny uppercase
   caption with a leading icon */
#plan-selector .label {
  display: inline-flex;
  align-items: center;
  gap: var(--size-1);
  font-size: var(--scale-000);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--letter-lg);
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);

  [role='group'] {
    display: flex;
    flex-wrap: wrap;
    gap: var(--size-2);
  }

  button {
    padding: var(--size-2) var(--size-4);
    cursor: pointer;
    border-radius: var(--radius-sm);
    /* 2px on every state so toggling solid/dotted never shifts layout */
    border: 2px solid var(--border);
    background-color: var(--background);
    color: var(--foreground);
    font-weight: var(--weight-medium);
    transition: background-color 0.15s ease, border-color 0.15s ease,
      opacity 0.15s ease;

    &:hover:not(.selected) {
      background-color: var(--accent);
      border-color: var(--muted-foreground);
    }

    &.selected {
      border-color: var(--primary);
      background-color: var(--primary-muted);
      color: var(--primary-muted-foreground);
    }

    &.unavailable {
      border-style: dotted;
      color: var(--muted-foreground);
      opacity: var(--disabled-opacity);

      /* still clickable (it repairs the combo), so wake up on hover */
      &:hover {
        opacity: 1;
      }
    }
  }
}

/* the order summary: caption over a big amount, mirroring the option rows
   so the whole card reads as one labeled stack */
.price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--size-2);
  padding-top: var(--size-5);
  border-top: 1px solid var(--border);

  .amount {
    font-size: var(--scale-5);
    font-weight: var(--weight-bold);
    letter-spacing: var(--letter-sm);
    line-height: var(--line-none);
    /* prices swap in place as the selection changes; keep digits steady */
    font-variant-numeric: tabular-nums;
  }
}

/* spec sheet: muted icon+label column, value column — grid keeps the
   pairs aligned no matter how long the labels run */
.plan-details {
  padding: var(--size-4);
  background-color: var(--background);
  border-radius: var(--radius-md);

  dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    gap: var(--size-2) var(--size-6);
    margin: 0;
  }

  dt {
    display: flex;
    align-items: center;
    gap: var(--size-2);
    font-size: var(--scale-00);
    color: var(--muted-foreground);
  }

  dd {
    margin: 0;
    font-weight: var(--weight-medium);
  }
}

.purchase-notes {
  margin-top: var(--size-8);

  h2 {
    font-size: var(--scale-1);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--size-3);
  }

  ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--size-3);
    padding: 0;
    margin: 0;
  }

  /* icon in the left column replaces the list marker */
  li {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--size-3);
    font-size: var(--scale-00);
    color: var(--muted-foreground);

    .icon {
      color: var(--primary);
      /* center against the first text line */
      margin-top: 2px;
    }
  }
}

.buy-now {
  display: block;
  width: 100%;
  padding: var(--size-3);
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--scale-1);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: opacity 0.15s ease;

  &:hover {
    opacity: 0.9;
  }
}
