.cad-subtitle {
  margin: 0;
}

/* User Type Selector CSS has been extracted to app-toggle-selector component */
app-toggle-selector.user-type-selector-compact {
  display: block;
  width: 100%;
  max-width: 400px;
}

.shipping-option {
  margin: var(--space-6) 0;
}

.legal-consent {
  margin: var(--space-4) 0 var(--space-4);
}

.consent-error {
  margin-top: var(--space-2);
  margin-left: 2.1rem;
  color: var(--color-danger-500);
  font-size: 0.9rem;
}

.checkout-summary-section {
  position: relative;
}

.sticky-card {
  position: sticky;
  top: var(--space-6);
}

.summary-items {
  margin-bottom: var(--space-6);
  max-height: 450px;
  overflow-y: auto;
  padding-right: var(--space-2);
  padding-top: var(--space-2);

  &::-webkit-scrollbar {
    width: 4px;
  }
  &::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
  }
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);

  &:first-child {
    padding-top: 0;
  }
  &:last-child {
    border-bottom: none;
  }

  .item-details {
    flex: 1;

    .item-name {
      display: block;
      font-weight: 600;
      font-size: 0.95rem;
      margin-bottom: var(--space-1);
      word-break: break-all;
      color: var(--color-text);
    }

    .item-specs {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      font-size: 0.85rem;
      color: var(--color-text-muted);

      .item-color {
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }

      .color-dot {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        display: inline-block;
        border: 1px solid var(--color-border);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
      }

      .color-name {
        font-weight: 500;
        color: var(--color-text-muted);
      }
    }

    .item-specs-sub {
      font-size: 0.8rem;
      color: var(--color-text-muted);
      margin-top: 2px;
    }

    .item-preview {
      margin-top: var(--space-3);

      .preview-trigger {
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        text-align: center;

        .preview-surface {
          position: relative;
          width: min(320px, 100%);
          margin-inline: auto;
          border: 2px solid var(--color-border);
          border-radius: var(--radius-lg);
          overflow: hidden;
          transition:
            transform 0.18s ease,
            box-shadow 0.18s ease,
            border-color 0.18s ease;
        }

        .preview-pill {
          position: absolute;
          top: 8px;
          right: 8px;
          background: rgba(17, 24, 39, 0.84);
          color: #fff;
          border-radius: 999px;
          font-size: 0.72rem;
          font-weight: 700;
          letter-spacing: 0.02em;
          padding: 4px 10px;
          pointer-events: none;
        }

        &:hover .preview-surface,
        &:focus-visible .preview-surface {
          border-color: var(--color-brand);
          box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
          transform: translateY(-1px);
        }

        &:focus-visible {
          outline: none;
        }
      }

      .preview-state {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        background: var(--color-neutral-50);
        color: var(--color-text-muted);
        font-size: 0.8rem;
        min-height: 74px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: var(--space-2);
      }

      .preview-state-error {
        color: var(--color-danger-600, #dc2626);
      }
    }
  }

  .item-price {
    font-weight: 600;
    margin-left: var(--space-3);
    white-space: nowrap;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    .item-unit-price {
      margin-top: 2px;
      font-size: 0.75rem;
      font-weight: 400;
      color: var(--color-text-muted);
      line-height: 1.2;
    }
  }
}

.cad-summary-item {
  background: var(--color-neutral-100);
  border-radius: var(--radius-sm);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.ui-actions {
  app-button {
    width: 100%;
  }
}

.error-message {
  color: var(--color-error);
  background: var(--color-surface-danger);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  border: 1px solid #fecaca;
  font-weight: 500;
}

.preview-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 22, 0.72);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.preview-modal {
  width: min(820px, 96vw);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: var(--space-4);
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);

  h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    word-break: break-word;
  }
}

.preview-modal-close {
  border: 1px solid var(--color-border);
  background: var(--color-neutral-50);
  color: var(--color-text);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.mb-6 {
  margin-bottom: var(--space-6);
}
