/* ─────────────────────────────────────────────────
   checkout.css — Модальное окно оформления заказа
   skipershop.by
───────────────────────────────────────────────── */

/* Honeypot */
.co-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
  tabindex: -1;
}

/* ── Оверлей ───────────────────────────────────── */
.co-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(3px);
}

.co-overlay--open {
  opacity: 1;
  pointer-events: all;
}

/* ── Модальное окно ────────────────────────────── */
.co-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .28);
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(28px);
  transition: transform .25s;
  scrollbar-width: thin;
}

.co-overlay--open .co-modal {
  transform: translateY(0);
}

/* Кнопка закрытия */
.co-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  width: 42px;
  height: 42px;
  border: none;
  background: #e0e0e0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  z-index: 2;
  transition: background .2s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.co-close:hover { background: #c8c8c8; }

/* ── Заголовок ─────────────────────────────────── */
.co-header {
  padding: 20px 24px 4px;
  clear: both;
}

.co-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0;
}

/* ── Тело — двухколоночный грид ─────────────────── */
.co-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 20px 24px 28px;
}

/* ── Сводка заказа (левая колонка) ──────────────── */
.co-summary {
  background: #f6f6f6;
  border-radius: 12px;
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 12px;
}

.co-summary-title {
  font-size: .95rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.co-summary-name {
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 14px;
}

.co-summary-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.co-summary-qty-label {
  font-size: .83rem;
  color: #666;
  white-space: nowrap;
}

/* Счётчик количества */
.co-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 3px 10px;
}

.co-qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: #1a7a2e;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background .15s;
  padding: 0;
}
.co-qty-btn:hover { background: #e8f5eb; }

.co-qty-display {
  font-weight: 700;
  font-size: .95rem;
  min-width: 20px;
  text-align: center;
}

/* Строки стоимости */
.co-summary-lines {
  border-top: 1px solid #e0e0e0;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.co-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: #666;
}

.co-summary-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1a7a2e;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid #1a7a2e;
}

/* ── Форма (правая колонка) ────────────────────── */
.co-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.co-field {
  margin-bottom: 16px;
}

.co-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.co-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: .95rem;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
  font-family: inherit;
}

.co-input:focus {
  border-color: #1a7a2e;
  box-shadow: 0 0 0 3px rgba(26, 122, 46, .12);
}

.co-input--err {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, .1) !important;
}

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

/* ── Варианты: оплата и доставка ────────────────── */
.co-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.co-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  font-size: .88rem;
  user-select: none;
  line-height: 1.3;
}

.co-option:hover {
  border-color: #1a7a2e;
  background: #f2fbf4;
}

.co-option input[type="radio"] {
  accent-color: #1a7a2e;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.co-option.is-checked {
  border-color: #1a7a2e;
  background: #e8f5eb;
}

.co-option-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.co-option-body small {
  font-size: .76rem;
  color: #777;
}

.co-option-icon {
  font-size: 17px;
  flex-shrink: 0;
}

/* ── Ошибки ──────────────────────────────────────── */
.co-err {
  display: block;
  font-size: .78rem;
  color: #d32f2f;
  margin-top: 4px;
  min-height: 1.1em;
}

/* ── Кнопка «Оформить заказ» ─────────────────────── */
.co-submit {
  width: 100%;
  padding: 15px;
  background: #f57c00;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  margin-top: 6px;
  font-family: inherit;
  letter-spacing: .01em;
}

.co-submit:hover:not(:disabled) { background: #e06500; }
.co-submit:active:not(:disabled) { transform: scale(.98); }
.co-submit:disabled { background: #ccc; cursor: not-allowed; }

/* ── Сообщение о результате ─────────────────────── */
.co-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-top: 14px;
  font-size: .93rem;
  line-height: 1.5;
}

.co-result--success { background: #e8f5eb; color: #1a5e2e; }
.co-result--error   { background: #fdecea; color: #c62828; }

/* ── Адаптив ─────────────────────────────────────── */
@media (max-width: 680px) {
  .co-body {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 14px 16px 24px;
  }

  .co-summary {
    position: static;
    order: -1;
  }

  .co-title { font-size: 1.15rem; }

  .co-header { padding: 16px 16px 4px; }
}
