/* DIGISTORE — Fase 20: notificación «Agregado al carrito», carrito y páginas de saldo/recarga (móvil primero).
   Se carga DESPUÉS de las demás hojas y solo añade o sobrescribe reglas de estas pantallas (no toca la lógica). */

html { -webkit-text-size-adjust: 100%; }

/* ---------- 1. Notificación compacta «Agregado al carrito» ---------- */
.cart-toast {
  position: fixed; left: 50%; z-index: 1000;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: min(calc(100vw - 24px), 420px);
  padding: 8px 8px 8px 10px; box-sizing: border-box;
  background: #17142a; color: #fff;
  border: 1px solid rgba(139, 92, 246, .45); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: opacity .18s ease, transform .18s ease;
}
.cart-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.cart-toast-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #7c3aed; color: #fff; display: flex; align-items: center; justify-content: center; }
.cart-toast-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cart-toast-sub { font-size: 11px; color: #c4b5fd; font-weight: 500; }
.cart-toast-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-toast-link { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cart-toast-link:hover, .cart-toast-link:focus-visible { background: #7c3aed; outline: none; }
.cart-toast-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #cbd5e1; font-size: 22px; line-height: 1; cursor: pointer; }
.cart-toast-x:hover, .cart-toast-x:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; outline: none; }
@media (prefers-reduced-motion: reduce) { .cart-toast { transition: none; } }

/* ---------- 2. Carrito ---------- */
.sv-cart .cart-layout { align-items: start; }
.sv-cart #cartLines { display: grid; gap: 12px; }
.sv-cart .cl2 {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 14px; align-items: start;
  padding: 14px; margin: 0; box-sizing: border-box; min-width: 0;
  background: var(--surface-1); border: 1px solid rgba(139, 92, 246, .2); border-radius: 16px;
}
.sv-cart .cl2 .cart-line-logo { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; }
.sv-cart .cl2 .cart-line-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; box-sizing: border-box; }
.sv-cart .cl2-main { min-width: 0; }
.sv-cart .cl2 .cart-line-name { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.sv-cart .cl2-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.sv-cart .cl2-chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(139, 92, 246, .16); color: #c4b5fd; white-space: nowrap; }
.sv-cart .cl2-unit { font-size: 13px; color: var(--text-secondary, #a1a1b5); }
.sv-cart .cl2-bad { color: #f87171; }
.sv-cart .cl2-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sv-cart .cl2 .cart-qty { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.sv-cart .cl2 .cart-qty button { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; font-weight: 700; cursor: pointer; }
.sv-cart .cl2 .cart-qty span { min-width: 34px; text-align: center; font-size: 15px; font-weight: 700; }
.sv-cart .cl2-sub { margin-left: auto; text-align: right; font-size: 17px; font-weight: 800; white-space: nowrap; }
.sv-cart .cl2-sub small { display: block; font-size: 11px; font-weight: 500; color: var(--text-secondary, #a1a1b5); }
.sv-cart .cl2-del { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; }
.sv-cart .cart-continue { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; color: #c4b5fd; font-weight: 600; text-decoration: none; }
.sv-cart .cart-continue:hover { color: #fff; }
.sv-cart .cart-summary-card { border-radius: 16px; padding: 18px; box-sizing: border-box; }
.sv-cart .cart-summary-title { margin: 0 0 12px; font-size: 16px; }
.sv-cart .cart-summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.sv-cart .cart-summary-row.total { margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 22px; font-weight: 800; }
.sv-cart #checkoutArea { margin-top: 14px; }
.sv-cart #checkoutArea .btn, .sv-cart #checkoutArea .btn-block { min-height: 48px; font-size: 15px; display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; text-align: center; white-space: normal; }
.sv-cart #checkoutArea .note { font-size: 13px; line-height: 1.45; }
.sv-cart .cart-layout, .sv-cart .cart-items-col, .sv-cart .cart-summary-col { min-width: 0; }
@media (max-width: 900px) {
  .sv-cart .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .sv-cart .cart-summary-col { position: static; }
}
@media (max-width: 360px) {
  .sv-cart .cl2 { grid-template-columns: 52px minmax(0, 1fr); gap: 8px 10px; padding: 12px; }
  .sv-cart .cl2 .cart-line-logo { width: 52px; height: 52px; }
  .sv-cart .cl2 .cart-qty button { width: 38px; height: 38px; }
  .sv-cart .cl2-sub { font-size: 16px; }
}

/* ---------- 3. Saldo y Recargar saldo (billetera) ---------- */
#invRoot .recharge-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#invRoot .recharge-col, #invRoot .field, #invRoot .input-shell { min-width: 0; max-width: 100%; box-sizing: border-box; }
#invRoot .input-shell input { min-width: 0; width: 100%; font-size: 16px; }
#invRoot #payNumbersBox, #invRoot .note, #invRoot .field-help, #invRoot .mv-title { overflow-wrap: anywhere; }
#invRoot .recharge-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; padding: 14px 16px; box-sizing: border-box; }
#invRoot .recharge-topbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#invRoot .recharge-topbar-balance { flex: none; }
#invRoot .wallet-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; text-align: left; }
#invRoot .wallet-box .num { font-size: 1.9rem; margin-top: 2px; }
#invRoot .btn-block { min-height: 48px; box-sizing: border-box; }
#invRoot img { max-width: 100%; height: auto; }
@media (max-width: 720px) {
  #invRoot .recharge-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .site-main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
@media (max-width: 400px) {
  #invRoot .recharge-topbar { gap: 10px; padding: 12px; }
  #invRoot .recharge-avatar { width: 38px; height: 38px; font-size: .95rem; flex: none; }
  #invRoot .recharge-topbar-name { font-size: .92rem; }
  #invRoot .recharge-topbar-num { font-size: 1.05rem; }
  #invRoot .wallet-box { padding: 12px 14px; }
  #invRoot .wallet-box .num { font-size: 1.6rem; }
}
.sheet-backdrop .sheet { max-width: 100%; box-sizing: border-box; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

/* Las tarjetas de producto van sueltas: la columna del carrito deja de ser una tarjeta contenedora */
.sv-cart .cart-items-col { background: none; border: 0; box-shadow: none; padding: 0; }
#invRoot .note { margin-bottom: 16px; }

/* Menú de cuenta en móvil: la tira horizontal de enlaces no debe ensanchar la página (la columna única necesitaba minmax(0,1fr)) */
@media (max-width: 768px) {
  #invRoot .account-shell { grid-template-columns: minmax(0, 1fr); }
  #invRoot #acctSidebar, #invRoot .account-shell > * { min-width: 0; }
}
.cart-toast-sub { white-space: nowrap; }
@media (max-width: 360px) {
  .cart-toast { gap: 8px; padding-left: 8px; }
  .cart-toast-link { padding: 0 10px; font-size: 12px; }
  .cart-toast-x { width: 32px; }
}
