/**
 * ==============================================================================
 * SAKKAR OĞLU - GUEST CHECKOUT STYLESHEET
 * Compliant with @ui-ux-pro-max, @design-system, and @clean-secure-pro-max
 * Strict E-Commerce & Legal Compliance (Shopier / 3D Secure / Turkish E-Commerce)
 * ==============================================================================
 */

body.checkout-page {
  background-color: #fbfbfb;
  color: #111111;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 1. MINIMALIST CHECKOUT HEADER */
.checkout-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding-block: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.checkout-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #555555;
  text-decoration: none;
  transition: color var(--primitive-transition-fast);
}

.checkout-back-link:hover {
  color: #111111;
}

.checkout-brand {
  text-align: center;
}

.checkout-logo-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.checkout-logo {
  font-family: var(--font-family-serif, "Cinzel", Georgia, serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #111111;
}

.checkout-logo-sub {
  font-size: 0.5625rem;
  letter-spacing: 0.3em;
  color: #888888;
  margin-top: 1px;
}

.checkout-header-right {
  display: flex;
  align-items: center;
}

.checkout-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #166534;
}

/* 2. MAIN CHECKOUT LAYOUT */
.checkout-main {
  flex: 1;
  padding-block-start: clamp(24px, 3vw, 40px);
  padding-block-end: clamp(48px, 6vw, 80px);
}

.checkout-page-title {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111111;
  margin: 0 0 clamp(20px, 3vw, 32px) 0;
  text-align: start;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 48px);
}

@media (min-width: 1024px) {
  .checkout-grid {
    grid-template-columns: 1.55fr 1fr;
    align-items: start;
  }
}

/* 3. CHECKOUT CARDS */
.checkout-card {
  background-color: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  padding: clamp(20px, 2.5vw, 28px);
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.checkout-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 20px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #111111;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #111111;
  margin: 0;
}

/* 4. FORM ELEMENTS & VALIDATION */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #333333;
}

.checkout-input,
.checkout-select,
.checkout-textarea {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  color: #111111;
  outline: none;
  transition: border-color var(--primitive-transition-fast), box-shadow var(--primitive-transition-fast);
}

.checkout-input {
  height: 44px;
}

.checkout-select {
  height: 44px;
  cursor: pointer;
}

.checkout-textarea {
  resize: vertical;
  min-height: 80px;
}

.checkout-input:focus,
.checkout-select:focus,
.checkout-textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 1px #111111;
}

.checkout-input.invalid,
.checkout-select.invalid,
.checkout-textarea.invalid {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

.field-hint {
  font-size: 0.6875rem;
  color: #777777;
  line-height: 1.35;
}

.field-error {
  font-size: 0.6875rem;
  color: #dc2626;
  font-weight: 600;
  min-height: 16px;
  display: block;
}

/* 5. PAYMENT METHOD SECTION */
.payment-selection-box {
  border: 1.5px solid #111111;
  border-radius: 6px;
  padding: 18px;
  background-color: #fdfdfd;
}

.payment-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.payment-selection-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 4px solid #111111;
  background-color: #ffffff;
  display: inline-block;
  flex-shrink: 0;
}

.payment-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-selection-desc {
  font-size: 0.75rem;
  color: #666666;
  margin: 0;
  line-height: 1.45;
  padding-inline-start: 26px;
}

/* 6. MANDATORY LEGAL CHECKBOXES */
.legal-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legal-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: #333333;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.legal-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #111111;
  flex-shrink: 0;
}

.legal-preview-trigger {
  background: none;
  border: none;
  color: #111111;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

.legal-preview-trigger:hover {
  color: #555555;
}

/* 7. SUBMIT BUTTON */
.checkout-submit-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.checkout-place-order-btn {
  width: 100%;
  height: 54px;
  background-color: #111111;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all var(--primitive-transition-fast);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.checkout-place-order-btn:hover {
  background-color: #2b2b2b;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.checkout-place-order-btn:active {
  transform: translateY(0);
}

.btn-price-preview {
  padding-inline-start: 12px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.9375rem;
}

.checkout-security-notice {
  font-size: 0.6875rem;
  color: #666666;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

/* 8. STICKY SUMMARY CARD (RIGHT COLUMN) */
.summary-sticky-card {
  background-color: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  padding: clamp(20px, 2.5vw, 28px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  position: sticky;
  top: 90px;
}

.summary-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111111;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
  margin: 0 0 16px 0;
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding-inline-end: 4px;
  margin-bottom: 20px;
}

.summary-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f5f5f5;
}

.summary-item-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-item-thumb {
  width: 54px;
  height: 68px;
  object-fit: cover;
  border-radius: 2px;
  background-color: #f3f3f3;
  flex-shrink: 0;
}

.summary-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-item-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111111;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-item-meta {
  font-size: 0.6875rem;
  color: #777777;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-size-pill {
  padding: 1px 6px;
  background-color: #f0f0f0;
  border-radius: 2px;
  font-weight: 700;
  color: #333333;
}

.summary-item-price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111111;
  white-space: nowrap;
}

