/* css/checkout.css */

.checkout-page {
  padding-top: calc(var(--navbar-height) + var(--space-3xl));
  padding-bottom: var(--space-5xl);
  min-height: 80vh;
}

.checkout-page__title {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.checkout__layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: var(--space-4xl);
  align-items: start;
}

/* Form Sections */
.checkout-section {
  margin-bottom: var(--space-2xl);
}

.checkout-section__title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.checkout-section__number {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.form-row--single {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-input {
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color var(--transition-base);
}

.form-select:focus {
  border-color: var(--accent);
}

/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.payment-method {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.payment-method:hover {
  border-color: var(--border-accent);
}

.payment-method.active {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.payment-method__radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: border-color var(--transition-base);
  flex-shrink: 0;
}

.payment-method.active .payment-method__radio {
  border-color: var(--accent);
}

.payment-method.active .payment-method__radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.payment-method__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.payment-method__icons {
  margin-left: auto;
  display: flex;
  gap: var(--space-sm);
  font-size: 1.5rem;
  color: var(--text-tertiary);
}

/* Card Details */
.card-details {
  margin-top: var(--space-lg);
  padding: var(--space-xl);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* Order Summary (Checkout) */
.order-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-xl));
}

.order-summary__title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.order-summary__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.order-item {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.order-item__image {
  width: 60px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  position: relative;
  flex-shrink: 0;
}

.order-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item__qty {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-item__info {
  flex: 1;
}

.order-item__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.order-item__variant {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.order-item__price {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Checkout Success Modal */
.checkout-success {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.checkout-success.show {
  display: flex;
}

.checkout-success__content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4xl);
  text-align: center;
  max-width: 480px;
  width: 90%;
  animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.checkout-success__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-xl);
  background: var(--accent-muted);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent);
}

.checkout-success__title {
  font-size: 1.8rem;
  margin-bottom: var(--space-md);
}

.checkout-success__text {
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

.checkout-success__order-id {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 1024px) {
  .checkout__layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: relative;
    top: 0;
  }
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}