/* Checkout — iPhone UP
   Hereda variables y nav de styles.css. Aquí solo el layout específico. */

.checkout {
  padding: 110px 0 80px;
  min-height: 100vh;
}
.checkout-inner {
  max-width: var(--max, 1280px);
  margin: 0 auto;
  padding: 0 24px;
}

.checkout-head {
  margin-bottom: 32px;
}
.checkout-back {
  display: inline-block;
  color: #b3b3b3;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
  transition: color .15s;
}
.checkout-back:hover { color: var(--accent, #A4E83A); }
.checkout-head h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.checkout-sub {
  color: #b3b3b3;
  margin: 0;
  font-size: 15px;
}

.checkout-empty {
  text-align: center;
  padding: 80px 24px;
}
.checkout-empty p {
  color: #b3b3b3;
  margin-bottom: 24px;
  font-size: 17px;
}

/* ---------- Grid ---------- */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ---------- Form ---------- */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.co-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 24px;
}
.co-section h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.co-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.co-row.two { grid-template-columns: 1fr 1fr; }
.co-row:last-child { margin-bottom: 0; }

.co-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.co-field > span {
  font-size: 12px;
  color: #b3b3b3;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.co-field input,
.co-field select {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
  width: 100%;
  appearance: none;
}
.co-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23b3b3b3' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.co-field input:focus,
.co-field select:focus {
  outline: none;
  border-color: var(--accent, #A4E83A);
  background: rgba(164,232,58,0.04);
}
.co-field input:disabled,
.co-field select:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.co-field input::placeholder { color: #555; }

.co-hint {
  color: #b3b3b3;
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* ---------- Dropdown propio (región / comuna) ---------- */
.co-dd { position: relative; width: 100%; }
.co-dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-family: inherit; font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.co-dd-btn:hover { border-color: rgba(164,232,58,0.4); }
.co-dd.open .co-dd-btn { border-color: var(--accent, #A4E83A); background: rgba(164,232,58,0.04); }
.co-dd-btn:disabled { opacity: .4; cursor: not-allowed; }
.co-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-dd-placeholder { color: #6b6b6b; }
.co-dd-caret { flex-shrink: 0; color: #b3b3b3; transition: transform .18s; }
.co-dd.open .co-dd-caret { transform: rotate(180deg); }
.co-dd-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #0d0f0a;
  border: 1px solid rgba(164,232,58,0.28);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.75);
  max-height: 280px; overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.co-dd-opt {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
  color: #eaeaea;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.co-dd-opt:hover { background: rgba(164,232,58,0.15); color: #fff; }
.co-dd-empty { padding: 12px; color: #888; font-size: 14px; text-align: center; }

/* ---------- Método de entrega (despacho / retiro) ---------- */
.co-method { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.co-method-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  cursor: pointer; text-align: left;
  font-family: inherit; color: #fff;
  transition: border-color .15s, background .15s;
}
.co-method-opt:hover { border-color: rgba(164,232,58,0.4); }
.co-method-opt.active { border-color: var(--accent, #A4E83A); background: rgba(164,232,58,0.07); }
.co-method-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }
.co-method-text { display: flex; flex-direction: column; gap: 2px; }
.co-method-text strong { font-size: 14px; font-weight: 600; }
.co-method-text small { font-size: 12px; color: #b3b3b3; }
.co-pickup-card {
  border: 1px solid rgba(164,232,58,0.28);
  background: rgba(164,232,58,0.05);
  border-radius: 12px;
  padding: 16px 18px;
}
.co-pickup-card strong { display: block; font-size: 15px; margin-bottom: 8px; }
.co-pickup-card p { margin: 0 0 6px; color: #cfcfcf; font-size: 14px; line-height: 1.5; }
.co-pickup-card p:last-child { margin-bottom: 0; color: #b3b3b3; font-size: 13px; }
@media (max-width: 600px) { .co-method { grid-template-columns: 1fr; } }

/* ---------- Shipping options ---------- */
.co-shipping { display: flex; flex-direction: column; gap: 10px; }
.co-shipping.loading::before {
  content: "Cotizando con Chilexpress…";
  color: #b3b3b3;
  font-size: 14px;
}

.co-ship-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.co-ship-option:hover { border-color: rgba(164,232,58,0.4); }
.co-ship-option.selected {
  border-color: var(--accent, #A4E83A);
  background: rgba(164,232,58,0.06);
}
.co-ship-option input { accent-color: var(--accent, #A4E83A); }
.co-ship-option .co-ship-info { flex: 1; }
.co-ship-option .co-ship-name {
  font-weight: 600;
  margin-bottom: 2px;
}
.co-ship-option .co-ship-meta {
  font-size: 13px;
  color: #b3b3b3;
}
.co-ship-option .co-ship-price {
  font-weight: 700;
  color: var(--accent, #A4E83A);
}

/* Envío por pagar (no se cobra en la web) */
.co-ship-porpagar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(164,232,58,0.35);
  border-radius: 12px;
  background: rgba(164,232,58,0.06);
}
.co-ship-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0a0a0a;
  background: var(--accent, #A4E83A);
  padding: 5px 10px;
  border-radius: 6px;
}
.co-ship-porpagar .co-ship-name { font-weight: 600; margin-bottom: 4px; }
.co-ship-porpagar .co-ship-meta { font-size: 13px; color: #b3b3b3; line-height: 1.5; }

/* ---------- Pago ---------- */
.co-pay-icons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.co-pay-icons span {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #b3b3b3;
}

.co-submit {
  margin-top: 8px;
  font-size: 17px;
  padding: 16px 24px;
}
.co-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.5);
}

.co-error {
  color: #ff6b6b;
  font-size: 14px;
  margin: 0;
  min-height: 18px;
}

/* ---------- Summary ---------- */
.co-summary {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 24px;
  position: sticky;
  top: 100px;
}
.co-summary h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
}
.co-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.co-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
}
.co-item img {
  width: 48px; height: 48px;
  object-fit: contain;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}
.co-item-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.co-item-meta {
  color: #b3b3b3;
  font-size: 12px;
}
.co-item-price {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.co-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.co-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: #ddd;
}
.co-line.total {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}
.co-line.total span:last-child { color: var(--accent, #A4E83A); }

.co-summary-foot {
  margin-top: 18px;
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .co-summary {
    position: static;
    order: -1;
  }
}
@media (max-width: 600px) {
  .checkout { padding: 90px 0 60px; }
  .co-row.two { grid-template-columns: 1fr; }
  .co-section { padding: 18px; }
  .co-summary { padding: 18px; }
}
