/* ============================================
   CHECKOUT CSS — ROST by PLATKI
   ============================================ */

:root {
  --co-dark: #1A1A1A;
  --co-light: #F5F0EB;
  --co-accent: #C8A96E;
  --co-accent-hover: #D4B87A;
  --co-text: #1A1A1A;
  --co-muted: #737373;
  --co-error: #D9534F;
  --co-success: #4CAF50;
  --co-border: rgba(0, 0, 0, 0.1);
  --co-card: #fff;
  --co-card-alt: #FAFAF7;
  --co-radius: 12px;
  --co-transition: 250ms ease;
}

/* ========== PROGRESS ========== */
.co-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 560px;
  margin: 28px auto 0;
  padding: 0 20px;
  gap: 0;
}

.co-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.co-progress__num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--co-card);
  border: 2px solid var(--co-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--co-muted);
  transition: all var(--co-transition);
}

.co-progress__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--co-muted);
  white-space: nowrap;
  transition: color var(--co-transition);
}

.co-progress__line {
  flex: 1;
  height: 2px;
  background: var(--co-border);
  margin: 0 8px;
  margin-bottom: 22px;
  transition: background var(--co-transition);
}

/* Active step */
.co-progress__step--active .co-progress__num {
  background: var(--co-accent);
  border-color: var(--co-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(200, 169, 110, 0.35);
}
.co-progress__step--active .co-progress__label {
  color: var(--co-text);
  font-weight: 600;
}

/* Completed step */
.co-progress__step--done .co-progress__num {
  background: var(--co-accent);
  border-color: var(--co-accent);
  color: #fff;
}
.co-progress__step--done .co-progress__label {
  color: var(--co-accent);
}

/* Completed line */
.co-progress__line--done {
  background: var(--co-accent);
}

@media (max-width: 480px) {
  .co-progress__label { display: none; }
  .co-progress__num { width: 32px; height: 32px; font-size: 13px; }
  .co-progress__line { margin-bottom: 0; }
  .co-progress { margin-top: 20px; }
}

/* ========== LAYOUT ========== */
.co-main {
  min-height: calc(100vh - 60px - 56px);
  padding: 28px 0 64px;
  background:
    radial-gradient(ellipse at 15% 80%, rgba(200, 169, 110, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(200, 169, 110, 0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(200, 169, 110, 0.03) 0%, transparent 70%);
}

.co-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ========== STEPS ========== */
.co-step {
  background: var(--co-card);
  border-radius: var(--co-radius);
  padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(80, 56, 20, 0.08), 0 1px 4px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(200, 169, 110, 0.08);
  animation: co-fadeIn 0.3s ease;
}

.co-step--hidden {
  display: none;
}

.co-step__title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(22px, 4vw, 28px);
  color: var(--co-text);
  margin-bottom: 20px;
}

.co-step__subtitle {
  font-size: 14px;
  color: var(--co-muted);
  margin-top: -12px;
  margin-bottom: 24px;
}

@keyframes co-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== CART ITEMS ========== */
.co-cart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.co-cart-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--co-card-alt);
  border-radius: 10px;
  align-items: center;
}

.co-cart-item__img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.co-cart-item__body {
  flex: 1;
  min-width: 0;
}

.co-cart-item__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--co-text);
}

.co-cart-item__meta {
  font-size: 13px;
  color: var(--co-muted);
  margin-top: 2px;
}

.co-cart-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.co-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-qty__btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--co-border);
  border-radius: 6px;
  background: var(--co-card);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--co-text);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.co-qty__btn:hover {
  border-color: var(--co-accent);
  color: var(--co-accent);
}

.co-qty__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.co-qty__val {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}

