/* ===== Carrito + checkout (capas sobre styles.css) ===== */

/* Badge en el icono del carrito (sticky header) */
.cart-button {
  position: relative;
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  text-decoration: none;
}
.cart-button:hover { border-color: var(--navy-700); color: var(--navy-700); }
.cart-button svg { width: 18px; height: 18px; }
.cart-count {
  display: none;
  background: var(--red-500);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.cart-count.has-items { display: inline-block; }

/* Drawer lateral */
.cart-drawer {
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 66, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  display: flex;
  justify-content: flex-end;
}
.cart-drawer.open { opacity: 1; pointer-events: auto; }
.cart-drawer-panel {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.open .cart-drawer-panel { transform: translateX(0); }
.cart-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--navy-700); }
.cart-drawer-close {
  background: transparent;
  border: none;
  font-size: 26px;
  color: var(--ink-soft);
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 8px;
  line-height: 1;
}
.cart-drawer-close:hover { background: var(--navy-50); color: var(--navy-700); }
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.cart-empty {
  text-align: center;
  padding: 40px 12px;
  color: var(--ink-soft);
}
.cart-empty p { margin: 0 0 14px; }
.cart-err {
  background: var(--red-50);
  border: 1px solid rgba(200,16,46,0.2);
  color: var(--red-600);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item img {
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--navy-50);
}
.ci-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ci-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ci-price { font-size: 12px; color: var(--ink-soft); }
.ci-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.ci-qty button {
  width: 26px; height: 26px;
  background: var(--navy-50);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-700);
  cursor: pointer;
}
.ci-qty button:hover { background: var(--navy-100); }
.ci-qty span {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}
.ci-remove {
  margin-left: auto;
  width: 26px; height: 26px;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.ci-remove:hover { color: var(--red-600); border-color: var(--red-500); background: var(--red-50); }

.cart-drawer-foot {
  border-top: 1px solid var(--border);
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
}
.cart-drawer-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}
.cart-drawer-total-row .label { color: var(--ink-soft); font-size: 13px; }
.cart-drawer-total {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-700);
}
.cart-drawer-checkout {
  background: var(--red-500);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(200,16,46,0.30);
}
.cart-drawer-checkout:hover { background: var(--red-600); }
.cart-drawer-note {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}

/* "Agregar al carrito" en cards del catálogo */
.btn-addcart {
  background: var(--navy-700);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  transition: background 0.15s, transform 0.08s;
}
.btn-addcart:hover { background: var(--navy-800); }
.btn-addcart:active { transform: scale(0.98); }
.btn-addcart svg { width: 16px; height: 16px; }

/* Carrito + Checkout page wrappers */
.shop-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.shop-page h1 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  color: var(--navy-700);
  margin: 0 0 18px;
}

.cart-list-page .item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.cart-list-page .item img {
  width: 80px; height: 100px; object-fit: cover;
  border-radius: 8px; background: var(--navy-50);
}
.cart-list-page .item .body { min-width: 0; }
.cart-list-page .item .name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}
.cart-list-page .item .meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.cart-list-page .item .actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.cart-list-page .summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}
.cart-list-page .summary .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}
.cart-list-page .summary .row.total {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
  font-weight: 800;
  font-size: 18px;
  color: var(--navy-700);
}

/* Checkout */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 800px) {
  .checkout-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}
.checkout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.checkout-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-700);
}
.checkout-card .form-grid { gap: 14px; }
.checkout-summary {
  position: sticky;
  top: 80px;
}
.checkout-summary .items { margin-bottom: 12px; }
.checkout-summary .item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.checkout-summary .item:last-child { border-bottom: none; }
.checkout-summary .item img {
  width: 48px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--navy-50);
}
.checkout-summary .item .name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.checkout-summary .item .qty { font-size: 12px; color: var(--ink-soft); }
.checkout-summary .item .sub { margin-left: auto; font-weight: 700; font-size: 13px; align-self: center; }
.checkout-summary .totals { padding-top: 8px; border-top: 1px solid var(--border); }
.checkout-summary .totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.checkout-summary .totals .row.total { font-size: 20px; font-weight: 800; color: var(--navy-700); padding-top: 8px; }

.checkout-dummy-note {
  background: linear-gradient(135deg, #fff5e6, #fff);
  border: 1px solid #f5a623;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: #6b4500;
  margin-bottom: 14px;
}
.checkout-dummy-note strong { color: #8a6700; }
.btn-pay {
  width: 100%;
  background: var(--red-500);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  padding: 15px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(200,16,46,0.30);
}
.btn-pay:hover:not(:disabled) { background: var(--red-600); }
.btn-pay:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-pay.dummy { background: #f5a623; box-shadow: 0 8px 20px rgba(245,166,35,0.35); }
.btn-pay.dummy:hover:not(:disabled) { background: #d6900e; }

@keyframes gigosToastIn { from { opacity:0;transform:translateY(8px);} to { opacity:1;transform:translateY(0);} }

/* Status badges (en mis-ordenes y admin) */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-pendiente   { background: #fff5e6; color: #b87800; }
.status-pagado      { background: #e8f1ff; color: #1d4ed8; }
.status-preparando  { background: #fef3c7; color: #92400e; }
.status-enviado     { background: #ddd6fe; color: #5b21b6; }
.status-entregado   { background: #d1fae5; color: #065f46; }
.status-cancelado   { background: #fdecef; color: var(--red-600); }
