/* Carrito y pasos de compra */
.cart-dialog {
  width: min(850px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 850px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink, #20252b);
  box-shadow: 0 24px 80px #1115;
}
.cart-dialog::backdrop { background: #1119; }
.cart-dialog [hidden] { display: none !important; }
.cart-shell { display: flex; flex-direction: column; max-height: min(88vh, 850px); }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line, #e2e5e8);
  background: #fff;
}
.cart-head h2 { margin: 0; font-size: 22px; }
.cart-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f2f3f4;
  color: #343a40;
  font-size: 22px;
}
.cart-body { overflow: auto; padding: 20px 22px; background: #fff; }
.cart-empty { padding: 36px 12px; color: var(--muted, #66717b); text-align: center; }
.cart-empty strong { display: block; margin-bottom: 5px; color: var(--ink, #20252b); font-size: 18px; }
.cart-items { display: grid; gap: 11px; }
.cart-item {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line, #e2e5e8);
  border-radius: 8px;
  background: #fff;
}
.cart-thumb {
  display: block;
  width: 60px !important;
  height: 60px !important;
  max-width: 60px;
  max-height: 60px;
  border: 1px solid #edf0f2;
  border-radius: 6px;
  padding: 3px;
  object-fit: contain;
  background: #fff;
}
.cart-item h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.35; }
.cart-item small { color: var(--muted, #66717b); }
.cart-item-price { text-align: right; font-weight: 700; white-space: nowrap; }
.cart-controls { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.cart-qty { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #d8dce0; border-radius: 5px; }
.cart-qty button { width: 32px; height: 31px; border: 0; background: #f7f7f7; color: var(--ink, #20252b); font-size: 18px; }
.cart-qty span { min-width: 34px; text-align: center; font-size: 14px; }
.cart-qty input { width: 38px; height: 31px; padding: 0; border: 0; border-radius: 0; background: #fff; color: var(--ink, #20252b); text-align: center; font-size: 14px; }
.cart-qty input:focus { outline: 1px solid #b5121b55; outline-offset: -1px; }
.cart-qty input::-webkit-inner-spin-button, .cart-qty input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.cart-remove { border: 0; background: transparent; color: var(--red, #b5121b); font-size: 13px; }
.cart-summary { max-width: 390px; margin: 16px 0 0 auto; padding-top: 12px; border-top: 1px solid var(--line, #e2e5e8); }
.cart-total-row { display: flex; justify-content: space-between; gap: 15px; padding: 4px 0; }
.cart-total-row strong { font-size: 19px; }
.cart-note { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #f1deb1; border-radius: 6px; background: #fff8e8; color: #6b5521; font-size: 12px; }
.cart-actions, .checkout-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.cart-actions button, .checkout-actions button, .share-actions button { min-height: 44px; padding: 10px 16px; border-radius: 5px; font-weight: 700; }
.cart-secondary { border: 1px solid #cfd3d7; background: #fff; color: var(--ink, #20252b); }
.cart-primary { border: 1px solid var(--red, #b5121b); background: var(--red, #b5121b); color: #fff; }
.cart-primary:hover { background: var(--red-dark, #8f0e16); }
.cart-primary:disabled { border-color: #c7c7c7; background: #c7c7c7; cursor: not-allowed; }
.checkout-form { display: grid; gap: 13px; }
.checkout-form h3 { margin: 0; font-size: 18px; }
.checkout-form p { margin: -7px 0 2px; color: var(--muted, #66717b); font-size: 13px; }
.checkout-field { display: grid; gap: 5px; }
.checkout-field label { font-size: 13px; font-weight: 700; }
.checkout-field input, .checkout-field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid #cfd3d7;
  border-radius: 5px;
  background: #fff;
}
.checkout-field input:focus, .checkout-field select:focus { outline: 2px solid #b5121b33; border-color: var(--red, #b5121b); }
.delivery-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.delivery-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #d7dade; border-radius: 7px; cursor: pointer; }
.delivery-option:has(input:checked) { border-color: var(--red, #b5121b); background: #fff8f8; }
.delivery-option input { margin-top: 3px; accent-color: var(--red, #b5121b); }
.delivery-option strong { display: block; font-size: 14px; }
.delivery-option small { display: block; margin-top: 3px; color: var(--muted, #66717b); font-size: 12px; }
.delivery-details { display: grid; gap: 12px; padding: 13px; border: 1px solid var(--line, #e2e5e8); border-radius: 7px; }
.delivery-region { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
#checkoutLocationSummary { margin: 0; padding: 10px 12px; }
#checkoutLocationSummary p { margin: 4px 0 0; }
.delivery-advice { margin: 0 !important; padding: 11px 13px; border: 1px solid #f1deb1; border-radius: 6px; background: #fff8e8; color: #6b5521 !important; font-size: 13px !important; line-height: 1.5; }
.delivery-advice a { color: #146c43; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.checkout-consent { display: flex; align-items: flex-start; gap: 9px; color: #4b555e; font-size: 12px; line-height: 1.4; }
.checkout-consent input { margin-top: 2px; accent-color: var(--red, #b5121b); }
.checkout-error { min-height: 18px; color: var(--red, #b5121b); font-size: 13px; }
.order-ready { padding: 16px; border: 1px solid #b9ddca; border-radius: 8px; background: #f1faf5; }
.order-ready h3 { margin: 0 0 6px; color: #17613a; }
.order-ready p { margin: 5px 0; color: #3d5346; font-size: 13px; }
.order-code { font-size: 18px !important; font-weight: 700; letter-spacing: .4px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.share-actions button { border: 1px solid #cfd3d7; background: #fff; color: var(--ink, #20252b); }
.share-actions .cart-primary { border-color: var(--red, #b5121b); background: var(--red, #b5121b); color: #fff; }
.whatsapp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.whatsapp-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 5px; color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
.whatsapp-actions a::before { content: '◉'; margin-right: 8px; }
.whatsapp-actions a:hover { background: #8f0e16; }
@media (max-width: 560px) {
  .cart-dialog { width: calc(100vw - 20px); max-height: 92vh; border-radius: 10px; }
  .cart-shell { max-height: 92vh; }
  .cart-head { padding: 14px 16px; }
  .cart-head h2 { font-size: 20px; }
  .cart-body { padding: 15px; }
  .cart-item { grid-template-columns: 50px minmax(0, 1fr); gap: 9px; padding: 10px; }
  .cart-thumb { width: 50px !important; height: 50px !important; max-width: 50px; max-height: 50px; grid-row: span 2; }
  .cart-item h3 { font-size: 14px; }
  .cart-item-price { grid-column: 2; text-align: left; }
  .cart-summary { max-width: none; }
  .cart-actions, .checkout-actions { flex-direction: column-reverse; }
  .cart-actions button, .checkout-actions button { width: 100%; }
  .delivery-options, .delivery-region { grid-template-columns: 1fr; }
}
