/* ==============================================================================
   Roopb / Kito Super App - Refund Purchase Styles
   Matches iOS RefundPurchase.swift, RefundFormView.swift, and RefundSummaryCardView.swift
   ============================================================================== */

.rf-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: var(--surface, #FAF9F6);
  color: var(--text, #1E2022);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .rf-overlay {
  background: #0D0F12;
  color: #F1F5F9;
}

/* Sticky Header */
.rf-nav-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .rf-nav-bar {
  background: rgba(13, 15, 18, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rf-nav-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Form Container */
.rf-container {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Order Info Header Banner */
.rf-order-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .rf-order-banner {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.07);
}

.rf-order-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rf-order-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rf-order-store {
  font-size: 15px;
  font-weight: 700;
}

.rf-order-sub {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Section Header */
.rf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rf-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #10b981;
}

.rf-section-action-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.rf-section-action-btn:hover {
  background: rgba(16, 185, 129, 0.1);
}

/* Items Selection List (Matches iOS RefundItemRowView.swift) */
.rf-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rf-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

[data-theme="dark"] .rf-item-row {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.07);
}

.rf-item-row.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.04);
}

[data-theme="dark"] .rf-item-row.selected {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}

.rf-item-thumb-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  overflow: hidden;
  flex-shrink: 0;
}

.rf-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rf-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rf-item-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rf-item-sub {
  font-size: 12px;
  color: #64748b;
}

.rf-item-variant-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 9999px;
  width: fit-content;
}

/* Checkbox Circle */
.rf-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

[data-theme="dark"] .rf-checkbox {
  border-color: #475569;
}

.rf-checkbox.checked {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

/* Reason Dropdown */
.rf-reason-selector {
  position: relative;
}

.rf-reason-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .rf-reason-trigger {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.08);
}

.rf-reason-trigger:hover {
  border-color: #10b981;
}

.rf-reason-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1070;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  padding: 6px;
}

[data-theme="dark"] .rf-reason-menu {
  background: #1a1e26;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 34px -4px rgba(0, 0, 0, 0.5);
}

.rf-reason-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.rf-reason-item:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.rf-reason-item.selected {
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

/* Payment Method Segmented Grid */
.rf-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rf-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 16px;
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

[data-theme="dark"] .rf-method-card {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.07);
}

.rf-method-card.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
  color: #10b981;
}

.rf-method-title {
  font-size: 12.5px;
  font-weight: 600;
}

/* Media Evidence Upload */
.rf-evidence-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rf-thumbs-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.rf-thumb-preview {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rf-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rf-thumb-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rf-upload-btn-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1.5px dashed rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .rf-upload-btn-label {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.12);
}

.rf-upload-btn-label:hover {
  border-color: #10b981;
}

.rf-upload-icon-orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Description Textarea */
.rf-textarea-wrapper {
  position: relative;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 14px;
}

[data-theme="dark"] .rf-textarea-wrapper {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.08);
}

.rf-textarea {
  width: 100%;
  min-height: 100px;
  border: none;
  background: none;
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

.rf-char-count {
  text-align: right;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ==============================================================================
   Sticky Bottom Summary Card (Matches iOS RefundSummaryCardView.swift)
   ============================================================================== */
.rf-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1060;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
}

[data-theme="dark"] .rf-bottom-bar {
  background: rgba(13, 15, 18, 0.92);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.rf-bottom-content {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rf-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rf-summary-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
}

.rf-summary-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.rf-summary-selected-count {
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
}

.rf-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
}

.rf-submit-btn:disabled {
  background: rgba(0, 0, 0, 0.08);
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

[data-theme="dark"] .rf-submit-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #64748b;
}

/* Success Toast */
.rf-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1090;
  background: #10b981;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

