/* ==========================================================================
   MAKE ANEW ELECTRONICS - SERVICE BOOKING & CHECKOUT FLOW
   Split checkout: Service Details -> Review -> Payment -> Confirmation
   ========================================================================== */

.booking-flow-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted-foreground);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.booking-flow-note svg {
  flex: 0 0 auto;
  margin-top: 0.1rem;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   FORM SECTIONS (Service Details page)
   -------------------------------------------------------------------------- */
.booking-section-block {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--hairline);
}

.booking-section-block:first-child {
  padding-top: 0.5rem;
}

.booking-section-block:last-of-type {
  border-bottom: none;
}

.booking-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.booking-section-title .booking-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Product image uploads */
.image-upload-zone {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}

.image-upload-zone.has-drag {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
}

.image-upload-zone-icon {
  color: var(--primary);
  margin: 0 auto 0.35rem;
}

.image-upload-hint {
  font-size: 0.82rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.product-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.product-image-thumb {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  aspect-ratio: 1 / 1;
}

.product-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-image-thumb figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.68rem;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-image-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.product-image-remove:hover {
  background: var(--destructive);
}

.image-upload-progress {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   REVIEW SERVICE REQUEST PAGE
   -------------------------------------------------------------------------- */
.review-stack {
  display: grid;
  gap: 1.1rem;
}

.review-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.5rem;
}

.review-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.review-section-head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
}

.review-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.review-edit-link:hover {
  text-decoration: underline;
}

.review-rows {
  display: grid;
  gap: 0.7rem;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(8rem, 0.32fr) 1fr;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--hairline);
}

.review-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-row dt {
  color: var(--muted-foreground);
  font-size: 0.86rem;
}

.review-row dd {
  margin: 0;
  color: var(--foreground);
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.review-row dd.muted {
  color: var(--muted-foreground);
  font-weight: 500;
}

.review-no-images {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: 0.88rem;
  text-align: center;
  background: var(--surface);
}

.review-service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 700;
}

.review-charge-card {
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.5rem;
}

.review-charge-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.review-charge-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
}

.review-charge-total .charge-label {
  font-weight: 700;
  color: var(--primary-deep);
  font-size: 0.95rem;
}

.review-charge-total .charge-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-deep);
}

.review-charge-note {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.9rem;
  font-size: 0.83rem;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.review-charge-note svg {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  color: var(--primary);
}

.flow-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.flow-actions .btn {
  flex: 1 1 14rem;
}

/* --------------------------------------------------------------------------
   CHECKOUT / PAYMENT PAGE
   -------------------------------------------------------------------------- */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.checkout-grid > *,
.checkout-panel,
.payment-option-body,
.payment-policy-warning {
  min-width: 0;
}

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

.checkout-panel {
  box-sizing: border-box;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.checkout-panel h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.summary-table th,
.summary-table td {
  padding: 0.65rem 0.25rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

.summary-table th {
  color: var(--muted-foreground);
  font-weight: 600;
  width: 58%;
}

.summary-table td {
  color: var(--foreground);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.summary-table .summary-total th,
.summary-table .summary-total td {
  border-bottom: none;
  border-top: 1.5px solid var(--border);
  font-size: 1rem;
}

.summary-table .summary-total td {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-deep);
}

.summary-address-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.summary-address-full {
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--foreground);
  line-height: 1.6;
}

.summary-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.summary-images img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
}

/* Payment option radio cards */
.payment-options {
  display: grid;
  gap: 0.9rem;
}

.payment-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.payment-option:hover {
  border-color: var(--primary);
}

.payment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-option .payment-option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: border-color 0.15s ease;
}

.payment-option .payment-option-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transform: scale(0);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.payment-option.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.payment-option.selected .payment-option-radio {
  border-color: var(--primary);
}

.payment-option.selected .payment-option-radio::after {
  background: var(--primary);
  transform: scale(1);
}

.payment-option-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.payment-option-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--foreground);
  font-size: 0.95rem;
}

