/* ============================================================
   CHECKOUT / DELIVERY — checkout.css (shared)
   ============================================================ */

.co-page { background: #f7f8fc; min-height: 100vh; padding: 1.75rem 0 4rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.co-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
}

/* ============================================================
   STEPS
   ============================================================ */
.co-steps {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 14px;
  padding: 1rem 1.5rem;
  gap: 0;
  margin-bottom: .25rem;
}
.co-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.co-step__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e4e5ee;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .2s;
}
.co-step__dot svg { width: 14px; height: 14px; stroke: currentColor; }
.co-step.active .co-step__dot { background: #4169e1; color: #fff; }
.co-step.active { color: #4169e1; }
.co-step.done .co-step__dot { background: #2ecc71; color: #fff; }
.co-step.done { color: #27ae60; }
.co-step__line {
  flex: 1;
  height: 2px;
  background: #e4e5ee;
  min-width: 24px;
  margin: 0 .4rem;
}
.co-step__line--done { background: #2ecc71; }

/* ============================================================
   CARDS
   ============================================================ */
.co-main { display: flex; flex-direction: column; gap: 1rem; }

.co-card {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 14px;
  overflow: hidden;
}
.co-card--readonly { background: #f7f8fc; }

.co-card__header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid #f0f1f7;
}
.co-card__header h2 { font-size: .97rem; font-weight: 700; margin: 0; flex: 1; }
.co-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eef0fa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.co-card__icon svg { width: 16px; height: 16px; stroke: #4169e1; }
.co-card__edit {
  font-size: .78rem;
  color: #4169e1;
  font-weight: 600;
  text-decoration: none;
  padding: .2rem .5rem;
  border-radius: 6px;
  transition: background var(--transition);
}
.co-card__edit:hover { background: #eef0fa; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.co-form-grid { display: grid; gap: .85rem; padding: 1.1rem 1.25rem; }
.co-form-grid--2 { grid-template-columns: 1fr 1fr; }
.co-form-grid--1 { grid-template-columns: 1fr; }

.co-field { display: flex; flex-direction: column; gap: .3rem; }
.co-field--full { grid-column: 1 / -1; }

.co-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.co-req { color: #e63946; }

.co-input {
  padding: .65rem .9rem;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  font-size: .88rem;
  font-family: var(--font);
  color: var(--text);
  background: #f7f8fc;
  transition: border-color .2s, background .2s, box-shadow .2s;
  width: 100%;
  box-sizing: border-box;
}
.co-input:focus {
  outline: none;
  border-color: #4169e1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(65,105,225,.1);
}
.co-input.error { border-color: #e63946; background: #fff8f8; }

.co-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; cursor: pointer; }

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

.co-input-prefix { display: flex; align-items: center; border: 1.5px solid #e4e5ee; border-radius: 8px; background: #f7f8fc; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.co-input-prefix:focus-within { border-color: #4169e1; box-shadow: 0 0 0 3px rgba(65,105,225,.1); background: #fff; }
.co-prefix { padding: 0 .75rem; font-size: .82rem; font-weight: 700; color: var(--text-muted); background: #f0f1f7; border-right: 1px solid #e4e5ee; white-space: nowrap; line-height: 42px; }
.co-input--prefixed { border: none !important; background: transparent !important; box-shadow: none !important; flex: 1; }
.co-input--prefixed:focus { box-shadow: none !important; }

.co-input-icon-right { position: relative; }
.co-input-icon-right .co-input { padding-right: 2.5rem; }
.co-card-type-icon { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }

.co-input--card { letter-spacing: .1em; font-size: .95rem; }

.co-checkbox {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .82rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 .25rem;
}
.co-checkbox input { width: 16px; height: 16px; accent-color: #4169e1; flex-shrink: 0; margin-top: .1rem; cursor: pointer; }
.co-checkbox--terms { padding: .25rem 0; }
.co-link { color: #4169e1; text-decoration: none; font-weight: 600; }
.co-link:hover { text-decoration: underline; }

/* ============================================================
   DELIVERY OPTIONS
   ============================================================ */
.co-delivery-options { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.25rem; }

.co-delivery-opt {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 2px solid #e4e5ee;
  border-radius: 10px;
  padding: .85rem 1rem;
  cursor: pointer;
  transition: all .2s;
}
.co-delivery-opt input[type="radio"] { display: none; }
.co-delivery-opt:has(input:checked) { border-color: #4169e1; background: #eef0fa; }
.co-delivery-opt__body { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: .5rem; }
.co-delivery-opt__left { display: flex; align-items: center; gap: .65rem; }
.co-delivery-opt__left svg { width: 22px; height: 22px; stroke: #4169e1; flex-shrink: 0; }
.co-delivery-opt__left strong { display: block; font-size: .88rem; font-weight: 700; color: var(--text); }
.co-delivery-opt__left span { font-size: .75rem; color: var(--text-muted); }
.co-delivery-opt__price { font-size: .88rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.co-delivery-opt__price.free { color: #27ae60; }

/* ============================================================
   SAVED ADDRESSES
   ============================================================ */
.co-saved-addresses { padding: .5rem 1.25rem 1rem; border-top: 1px dashed #e4e5ee; }
.co-saved__label { font-size: .75rem; font-weight: 600; color: var(--text-muted); margin-bottom: .45rem; }
.co-saved-list { display: flex; flex-direction: column; gap: .4rem; }
.co-saved-addr {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid #e4e5ee;
  border-radius: 8px;
  background: #f7f8fc;
  font-size: .8rem;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: all .15s;
}
.co-saved-addr svg { width: 14px; height: 14px; stroke: #4169e1; flex-shrink: 0; }
.co-saved-addr:hover { border-color: #4169e1; background: #eef0fa; color: #4169e1; }

/* ============================================================
   STORE PICKUP
   ============================================================ */
.co-store-list { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.25rem; }
.co-store-opt {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 2px solid #e4e5ee;
  border-radius: 10px;
  padding: .85rem 1rem;
  cursor: pointer;
  transition: all .2s;
}
.co-store-opt input { display: none; }
.co-store-opt:has(input:checked) { border-color: #4169e1; background: #eef0fa; }
.co-store-opt__body { flex: 1; }
.co-store-opt__body strong { display: block; font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: .15rem; }
.co-store-opt__body span { display: block; font-size: .75rem; color: var(--text-muted); }
.co-store-hours { color: #4169e1 !important; font-weight: 600 !important; margin-top: .15rem; }

/* ============================================================
   READONLY CARD
   ============================================================ */
.co-readonly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; padding: 1rem 1.25rem; }
.co-readonly-item { display: flex; flex-direction: column; gap: .15rem; }
.co-readonly-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.co-readonly-val { font-size: .85rem; font-weight: 600; color: var(--text); }
.co-green { color: #27ae60 !important; }

/* ============================================================
   PAYMENT METHOD TABS
   ============================================================ */
.co-pay-tabs {
  display: flex;
  gap: .5rem;
  padding: 1rem 1.25rem .5rem;
  border-bottom: 1px solid #f0f1f7;
  flex-wrap: wrap;
}
.co-pay-tab {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  background: #f7f8fc;
  font-size: .82rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.co-pay-tab svg { width: 15px; height: 15px; stroke: currentColor; }
.co-pay-tab.active { border-color: #4169e1; background: #eef0fa; color: #4169e1; }
.co-pay-tab:hover:not(.active) { border-color: #c5cbee; color: var(--text); }

.co-pay-panel { display: none; padding: 1.1rem 1.25rem; }
.co-pay-panel.active { display: block; }

/* ============================================================
   CARD PREVIEW (3D flip)
   ============================================================ */
.co-card-preview {
  width: 100%;
  max-width: 360px;
  height: 200px;
  perspective: 1000px;
  margin: 0 auto 1.25rem;
}
.co-card-preview__front,
.co-card-preview__back {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5rem;
  backface-visibility: hidden;
  transition: transform .6s ease;
}
.co-card-preview__front {
  background: linear-gradient(135deg, #1a1f6e 0%, #4169e1 60%, #6c8fff 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.co-card-preview__back {
  background: linear-gradient(135deg, #2a3080 0%, #4169e1 100%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.co-card-preview { position: relative; transform-style: preserve-3d; }
.co-card-preview.flipped .co-card-preview__front { transform: rotateY(-180deg); }
.co-card-preview.flipped .co-card-preview__back  { transform: rotateY(0deg); }

.co-card-preview__chip {
  width: 40px;
  height: 30px;
  background: linear-gradient(135deg, #d4af37, #f5d060);
  border-radius: 5px;
  margin-bottom: .25rem;
}
.co-card-preview__number {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .18em;
  font-family: monospace;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.co-card-preview__bottom {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
}
.co-card-preview__label { font-size: .6rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .15rem; }
.co-card-preview__holder { font-size: .85rem; font-weight: 700; letter-spacing: .04em; }
.co-card-preview__expiry { font-size: .85rem; font-weight: 700; }
.co-card-preview__logo { margin-left: auto; font-size: 1.2rem; font-weight: 800; color: #fff; font-style: italic; }
.co-card-preview__strip { height: 44px; background: rgba(0,0,0,.5); margin: 0 -1.5rem 1.5rem; }
.co-card-preview__cvv-wrap { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; }
.co-card-preview__cvv-label { font-size: .75rem; color: rgba(255,255,255,.6); }
.co-card-preview__cvv { background: #fff; color: #333; padding: .25rem .75rem; border-radius: 4px; font-size: .9rem; font-weight: 700; letter-spacing: .15em; }

/* CVV help button */
.co-cvv-help {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid #4169e1;
  background: none;
  color: #4169e1;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}
.co-cvv-tooltip {
  position: fixed;
  background: #1a1f6e;
  color: #fff;
  font-size: .78rem;
  padding: .6rem .9rem;
  border-radius: 8px;
  max-width: 220px;
  z-index: 500;
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

/* ============================================================
   BANK GRID
   ============================================================ */
.co-bank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: .75rem; }
.co-bank-opt {
  border: 2px solid #e4e5ee;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.co-bank-opt input { display: none; }
.co-bank-opt:has(input:checked) { border-color: #4169e1; background: #eef0fa; }
.co-bank-opt__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .85rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
}
.co-bank-logo {
  width: 44px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .02em;
}
.co-bank-logo--kapital { background: #0057a8; }
.co-bank-logo--abb     { background: #e30613; }
.co-bank-logo--pasha   { background: #003087; }
.co-bank-logo--atb     { background: #007749; }
.co-bank-logo--rb      { background: #1a1a5e; }
.co-bank-logo--m10     { background: #6a0dad; font-size: .9rem; }
.co-bank-note { font-size: .78rem; color: var(--text-muted); text-align: center; }

/* ============================================================
   CASH
   ============================================================ */
.co-cash-info {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #f0faf4;
  border: 1px solid #b7e4c7;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: .9rem;
}
.co-cash-info svg { width: 24px; height: 24px; stroke: #27ae60; flex-shrink: 0; }
.co-cash-info strong { display: block; font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.co-cash-info p { font-size: .82rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   ACTIONS
   ============================================================ */
.co-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.co-btn-back {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  padding: .5rem 0;
}
.co-btn-back svg { width: 16px; height: 16px; stroke: currentColor; }
.co-btn-back:hover { color: #4169e1; }
.co-btn-next { font-size: .92rem; padding: .75rem 1.75rem; display: flex; align-items: center; gap: .45rem; }
.co-btn-next svg { width: 16px; height: 16px; stroke: currentColor; }
.co-btn-pay { min-width: 220px; }

/* ============================================================
   RIGHT: ORDER SUMMARY
   ============================================================ */
.co-summary {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--header-h, 60px) + 12px);
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.co-summary__title { font-size: 1.05rem; font-weight: 800; margin: 0; }

.co-summary__items { display: flex; flex-direction: column; gap: .75rem; }
.co-summary__item {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.co-summary__item-img {
  position: relative;
  width: 44px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e4e5ee;
}
.co-summary__item-img img { width: 100%; height: 100%; object-fit: cover; }
.co-summary__item-qty {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4169e1;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.co-summary__item-info { flex: 1; min-width: 0; }
.co-summary__item-name { display: block; font-size: .82rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-summary__item-author { font-size: .72rem; color: var(--text-muted); }
.co-summary__item-price { font-size: .88rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.co-summary__divider { height: 1px; background: #f0f1f7; }
.co-summary__rows { display: flex; flex-direction: column; gap: .5rem; }
.co-summary__row { display: flex; justify-content: space-between; font-size: .84rem; color: var(--text-muted); }
.co-summary__row span:last-child { font-weight: 600; color: var(--text); }
.co-summary__total-row { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.co-summary__total { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.co-summary__secure { display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .72rem; color: var(--text-muted); }
.co-summary__secure svg { width: 14px; height: 14px; stroke: #27ae60; }

/* ============================================================
   SUCCESS OVERLAY
   ============================================================ */
.co-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.co-success-card {
  background: #fff;
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: modalIn .35s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.co-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(46,204,113,.35);
}
.co-success-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.co-success-card p { font-size: .9rem; color: var(--text-muted); margin-bottom: .4rem; }
.co-success-card p strong { color: var(--text); }
.co-success-sub { font-size: .82rem !important; }
.co-success-actions { display: flex; gap: .75rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* ============================================================
   SPINNER & ANIMATIONS
   ============================================================ */
.co-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes coShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.co-shake { animation: coShake .35s ease; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .co-layout { grid-template-columns: 1fr; }
  .co-summary { position: static; }
  .co-form-grid--2 { grid-template-columns: 1fr; }
  .co-bank-grid { grid-template-columns: repeat(2, 1fr); }
  .co-readonly-grid { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .co-steps { padding: .75rem .9rem; }
  .co-step span { display: none; }
  .co-card-preview { max-width: 100%; height: 170px; }
  .co-card-preview__number { font-size: 1rem; }
  .co-bank-grid { grid-template-columns: repeat(2, 1fr); }
}
