/* Checkout Redesign - Vape.gg Two-Column Style with Full Functionality */

/* Theme Variables */
:root {
  --checkout-bg: #ffffff;
  --checkout-surface: #fafafa;
  --checkout-card: #ffffff;
  --checkout-text-primary: #0f0f0f;
  --checkout-text-secondary: #737373;
  --checkout-border: #e5e5e5;
  --checkout-accent: #14b8a6;
  --checkout-accent-hover: #0d9488;
  --checkout-input-bg: #ffffff;
  --checkout-input-border: #e5e5e5;
  --checkout-button-text: #ffffff;
  --checkout-shadow: rgba(0, 0, 0, 0.04);
  --checkout-shadow-lg: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --checkout-bg: #0a0a0a;
  --checkout-surface: #141414;
  --checkout-card: #141414;
  --checkout-text-primary: #ffffff;
  --checkout-text-secondary: #a3a3a3;
  --checkout-border: #262626;
  --checkout-accent: #14b8a6;
  --checkout-accent-hover: #0d9488;
  --checkout-input-bg: #1a1a1a;
  --checkout-input-border: #262626;
  --checkout-button-text: #ffffff;
  --checkout-shadow: rgba(0, 0, 0, 0.3);
  --checkout-shadow-lg: rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.checkout-body {
  margin: 0;
  padding: 0;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--checkout-bg);
  color: var(--checkout-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--checkout-card);
  border: 1px solid var(--checkout-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.2s ease;
  color: var(--checkout-text-primary);
  box-shadow: 0 2px 8px var(--checkout-shadow);
}

.theme-toggle:hover {
  transform: scale(1.05);
  border-color: var(--checkout-accent);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--checkout-border);
  border-top-color: var(--checkout-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main Wrapper - Two Column Layout */
.checkout-wrapper {
  min-height: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.checkout-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Left Column */
.checkout-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.checkout-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.back-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--checkout-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--checkout-text-primary);
}

.back-button:hover {
  border-color: var(--checkout-text-primary);
  transform: translateX(-2px);
}

.checkout-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
}

.company-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
  letter-spacing: -0.02em;
}

.checkout-content {
  display: flex;
  flex-direction: column;
}

.checkout-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  color: var(--checkout-text-primary);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.checkout-subtitle {
  font-size: 0.875rem;
  color: var(--checkout-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.checkout-section {
  margin-bottom: 1.25rem;
}

.section-heading {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--checkout-text-primary);
}

/* Form Groups */
.form-group {
  margin-bottom: 0.875rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--checkout-text-primary);
}

.form-group input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--checkout-input-border);
  background: var(--checkout-input-bg);
  color: var(--checkout-text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--checkout-accent);
}

/* Payment Methods */
.payment-methods-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

.payment-method-btn {
  padding: 0.875rem;
  border-radius: 8px;
  border: 1.5px solid var(--checkout-border);
  background: var(--checkout-card);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.payment-method-btn:hover {
  border-color: var(--checkout-text-secondary);
}

.payment-method-btn.selected {
  border-color: var(--checkout-accent);
  background: var(--checkout-card);
}

.payment-method-btn.selected::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--checkout-accent);
  border: 2px solid var(--checkout-card);
  box-shadow: 0 0 0 1px var(--checkout-accent);
}

.payment-method-icon {
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--checkout-surface);
  border-radius: 6px;
}

.payment-method-info {
  flex: 1;
}

.payment-method-name {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--checkout-text-primary);
}

