:root {
  --brand: #ff620e;
  --brand-2: #ffb899;
  --text: #0b0c0e;
  --muted: #6b7280;
  --paper: #ffffff;
  --line: #e5e7eb;
  --bg: #f7f7f8;
  --r: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --ok: #19c37d;
  --err: #ff4d4f;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto;
  color: var(--text);
  background: var(--bg)
}

/* ===== Layout ===== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px
}

.section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden
}

.cart {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

@media (max-width:900px) {
  .cart {
    grid-template-columns: 1fr
  }
}

.cart-items {
  padding: 0
}

.cart-header,
.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr 120px 140px 32px;
  gap: 12px;
  align-items: center;
}

@media (max-width:700px) {
  .cart-header {
    display: none
  }

  .cart-row {
    grid-template-columns: 72px 1fr 1fr;
    grid-auto-rows: auto
  }
}

.cart-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted)
}

.cart-list {
  display: flex;
  flex-direction: column
}

.cart-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line)
}

.cart-row:last-child {
  border-bottom: none
}

.item-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff
}

.item-name {
  font-weight: 700
}

.item-meta {
  font-size: 12px;
  color: var(--muted)
}

.price {
  font-weight: 700
}

/* Cantidad */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden
}

.qty button {
  background: #fff;
  border: 0;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700
}

.qty input {
  width: 42px;
  text-align: center;
  border: 0;
  padding: 8px 0;
  outline: none
}

/* Acciones lista */
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

/* ===== Resumen ===== */
.summary {
  padding: 14px;
  position: sticky;
  top: 16px
}

.summary h3 {
  margin: 0 0 10px
}

.kv {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  font-size: 14px
}

.kv.total {
  font-weight: 800;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 8px
}

.coupon {
  display: flex;
  gap: 8px;
  margin: 10px 0
}

.coupon input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px
}

.btn,
.btn-outline {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
  transition: .12s;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, #ff5a00 100%);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.03);
  transform: translateY(-1px)
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  border-color: #d4d7de;
  transform: translateY(-1px)
}

.btn .i {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
}

.btn:hover {
  filter: brightness(1.02);
  transform: translateY(-1px)
}

.btn-outline:hover {
  border-color: #d4d7de
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px
}

/* Barra superior */
.tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line)
}

.tools .title {
  font-size: 18px;
  font-weight: 800
}

.tools .spacer {
  flex: 1
}

.tools .small {
  font-size: 13px;
  color: var(--muted)
}

/*Detalles de pago*/
.pay {
  margin: 0 0 12px
}

.pay h3 {
  margin: 0 0 8px
}

.field {
  margin: 10px 0
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field .input {
  position: relative
}

.field .input .i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: currentColor;
  color: #9aa0a6;
  opacity: .9;
  pointer-events: none;
}

.field .input input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.field .input input:focus {
  border-color: #ffc5aa;
  box-shadow: 0 0 0 2px rgba(255, 98, 14, .15);
}

/* Botones (ya definidos), agrego clases si no estaban */
.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, #ff5a00 100%);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.03);
  transform: translateY(-1px)
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  border-color: #d4d7de;
  transform: translateY(-1px)
}

.btn .i {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor
}

/* Errores en Detalles de pago */
.pay .field.error input {
  border-color: var(--err);
  box-shadow: 0 0 0 2px rgba(255, 77, 79, .10);
}

.pay .field .err {
  margin-top: 6px;
  font-size: 12px;
  color: var(--err);
}

/* Select con icono en Detalles de pago */
.field .input select {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.field .input select:focus {
  border-color: #ffc5aa;
  box-shadow: 0 0 0 2px rgba(255, 98, 14, .15);
}

.field .input select {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.field .input select:focus {
  border-color: #ffc5aa;
  box-shadow: 0 0 0 2px rgba(255, 98, 14, .15);
}

.pay .field.error input,
.pay .field.error select {
  border-color: var(--err);
  box-shadow: 0 0 0 2px rgba(255, 77, 79, .10);
}

/* ===== Métodos de Pago ===== */
.pay-methods{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  margin:12px 0 8px;
  background:#fafafa;
}
.pay-methods legend{
  font-weight:800;
  font-size:14px;
  padding:0 6px;
}
.method-card{
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:#fff;
  cursor:pointer;
  position:relative;
  transition:border-color .12s;
}
.method-card + .method-card{ margin-top:8px; }
.method-card:hover{ border-color:#d4d7de; }

/* Radio invisible sobre toda la tarjeta */
.method-card input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

/* Logo */
.method-media img{
  height:22px;
  width:auto;
  display:block;
}

/* Texto */
.method-body{
  display:flex;
  flex-direction:column;
  gap:2px;
  flex:1;
}
.method-body strong{ font-weight:700; }
.method-body small{ color:var(--muted); }

/* Check a la derecha */
.method-check{
  width:24px; height:24px; border-radius:50%;
  border:2px solid #374151; display:inline-flex;
  align-items:center; justify-content:center;
}
.method-card input:checked ~ .method-check{
  background:#374151;
  box-shadow:inset 0 0 0 4px #fff;
}

/* Avisos legales debajo de Métodos de Pago */
.legal{
  margin: 10px 0 12px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
}
.legal p{
  margin: 4px 0;
}
.legal a{
  color: #20c7b5;            /* tono turquesa como en la imagen */
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal a:hover{ opacity: .9; }