@use "../../../styles/mixins";

.inlineOrderSummary {
  background: var(--checkout-surface, #FFFFFF);
  border: 1px solid var(--checkout-border, #E5E7EB);
  border-radius: 14px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

// Header
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;

  &:hover {
    opacity: 0.8;
  }
}

.headerTitle {
  font-weight: 600;
  font-size: 16px;
  color: var(--checkout-text-primary, #111827);
}

.headerRight {
  display: flex;
  align-items: center;
  gap: 12px;
}

.headerTotal {
  font-weight: 600;
  font-size: 16px;
  color: var(--checkout-text-primary, #111827);
}

.chevron {
  color: var(--checkout-text-secondary, #6B7280);
  transition: transform 0.15s ease;
}

.chevronRotated {
  transform: rotate(180deg);
}

// Content
.content {
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--checkout-border, #E5E7EB);
}

// Event Info
.eventInfo {
  display: flex;
  gap: 12px;
  padding: 16px 0;
}

.eventImage {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.eventImagePlaceholder {
  width: 100%;
  height: 100%;
  background: var(--checkout-accent-soft, #F3F4F6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--checkout-accent, #9CA3AF);
}

.eventDetails {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eventTitle {
  font-weight: 500;
  font-size: 14px;
  color: var(--checkout-text-primary, #111827);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eventMeta {
  font-size: 13px;
  color: var(--checkout-text-secondary, #6B7280);
  margin-top: 2px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

// Divider
.divider {
  height: 1px;
  background-color: var(--checkout-border, #F3F4F6);
}

// Line Items
.lineItems {
  padding: 16px 0;
}

.lineItem {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  &:not(:last-child) {
    margin-bottom: 12px;
  }
}

.lineItemLeft {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.lineItemName {
  font-size: 14px;
  color: var(--checkout-text-primary, #374151);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  @include mixins.respond-below('sm') {
    max-width: 220px;
  }
}

.lineItemQuantity {
  font-size: 14px;
  color: var(--checkout-text-secondary, #6B7280);
  flex-shrink: 0;
}

.lineItemPriceWrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 16px;
}

.lineItemPriceOriginal {
  font-size: 14px;
  color: var(--checkout-text-tertiary, #9CA3AF);
  text-decoration: line-through;
}

.lineItemPrice {
  font-size: 14px;
  color: var(--checkout-text-primary, #111827);
  font-weight: 500;
}

// Promo Code - uses accent colors
.promoCode {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--checkout-accent-soft, #FEF3C7);
  border: 1px solid var(--checkout-accent-muted, #FDE68A);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 16px 0;
}

.promoCodeLeft {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--checkout-accent, #92400E);
}

.promoCodeDiscount {
  font-size: 14px;
  font-weight: 600;
  color: var(--checkout-accent, #059669);
}

// Totals
.totals {
  padding: 16px 0 0 0;
}

.totalsRow {
  display: flex;
  justify-content: space-between;
  align-items: center;

  &:not(:last-child) {
    margin-bottom: 8px;
  }
}

.totalsLabel {
  font-size: 14px;
  color: var(--checkout-text-secondary, #6B7280);
}

.totalsLabelWithInfo {
  font-size: 14px;
  color: var(--checkout-text-secondary, #6B7280);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.infoIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--checkout-text-tertiary, #9CA3AF);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;

  &:hover {
    opacity: 1;
    color: var(--checkout-text-secondary, #6B7280);
  }
}

.breakdownList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdownItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.breakdownName {
  font-size: 13px;
  color: var(--mantine-color-dimmed, #6B7280);
  flex: 1;
  min-width: 0;
}

.breakdownValue {
  font-size: 13px;
  font-weight: 500;
  color: var(--mantine-color-text, #111827);
  flex-shrink: 0;
}

.totalsValue {
  font-size: 14px;
  color: var(--checkout-text-primary, #111827);
}

.totalsValueFree {
  color: var(--checkout-accent, #10B981);
}

.totalsRowFinal {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--checkout-border, #F3F4F6);
}

.totalsFinalLabel {
  font-size: 16px;
  font-weight: 600;
  color: var(--checkout-text-primary, #111827);
}

.totalsFinalValue {
  font-size: 18px;
  font-weight: 600;
  color: var(--checkout-text-primary, #111827);
}

.totalsCurrency {
  font-size: 14px;
  font-weight: 400;
  color: var(--checkout-text-secondary, #6B7280);
  margin-left: 4px;
}

// Buyer Protection - uses accent colors
.buyerProtection {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--checkout-accent-soft, #ECFDF5);
  border: 1px solid var(--checkout-accent-muted, #D1FAE5);
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 16px;
}

.buyerProtectionIcon {
  color: var(--checkout-accent, #059669);
  flex-shrink: 0;
  margin-top: 1px;
}

.buyerProtectionText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buyerProtectionTitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--checkout-text-primary, #065F46);
}

.buyerProtectionSubtitle {
  font-size: 12px;
  color: var(--checkout-text-secondary, #047857);
}