/* Payment Provider Icons */
.payment-provider-icons {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.provider-icon {
  height: 20px;
  min-width: 32px;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: var(--checkout-surface);
  border: 1px solid var(--checkout-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.provider-icon img {
  height: 14px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.payment-method-desc {
  color: var(--checkout-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.payment-price-info {
  margin-top: 0.25rem;
  padding: 0.375rem 0.5rem;
  background: var(--checkout-surface);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--checkout-text-primary);
  display: inline-block;
}

.price-difference-badge {
  margin-top: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  display: inline-block;
}

/* Automated Delivery Box */
.automated-delivery-box {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(20, 184, 166, 0.03));
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.875rem;
}

/* Terms */
.checkout-terms {
  font-size: 0.75rem;
  color: var(--checkout-text-secondary);
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Continue Button */
.continue-button {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  background: var(--checkout-accent);
  color: var(--checkout-button-text);
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 0.5rem;
}

.continue-button:hover:not(:disabled) {
  background: var(--checkout-accent-hover);
  transform: translateY(-1px);
}

.continue-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.hidden {
  display: none !important;
}

/* Right Column - Order Summary */
.checkout-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-summary {
  background: var(--checkout-card);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 4px 12px var(--checkout-shadow-lg);
}

.summary-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--checkout-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Plan Product Info */
.plan-product-info {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--checkout-border);
}

.plan-product-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
  margin-bottom: 0.625rem;
  line-height: 1.3;
}

.price-display {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
  line-height: 1;
}

.price-type {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--checkout-text-secondary);
  line-height: 1;
}

/* Product Description */
.product-description-box {
  margin-bottom: 0.375rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--checkout-border);
}

.product-description-text {
  color: var(--checkout-text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

/* Hide empty description box */
.product-description-box:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

/* Coupon Section */
.coupon-section-summary {
  margin-bottom: 0.375rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--checkout-border);
}

.summary-subtitle {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--checkout-text-primary);
  letter-spacing: -0.01em;
}

.coupon-input-wrapper {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.coupon-input-field {
  flex: 1;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--checkout-input-border);
  background: var(--checkout-input-bg);
  color: var(--checkout-text-primary);
  font-size: 0.6875rem;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.coupon-input-field::placeholder {
  color: var(--checkout-text-secondary);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.coupon-input-field:focus {
  outline: none;
  border-color: var(--checkout-accent);
  background: var(--checkout-card);
}

.coupon-apply-button {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  background: var(--checkout-accent);
  color: var(--checkout-button-text);
  border: none;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.coupon-apply-button:hover {
  background: var(--checkout-accent-hover);
  transform: translateY(-1px);
}

.coupon-apply-button:active {
  transform: translateY(0);
}

.coupon-message-display {
  font-size: 0.6875rem;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  margin-bottom: 0.375rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Price Breakdown */
.price-breakdown-summary {
  padding-top: 0.5rem;
  border-top: 1px solid var(--checkout-border);
  margin-bottom: 0.5rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  color: var(--checkout-text-primary);
}

.discount-row {
  color: #28a745;
  font-weight: 600;
}

/* Total */
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
  margin-bottom: 0.375rem;
  border-top: 1px solid var(--checkout-border);
  border-bottom: 1px solid var(--checkout-border);
}

.summary-total span:first-child {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--checkout-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
  letter-spacing: -0.02em;
}

/* Professional Seller Info - All in one card */
.seller-info-professional {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.seller-pro-card {
  padding: 0.625rem;
  background: var(--checkout-surface);
  border-radius: 6px;
  border: 1px solid var(--checkout-border);
}

.seller-pro-header {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--checkout-border);
}

.seller-pro-logo {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  background: var(--checkout-card);
  border: 1px solid var(--checkout-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.125rem;
}

.seller-pro-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seller-pro-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.seller-pro-name-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.seller-pro-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--checkout-text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.verified-badge-pro {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  padding: 0.1875rem 0.5rem;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 10px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--checkout-accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.verified-badge-pro svg {
  fill: none;
  stroke: var(--checkout-accent);
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.seller-pro-description {
  font-size: 0.6875rem;
  color: var(--checkout-text-secondary);
  line-height: 1.5;
  margin-bottom: 0.625rem;
}

.seller-pro-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seller-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
}

.seller-detail-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  color: var(--checkout-text-secondary);
  stroke: currentColor;
}

.seller-detail-value {
  color: var(--checkout-text-primary);
  font-weight: 500;
  word-break: break-word;
}

.seller-detail-value a {
  color: var(--checkout-accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.seller-detail-value a:hover {
  opacity: 0.8;
}

/* Error States */
.error-state-screen {
  text-align: center;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-state-screen h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--checkout-text-primary);
}

.error-state-screen p {
  font-size: 1rem;
  color: var(--checkout-text-secondary);
  line-height: 1.6;
}

/* Success State - Professional Design */
.success-state-screen {
  text-align: center;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--checkout-bg);
}

.success-container {
  max-width: 560px;
  width: 100%;
  background: var(--checkout-card);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 16px var(--checkout-shadow-lg);
}

.success-icon {
  margin: 0 auto 1rem;
  width: 56px;
  height: 56px;
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.success-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--checkout-text-primary);
  letter-spacing: -0.02em;
}

.success-message {
  font-size: 0.875rem;
  color: var(--checkout-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.success-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.success-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem;
  background: var(--checkout-surface);
  border-radius: 6px;
  border: 1px solid var(--checkout-border);
}

.success-detail-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--checkout-accent);
  stroke: currentColor;
}

.success-detail-item span {
  font-size: 0.875rem;
  color: var(--checkout-text-primary);
  line-height: 1.6;
}

.success-note {
  padding: 0.75rem;
  background: rgba(20, 184, 166, 0.05);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 6px;
  text-align: left;
}

.success-note p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--checkout-text-secondary);
  line-height: 1.5;
}

.success-note strong {
  color: var(--checkout-text-primary);
  font-weight: 600;
}

.success-note a {
  color: var(--checkout-accent);
  text-decoration: none;
  font-weight: 500;
}

.success-note a:hover {
  text-decoration: underline;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.625rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  display: none;
}

.error-message:not(:empty) {
  display: block;
}

/* Responsive Design */
@media (max-width: 1400px) {
  .checkout-container {
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .checkout-wrapper {
    min-height: auto;
    padding: 1.5rem 1rem;
  }

  .checkout-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 600px;
  }

  .checkout-left {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .checkout-wrapper {
    padding: 1rem 0.75rem;
  }

  .checkout-header {
    margin-bottom: 0.5rem;
  }

  .checkout-title {
    font-size: 1rem;
  }

  .price-amount,
  .price-type {
    font-size: 1.125rem;
  }

  .theme-toggle {
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
  }

  .checkout-container {
    gap: 1rem;
  }

  .order-summary {
    padding: 0.625rem;
  }
}

@media (max-width: 480px) {
  .checkout-wrapper {
    padding: 0.75rem 0.5rem;
  }

  .checkout-header {
    margin-bottom: 0.375rem;
  }

  .checkout-logo {
    font-size: 0.875rem;
  }

  .checkout-title {
    font-size: 0.875rem;
  }

  .price-amount,
  .price-type {
    font-size: 1rem;
  }

  .order-summary {
    padding: 0.5rem;
  }

  .coupon-input-wrapper {
    flex-direction: column;
  }

  .coupon-apply-button {
    width: 100%;
  }
}