/* ============================================
   OPTION GROUP - Premium Food Delivery Design
   ============================================ */

.option-group {
  margin-bottom: 1.75rem;
}

.option-group:last-child {
  margin-bottom: 0;
}

/* Header */
.option-header {
  margin-bottom: 0.875rem;
}

.option-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
}

.option-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-neutral-800);
  margin: 0;
  letter-spacing: -0.01em;
}

.option-hint {
  font-size: 0.8125rem;
  color: var(--color-neutral-600);
  margin: 0;
  line-height: 1.4;
}

/* Badges */
.badge-required {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  /* Phase 4.2a: red-600 on red-50 was 4.43:1 (sub-AA). error-dark → 5.74:1 AA. */
  color: var(--color-error-dark);
  background: var(--color-error-light);
  border: 1px solid var(--color-error-200);
  border-radius: var(--radius-sm);
}

.badge-optional {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
}

/* Choice List — compact stacked list matching the customize bottom
   sheet treatment. Rows separate with a 1px bottom rule, no gaps,
   no individual card outlines. Last row has its own no-rule
   override below. The page-level wrapping (parent has padding +
   the option-group has its own margin) carries the section
   shape; we don't need a card-per-row. */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Choice Card — kept as a class for markup compatibility, but
   styled as a borderless row separated by a bottom rule. */
.choice-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-neutral-200);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.choice-list > .choice-card:last-child {
  border-bottom: 0;
}

/* Hidden Input */
.choice-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
  top: 0;
  left: 0;
}

/* Card Content Layout */
.choice-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

/* Selection Indicators */
.choice-indicator {
  flex-shrink: 0;
}

/* Radio Button (Single Select) */
.indicator-radio {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--color-neutral-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all 0.15s ease;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease;
}

/* Checkbox (Multi Select) */
.indicator-checkbox {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--color-neutral-300);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all 0.15s ease;
}

.indicator-check {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Choice Details */
.choice-details {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.choice-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-neutral-800);
  display: block;
  line-height: 1.3;
  text-align: left;
}

/* Price Styling */
.choice-price {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  margin-left: auto;
}

.price-regular {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-neutral-600);
}

.price-discounted {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-brand-primary-600);
}

.price-original {
  font-size: 0.75rem;
  color: var(--color-neutral-400);
  text-decoration: line-through;
}

.price-free {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-success-dark);
}

/* ============================================
   SELECTED STATE
   ============================================ */

/* Selected row — radio/checkbox indicator carries the brand-color
   signal; no border / background change on the row itself, since
   the rows are now borderless list items rather than cards. */
.choice-card:has(.choice-input:checked) {
  background: transparent;
}

/* Radio Selected */
.choice-input:checked ~ .choice-content .indicator-radio {
  border-color: var(--color-brand-primary-600);
}

.choice-input:checked ~ .choice-content .indicator-dot {
  background: var(--color-brand-primary-600);
}

/* Checkbox Selected */
.choice-input:checked ~ .choice-content .indicator-checkbox {
  border-color: var(--color-brand-primary-600);
  background: var(--color-brand-primary-600);
}

.choice-input:checked ~ .choice-content .indicator-check {
  opacity: 1;
}

/* Text Enhancement on Selection */
.choice-input:checked ~ .choice-content .choice-name {
  color: var(--color-neutral-800);
}

/* ============================================
   FOCUS & ACCESSIBILITY
   ============================================ */

.choice-card:focus-within {
  outline: none;
}

/* ============================================
   FALLBACK FOR BROWSERS WITHOUT :has()
   ============================================ */

/* JavaScript adds .is-selected class. Per DESIGN_LOCKED.md § Choice
   rows ("NO row tint on selection"), only the radio/checkbox
   indicator changes — no row-level border-color or background. */
.choice-card.is-selected .indicator-radio {
  border-color: var(--color-brand-primary-600);
}

.choice-card.is-selected .indicator-dot {
  background: var(--color-brand-primary-600);
}

.choice-card.is-selected .indicator-checkbox {
  border-color: var(--color-brand-primary-600);
  background: var(--color-brand-primary-600);
}

.choice-card.is-selected .indicator-check {
  opacity: 1;
}

.choice-card.is-selected .choice-name {
  color: var(--color-neutral-800);
}

/* ============================================
   RTL SUPPORT
   ============================================ */

[dir="rtl"] .choice-name,
[dir="rtl"] .choice-details {
  text-align: right;
}

[dir="rtl"] .option-title,
[dir="rtl"] .option-hint {
  text-align: right;
}

[dir="rtl"] .choice-price {
  margin-left: 0;
  margin-right: auto;
}