.co-cart-item__remove {
  background: none;
  border: none;
  color: var(--co-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.co-cart-item__remove:hover { opacity: 1; color: var(--co-error); }

.co-cart-item__price {
  font-weight: 700;
  font-size: 16px;
  color: var(--co-accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========== CART SUMMARY ========== */
.co-summary {
  background: var(--co-card-alt);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}

.co-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--co-muted);
  margin-bottom: 10px;
}

.co-summary__row--free-note {
  font-size: 12px;
  color: var(--co-accent);
  margin-top: -6px;
}

.co-summary__row--total {
  font-size: 17px;
  font-weight: 700;
  color: var(--co-text);
  border-top: 1px solid var(--co-border);
  padding-top: 12px;
  margin-top: 4px;
  margin-bottom: 0;
}

.co-summary__row--total span:last-child {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--co-accent);
}

/* ========== BUTTONS ========== */
.co-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.co-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-height: 48px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.co-btn--primary {
  background: var(--co-accent);
  color: var(--co-dark);
  flex: 1;
}

.co-btn--primary:hover {
  background: var(--co-accent-hover);
  box-shadow: 0 4px 16px rgba(200, 169, 110, 0.3);
}

.co-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.co-btn--secondary {
  background: transparent;
  color: var(--co-text);
  border: 1px solid var(--co-border);
}

.co-btn--secondary:hover {
  border-color: var(--co-accent);
  color: var(--co-accent);
}

/* Submit button loading state */
.co-btn--submit .co-btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--co-dark);
  border-top-color: transparent;
  border-radius: 50%;
  animation: co-spin 0.6s linear infinite;
  margin-left: 8px;
}

.co-btn--submit.is-loading .co-btn__text { opacity: 0.5; }
.co-btn--submit.is-loading .co-btn__spinner { display: block; }
.co-btn--submit.is-loading { pointer-events: none; }

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

@media (max-width: 480px) {
  .co-actions {
    flex-direction: column-reverse;
  }
  .co-btn { width: 100%; }
}

/* ========== FORM ========== */
.co-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.co-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 560px) {
  .co-field-row { grid-template-columns: 1fr; }
}

.co-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.co-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--co-text);
}

.co-req { color: var(--co-error); }

.co-field__input,
.co-field__select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--co-border);
  border-radius: 10px;
  background: var(--co-card);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--co-text);
  transition: border-color var(--co-transition), box-shadow var(--co-transition);
  -webkit-appearance: none;
}

.co-field__input:focus,
.co-field__select:focus {
  outline: none;
  border-color: var(--co-accent);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15);
}

.co-field__input--textarea {
  resize: vertical;
  min-height: 76px;
}

.co-field__select:disabled {
  background: #f0ede8;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Phone input wrapper + check indicator */
.co-field__wrap {
  position: relative;
}
.co-field__wrap .co-field__input {
  padding-right: 42px;
}
.co-field__check {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  pointer-events: none;
  line-height: 1;
}
.co-field__check--valid {
  opacity: 1;
  color: var(--co-success);
}
.co-field__check--invalid {
  opacity: 1;
  color: var(--co-error);
}

.co-field__error {
  font-size: 12px;
  color: var(--co-error);
  display: none;
  min-height: 0;
}

.co-field--error .co-field__error { display: block; }
.co-field--error .co-field__input,
.co-field--error .co-field__select {
  border-color: var(--co-error);
}

/* ========== PAYMENT ========== */
.co-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.co-pay-option {
  cursor: pointer;
  display: block;
}

.co-pay-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.co-pay-option__box {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--co-border);
  border-radius: var(--co-radius);
  background: var(--co-card);
  transition: all var(--co-transition);
  align-items: center;
}

.co-pay-option input:checked + .co-pay-option__box {
  border-color: var(--co-accent);
  background: rgba(200, 169, 110, 0.04);
}

.co-pay-option:hover .co-pay-option__box {
  border-color: rgba(200, 169, 110, 0.4);
}

.co-pay-option__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--co-light);
  border-radius: 8px;
  flex-shrink: 0;
}

.co-pay-option__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--co-text);
  margin-bottom: 2px;
}

.co-pay-option__desc {
  font-size: 13px;
  color: var(--co-muted);
}

/* QR section */
.co-qr {
  background: var(--co-card-alt);
  border-radius: var(--co-radius);
  padding: 24px;
  margin-top: 20px;
  text-align: center;
}