.payment-option-desc {
  font-size: 0.82rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.payment-option-amount {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--primary-deep);
  font-size: 1.05rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.payment-policy-warning {
  margin: 0 0 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid #e5a2a2;
  border-left-width: 3px;
  border-radius: var(--radius-md);
  color: #7f1d1d;
  background: #fef2f2;
}

.payment-policy-warning h2,
.payment-policy-warning h3 {
  margin: 0 0 0.4rem;
  padding: 0;
  border: 0;
  color: #991b1b;
  font-size: 0.975rem;
  font-weight: 700;
  line-height: 1.4;
}

.payment-policy-warning p {
  margin: 0;
  color: #7f1d1d;
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.payment-option:focus-within {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.checkout-secure-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.1rem;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.checkout-secure-note svg {
  color: #047857;
}

/* Processing overlay state */
.btn-processing {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spinner-rotate 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 0.5rem;
}

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

/* --------------------------------------------------------------------------
   SIMULATED PAYMENT GATEWAY PAGE
   -------------------------------------------------------------------------- */
.gateway-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
    var(--page-tint, #f1f5f9);
}

.gateway-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.28);
  padding: 2rem 1.75rem;
}

.gateway-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.gateway-brand img {
  height: 34px;
  border-radius: 6px;
}

.gateway-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--foreground);
}

.gateway-secure-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  margin-bottom: 1.4rem;
}

.gateway-secure-line svg {
  color: #047857;
}

.gateway-amount-card {
  text-align: center;
  padding: 1.4rem 1rem;
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  background: var(--primary-light);
  margin-bottom: 1.4rem;
}

.gateway-amount-card .gateway-amount-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-deep);
}

.gateway-amount-card .gateway-amount-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin-top: 0.25rem;
}

.gateway-meta {
  display: grid;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--muted-foreground);
  margin-bottom: 1.4rem;
  overflow-wrap: anywhere;
}

.gateway-meta strong {
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.gateway-actions {
  display: grid;
  gap: 0.7rem;
}

.gateway-actions .btn {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.gateway-policy-warning {
  margin-bottom: 1.1rem;
}

.gateway-test-note {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.76rem;
  color: var(--muted-foreground);
  text-align: center;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.gateway-test-note button {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 540px) {
  .checkout-panel {
    padding: 1.1rem;
  }

  .summary-table th {
    width: 42%;
  }

  .payment-option {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
  }

  .payment-option-amount {
    grid-column: 2;
    justify-self: start;
  }

  .gateway-shell {
    padding: 1rem 0.7rem;
  }

  .gateway-card {
    padding: 1.25rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   PAYMENT RESULT PAGE
   -------------------------------------------------------------------------- */
.result-panel {
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 1.75rem;
}

.result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.result-icon.success {
  background: #ecfdf5;
  color: #059669;
}

.result-icon.failure {
  background: #fef2f2;
  color: #dc2626;
}

.result-icon.pending {
  background: #eff6ff;
  color: var(--primary);
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 0.6rem;
}

.result-message {
  max-width: 46ch;
  margin: 0 auto 1.4rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  line-height: 1.6;
}

.result-reference {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: monospace;
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: 1.5rem;
}

.result-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   BOOKING SUCCESS PAGE
   -------------------------------------------------------------------------- */
.success-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1rem 4.5rem;
  display: grid;
  gap: 1.1rem;
}

.success-hero {
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 1.5rem 2rem;
}

.success-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.success-hero h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 0.6rem;
}

.success-hero p {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--muted-foreground);
  line-height: 1.65;
  font-size: 0.95rem;
}

.success-ticket-card {
  display: grid;
  gap: 0.35rem;
  text-align: center;
  padding: 1.35rem 1.25rem;
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-lg);
  background: var(--primary-light);
}

.success-ticket-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-deep);
}

.success-ticket-number {
  font-family: monospace;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--primary-deep);
  overflow-wrap: anywhere;
}

.success-details {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.success-details h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.success-payment-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.success-payment-pill.paid {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.success-payment-pill.pending {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.success-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.success-actions .btn {
  width: 100%;
}

.success-actions .btn-primary-wide {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .success-actions {
    grid-template-columns: 1fr;
  }

  .review-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .payment-option {
    grid-template-columns: auto 1fr;
  }

  .payment-option-amount {
    grid-column: 2;
  }
}
