/* ==========================================================
   CARRITO + PANEL DE PROPUESTA
   ========================================================== */
body.no-scroll { overflow: hidden; }
.scrim { position: fixed; inset: 0; z-index: 140; background: rgba(46, 26, 11, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .45s var(--ease); }
.scrim.is-open { opacity: 1; }

.cart, .proposal {
  position: fixed; z-index: 150; top: 0; right: 0; bottom: 0; width: min(500px, 100%); background: var(--paper); color: var(--choc-900);
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; transform: translateX(105%); transition: transform .55s var(--ease);
  box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .5); border-radius: 28px 0 0 28px; overflow: hidden;
}
.cart.is-open, .proposal.is-open { transform: none; }
.cart__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 8px; }
.cart__head h2 { font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1; }
.cart__close { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--choc); display: grid; place-items: center; transition: transform .35s var(--ease), background .25s, color .25s; }
.cart__close svg { width: 20px; height: 20px; }
.cart__close:hover { background: var(--choc); color: var(--butter); transform: rotate(90deg); }
.cart__steps { display: flex; gap: 6px; padding: 8px 22px 14px; }
.cart__steps li { flex: 1; font: 800 .66rem/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; padding-top: 10px; border-top: 4px solid color-mix(in srgb, var(--choc) 18%, transparent); opacity: .55; transition: .35s; }
.cart__steps li.is-on { border-color: var(--choc); opacity: 1; }
.cart__body { overflow-y: auto; padding: 4px 22px 22px; overscroll-behavior: contain; }
.cart__foot { padding: 14px 22px calc(18px + env(safe-area-inset-bottom)); border-top: 2px dashed color-mix(in srgb, var(--choc) 28%, transparent); background: var(--butter-50); display: grid; gap: 12px; }
.cart__foot .btn { width: 100%; }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; font-size: .9rem; }
.cart__total b { font: 400 1.9rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.cart__fine { font-size: .78rem; opacity: .75; line-height: 1.4; margin-top: 14px; }

.cart__empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 10px; }
.cart__empty img { width: 120px; height: auto; animation: bob 3s ease-in-out infinite; }
.cart__empty h3 { font: 400 1.7rem/1 var(--f-display); }
.cart__empty-cta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(2deg); } }