.co-qr__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--co-text);
  margin-bottom: 18px;
}

.co-qr__code {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.co-qr__code img {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.co-qr__info {
  text-align: left;
  background: var(--co-card);
  border-radius: 8px;
  padding: 14px;
}

.co-qr__info p {
  font-size: 13px;
  color: var(--co-muted);
  margin-bottom: 6px;
}
.co-qr__info p:last-child { margin-bottom: 0; }
.co-qr__info strong { color: var(--co-text); }

.co-qr__hint {
  font-size: 13px;
  color: var(--co-accent);
  margin-top: 14px;
  font-weight: 500;
}
.co-qr__amount-line {
  font-size: 15px !important;
  padding-top: 6px;
  border-top: 1px solid rgba(200, 169, 110, 0.15);
  margin-top: 8px !important;
}
.co-qr__amount-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--co-accent);
}

/* QR hint on step 3 (actual QR on success) */
.co-qr-hint {
  background: var(--co-card-alt);
  border-radius: var(--co-radius);
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--co-muted);
  text-align: center;
  border-left: 3px solid var(--co-accent);
}

/* QR block inside success screen */
.co-success__qr {
  background: var(--co-card-alt);
  border-radius: var(--co-radius);
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}
.co-success__qr-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--co-text);
  margin-bottom: 18px;
}

/* ========== REVIEW ========== */
.co-review {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.co-review__section {
  background: var(--co-card-alt);
  border-radius: var(--co-radius);
  padding: 18px;
}

.co-review__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.co-review__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--co-text);
  margin-bottom: 10px;
}

.co-review__header .co-review__label { margin-bottom: 0; }

.co-review__edit {
  background: none;
  border: none;
  color: var(--co-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.co-review__edit:hover { color: var(--co-accent-hover); }

.co-review__section p {
  font-size: 14px;
  color: var(--co-muted);
  margin-bottom: 6px;
}
.co-review__section p:last-child { margin-bottom: 0; }
.co-review__section strong { color: var(--co-text); font-weight: 600; }

.co-review__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--co-border);
  font-weight: 600;
  color: var(--co-text);
}

.co-review__total-amount {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--co-accent);
}

/* Review items */
.co-review__item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.co-review__item-name { color: var(--co-text); font-weight: 500; }
.co-review__item-price { color: var(--co-accent); font-weight: 600; }

/* ========== SUCCESS ========== */
.co-success {
  text-align: center;
  padding: 48px 24px;
  animation: co-fadeIn 0.4s ease;
}

.co-success__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.25);
}

.co-success__title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--co-text);
  margin-bottom: 10px;
}

.co-success__text {
  font-size: 15px;
  color: var(--co-muted);
  margin-bottom: 28px;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

.co-success__details {
  background: var(--co-card-alt);
  border-radius: var(--co-radius);
  padding: 18px;
  margin-bottom: 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.co-success__details p {
  font-size: 14px;
  color: var(--co-muted);
  margin-bottom: 6px;
}
.co-success__details p:last-child { margin-bottom: 0; }
.co-success__details strong { color: var(--co-text); }

.co-success__support {
  font-size: 13px;
  color: var(--co-muted);
  margin-bottom: 20px;
}
.co-success__support a {
  color: var(--co-accent);
  text-decoration: underline;
}

/* ========== EMPTY CART ========== */
.co-empty {
  text-align: center;
  padding: 64px 24px;
}

.co-empty__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(200, 169, 110, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-empty__title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--co-text);
  margin-bottom: 10px;
}

.co-empty__text {
  color: var(--co-muted);
  margin-bottom: 28px;
}

/* ========== FOOTER ========== */
.co-footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--co-muted);
  background: var(--co-dark);
  color: rgba(245, 240, 235, 0.4);
}

/* ========== TOAST NOTIFICATION ========== */
.co-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--co-dark);
  color: var(--co-light);
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.co-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.co-toast--error {
  background: var(--co-error);
}