/* Coupon Wrap */
.summary-coupon-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.coupon-input {
  flex: 1;
  height: 38px;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  padding-inline: 12px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
}

.coupon-btn {
  height: 38px;
  padding-inline: 16px;
  background-color: #f3f3f3;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #111111;
  cursor: pointer;
  transition: all var(--primitive-transition-fast);
}

.coupon-btn:hover {
  background-color: #111111;
  color: #ffffff;
  border-color: #111111;
}

.coupon-feedback {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: -12px;
  margin-bottom: 16px;
}

/* Summary Totals */
.summary-totals-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #555555;
}

.shipping-free-badge {
  font-weight: 700;
  color: #0F9D58;
}

.summary-grand-total {
  font-size: 1rem;
  font-weight: 700;
  color: #111111;
  padding-top: 12px;
  border-top: 1px dashed #e0e0e0;
  margin-top: 4px;
}

.grand-total-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111111;
}

/* Summary Trust Perks */
.summary-trust-perks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.trust-perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6875rem;
  color: #666666;
}

.trust-perk-item svg {
  flex-shrink: 0;
  stroke: #444444;
}

/* 9. LEGAL MODALS */
.legal-modal-dialog {
  background-color: #ffffff;
  border-radius: 8px;
  max-width: 650px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #eeeeee;
}

.legal-modal-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: #111111;
}

.legal-modal-close {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: #777777;
  padding: 4px;
}

.legal-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #444444;
}

.legal-modal-body h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111111;
  margin: 16px 0 6px 0;
}

.legal-modal-body h4:first-child {
  margin-top: 0;
}

.legal-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #eeeeee;
  display: flex;
  justify-content: flex-end;
}

.legal-modal-btn {
  padding: 8px 20px;
  background-color: #111111;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

/* 10. ORDER CONFIRMATION SCREEN */
.order-success-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.order-success-dialog {
  background-color: #ffffff;
  border-radius: 8px;
  max-width: 540px;
  width: 100%;
  padding: clamp(24px, 4vw, 36px);
  text-align: center;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #f0fdf4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.success-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111111;
  margin: 0 0 8px 0;
}

.success-subtitle {
  font-size: 0.8125rem;
  color: #666666;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.success-receipt-card {
  background-color: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 6px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  text-align: start;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #444444;
}

.receipt-total-row {
  border-top: 1px dashed #dddddd;
  padding-top: 10px;
  margin-top: 4px;
  font-weight: 700;
  align-items: center;
}

.badge-success-paid {
  font-weight: 700;
  color: #0F9D58;
}

.success-actions {
  display: flex;
  gap: 12px;
}

.receipt-print-btn,
.receipt-home-btn {
  flex: 1;
  height: 44px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--primitive-transition-fast);
}

.receipt-print-btn {
  background-color: #f3f3f3;
  color: #111111;
  border: 1px solid #dddddd;
}

.receipt-home-btn {
  background-color: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}

.receipt-home-btn:hover {
  background-color: #2b2b2b;
}

.checkout-empty-cart {
  text-align: center;
  padding: 60px 20px;
  background-color: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  max-width: 500px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.checkout-empty-cart svg {
  stroke: #999999;
  margin-bottom: 16px;
}

.checkout-empty-cart h3 {
  font-size: 1.125rem;
  margin: 0 0 8px 0;
}

.checkout-empty-cart p {
  font-size: 0.8125rem;
  color: #777777;
  margin: 0 0 24px 0;
}

.checkout-return-btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding-inline: 24px;
  background-color: #111111;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* RTL Support */
[dir="rtl"] .checkout-page-title,
[dir="rtl"] .success-receipt-card {
  text-align: right;
}

[dir="rtl"] .checkout-back-link svg {
  transform: rotate(180deg);
}
