/* Calculator styles: discount */

/* Layout: discount form sections */
.discount-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.discount-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.discount-grid--price {
  grid-template-columns: minmax(0, 1fr);
}

.discount-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discount-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-card-text, #111827);
}

.discount-field--toggle .vareoncalc-toggle {
  width: 100%;
  min-width: 0;
}

.discount-mode-toggle__control {
  min-width: 108px;
}

.discount-price-field {
  width: 100%;
}

.discount-price-field__label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.discount-price-field__label-row label {
  margin: 0;
}

.discount-price-field__label-row .discount-mode-toggle {
  justify-self: end;
}

.discount-price-field .discount-price-input {
  width: 100%;
}

.discount-advanced-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discount-grid--advanced .discount-field--wide {
  grid-column: 1 / -1;
}

.discount-static {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--sc-input-border, #d1d5db);
  border-radius: 10px;
  background: var(--sc-input-bg, #f9fafb);
  color: var(--sc-card-text, #111827);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .discount-grid {
    grid-template-columns: 1fr;
  }

  .discount-price-field {
    max-width: none;
  }

}

/* Receipt headline: Final Price (the big number) */
.vareoncalc-receipt-headline {
  padding: var(--sc-card-padding);
  text-align: center;
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
}

.vareoncalc-receipt-headline--discount {
  border-top: 2px dashed var(--sc-card-border, #e5e7eb);
}

.vareoncalc-receipt-headline .receipt-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--sc-card-text, #111827);
  line-height: 1.2;
}

.vareoncalc-receipt-headline .receipt-label {
  font-size: 13px;
  color: var(--sc-muted-text, #6b7280);
  margin-top: 4px;
}

/* Receipt breakdown card: the math */
.vareoncalc-receipt-breakdown {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--sc-card-padding);
  font-size: 14px;
  line-height: 1.8;
  flex: 1;
}

.vareoncalc-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
}

.vareoncalc-receipt-row .receipt-label {
  color: var(--sc-muted-text, #6b7280);
  min-width: 0;
}

.vareoncalc-receipt-row .receipt-value {
  font-weight: 600;
  color: var(--sc-card-text, #111827);
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Discount amount: RED for deductions */
.vareoncalc-receipt-row .receipt-value--discount {
  color: #dc2626;
  font-weight: 600;
}

.receipt-sign {
  margin-right: 0.1em;
}

/* Group dividers: visual separation between per-item and cart math */
.vareoncalc-receipt-group + .vareoncalc-receipt-group {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--sc-card-border, #e5e7eb);
}

/* Final price row: amber highlight */
.vareoncalc-receipt-row--final .receipt-label,
.vareoncalc-receipt-row--final .receipt-value {
  color: #b45309;
  font-weight: 700;
}

/* Savings box: GREEN "emotional payoff" */
.vareoncalc-receipt-savings {
  background: #ecfdf5;
  border-top: 1px solid #a7f3d0;
  padding: var(--sc-card-padding);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.vareoncalc-receipt-savings .savings-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #059669;
}

.vareoncalc-receipt-savings .savings-text {
  font-size: 16px;
  font-weight: 700;
  color: #059669;
  line-height: 1.3;
}

/* Dark theme adjustments */
.vareoncalc-root[data-theme="dark"] .vareoncalc-receipt-row--final .receipt-label,
.vareoncalc-root[data-theme="dark"] .vareoncalc-receipt-row--final .receipt-value,
.vareoncalc-root.theme-dark .vareoncalc-receipt-row--final .receipt-label,
.vareoncalc-root.theme-dark .vareoncalc-receipt-row--final .receipt-value {
  color: #fbbf24;
}

.vareoncalc-root[data-theme="dark"] .vareoncalc-receipt-savings,
.vareoncalc-root.theme-dark .vareoncalc-receipt-savings {
  background: rgba(16, 185, 129, 0.15);
  border-top-color: rgba(16, 185, 129, 0.3);
}

.vareoncalc-root[data-theme="dark"] .vareoncalc-receipt-savings .savings-icon,
.vareoncalc-root.theme-dark .vareoncalc-receipt-savings .savings-icon {
  color: #34d399;
}

.vareoncalc-root[data-theme="dark"] .vareoncalc-receipt-savings .savings-text,
.vareoncalc-root.theme-dark .vareoncalc-receipt-savings .savings-text {
  color: #34d399;
}

@media (max-width: 410px) {
  .discount-form,
  .discount-grid {
    gap: 8px;
  }

  .discount-price-field__label-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .discount-price-field__label-row .discount-mode-toggle {
    justify-self: start;
  }

  .discount-advanced-toggle {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 360px) {
  .discount-mode-toggle__control {
    width: 100%;
    min-width: 0;
  }

  .discount-static {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@container vareoncalc (max-width: 410px) {
  .discount-form,
  .discount-grid {
    gap: 8px;
  }

  .discount-price-field__label-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .discount-price-field__label-row .discount-mode-toggle {
    justify-self: start;
  }

  .discount-advanced-toggle {
    flex-direction: column;
    align-items: stretch;
  }
}

@container vareoncalc (max-width: 360px) {
  .discount-mode-toggle__control {
    width: 100%;
    min-width: 0;
  }

  .discount-static {
    padding: 8px 10px;
    font-size: 12px;
  }
}