.cart__list { display: grid; gap: 12px; }
.ci { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 14px; border-radius: 20px; background: var(--butter); align-items: start; overflow: hidden; }
.ci__thumb { width: 76px; height: 76px; display: grid; place-items: center; position: relative; }
.ci__thumb img, .ci__thumb svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 4px rgba(50, 25, 4, .3)); }
.ci__thumb--box span { position: absolute; width: 54px; height: 54px; left: calc(var(--i) * 12px); top: calc(var(--i) * 6px); transform: rotate(calc(var(--i) * 12deg - 10deg)); }
.ci__thumb--box b { position: absolute; right: -4px; bottom: -4px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--choc); color: var(--butter); display: grid; place-items: center; font-size: .78rem; padding: 0 6px; z-index: 2; }
.ci h3 { font: 400 1.12rem/1.15 var(--f-display); }
.ci__lines { font-size: .8rem; opacity: .8; margin-top: 4px; line-height: 1.35; }
.ci__row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ci__side { display: grid; justify-items: end; gap: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.ci__side b { font: 400 1.2rem/1 var(--f-display); }
.ci__rm { font-size: .76rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; opacity: .7; }
.ci__rm:hover { opacity: 1; }
.qty--sm { height: 40px; }
.qty--sm button { width: 36px; }
.link-btn--dark:hover { background: color-mix(in srgb, var(--choc) 10%, transparent); }
.cart .qty output, .qty output { font-variant-numeric: tabular-nums; }

/* Formulario */
.cart__form, .cart__address { display: grid; gap: 16px; }
.f { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.f > label, .f > legend { font-weight: 700; font-size: .88rem; padding: 0; }
.f input[type="text"], .f input[type="date"], .f select, .f textarea {
  width: 100%; min-height: 50px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--choc) 30%, transparent); background: #fff; padding: 12px 14px; font: 500 1rem/1.3 var(--f-body); color: var(--choc-900); transition: border-color .2s, box-shadow .2s;
}
.f textarea { resize: vertical; min-height: 80px; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--choc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 70%, transparent); }
.f.has-err input, .f.has-err select, .f.has-err textarea { border-color: #C0392B; background: #FFF4F2; }
.f__err { color: #A93226; font-weight: 700; font-size: .82rem; }
.f__hint { font-size: .78rem; opacity: .7; }
.ful { display: grid; gap: 8px; }
.ful__opt { display: grid; gap: 2px; padding: 12px 14px 12px 44px; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--choc) 25%, transparent); position: relative; cursor: pointer; transition: border-color .2s, background .2s; }
.ful__opt input { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; accent-color: var(--choc); }
.ful__opt b { font-size: .95rem; }
.ful__opt span { font-size: .8rem; opacity: .75; }
.ful__opt.is-on { border-color: var(--choc); background: var(--butter); }
/* Opciones de entrega para la dirección comprobada */
.ship__check { justify-self: start; }
.ship { display: grid; gap: 10px; }
.ship:empty { display: none; }
.ship__matched { font-weight: 700; font-size: .86rem; overflow-wrap: anywhere; }
.ship__wait { font-size: .9rem; font-weight: 600; opacity: .8; }
.ship__err { color: #A93226; font-weight: 700; font-size: .88rem; }
.ship__opt b { display: flex; justify-content: space-between; gap: 10px; }
.ship__opt em { font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gift { border-radius: 18px; padding: 14px; background: var(--mint-300); display: grid; gap: 12px; }
.gift__fields { display: grid; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 44px; height: 26px; border-radius: 14px; background: color-mix(in srgb, var(--choc) 25%, transparent); position: relative; transition: background .25s; flex: none; }
.switch .tr::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); transition: transform .3s var(--ease); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.switch input:checked + .tr { background: var(--choc); }
.switch input:checked + .tr::after { transform: translateX(18px); }
.switch input:focus-visible + .tr { outline: 3px solid var(--mint-600); outline-offset: 2px; }

/* Mensaje */
.send__lead { font-size: .94rem; margin-bottom: 12px; }
.msg { white-space: pre-wrap; word-break: break-word; font: 500 .85rem/1.5 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; background: #fff; border: 2px solid var(--choc); border-radius: 18px; padding: 16px; margin: 0; max-height: 46vh; overflow: auto; }
.send__demo { margin-top: 12px; font-size: .82rem; }
.send__btns { display: grid; gap: 8px; }
.cart__foot .link-btn { justify-self: start; }

/* Panel de propuesta */
.proposal { grid-template-rows: auto minmax(0, 1fr); background: var(--choc-900); color: var(--butter); z-index: 160; }
.proposal__head { padding: 22px 24px 8px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.proposal__head h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: .95; }
.proposal__head h2 em { color: var(--mint); }
.proposal .cart__close { border-color: var(--butter); color: var(--butter); flex: none; }
.proposal .cart__close:hover { background: var(--butter); color: var(--choc); }
.proposal__body { overflow-y: auto; padding: 8px 24px 40px; display: grid; gap: 22px; align-content: start; }
.proposal h3 { font: 700 .72rem/1 var(--f-body); letter-spacing: .2em; text-transform: uppercase; color: var(--mint); margin-bottom: 10px; }
.prop-list { display: grid; gap: 10px; }
.prop-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: .94rem; line-height: 1.4; }
.prop-list li::before { content: ''; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--mint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='11' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.prop-list b { color: var(--butter); }
.prop-list--todo li::before { background: var(--blush); }
.prop-list li span { opacity: .85; display: block; font-size: .85rem; }
.proposal .switch { color: var(--butter); }
.proposal .switch .tr { background: rgba(248, 239, 198, .25); }
.proposal .switch input:checked + .tr { background: var(--mint); }
.proposal__note { font-size: .8rem; opacity: .7; line-height: 1.45; }

@media (max-width: 700px) {
  .cart, .proposal { width: 100%; border-radius: 0; }
  .ci { grid-template-columns: 64px 1fr; }
  .ci__side { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
  .ci__thumb { width: 64px; height: 64px; }
  .ci__thumb--box span { width: 46px; height: 46px; }
  .ci__side b { justify-self: end; grid-column: 2; grid-row: 1; }
  .ci__rm { grid-column: 1; grid-row: 1; }
}
