
/* ── FAB Carrito ─────────────────────────────────────── */
.wrm-cart-fab {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  right: 1.25rem;
  z-index: 500;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--wrm-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(37,211,102,.45);
  transition: all .25s;
}
.wrm-cart-fab:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(37,211,102,.55); }
@media(min-width:768px){ .wrm-cart-fab { bottom: 1.5rem; } }

.wrm-fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  background: var(--wrm-accent);
  color: #fff;
  font-size: .65rem; font-weight: 800;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  animation: popIn .3s cubic-bezier(.4,0,.2,1);
}

/* ── Overlay ─────────────────────────────────────────── */
.wrm-cart-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  display: none; opacity: 0;
  transition: opacity .3s;
}
.wrm-cart-overlay.open { display: block; opacity: 1; }

/* ── Popup ───────────────────────────────────────────── */
.wrm-cart-popup {
  position: fixed;
  bottom: 0; right: 0;
  width: 100%; max-width: 420px;
  height: 92dvh;
  background: #fff;
  z-index: 900;
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
}
.wrm-cart-popup.open { transform: translateY(0); }
@media(min-width:480px){
  .wrm-cart-popup { bottom: 1rem; right: 1rem; border-radius: 20px; height: 88dvh; transform: translateX(120%); }
  .wrm-cart-popup.open { transform: translateX(0); }
}

/* Header */
.wrm-cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}
.wrm-cart-header-left { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1rem; color: #111; }
.wrm-cart-close {
  background: #f3f4f6; border: none; width: 32px; height: 32px;
  border-radius: 50%; font-size: 1.1rem; cursor: pointer; color: #374151;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.wrm-cart-close:hover { background: #e5e7eb; }

/* Body */
.wrm-cart-body { flex: 1; overflow-y: auto; padding: .75rem 1.25rem; }
.wrm-cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; text-align: center; color: #9ca3af; padding: 2rem;
}
.wrm-cart-empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.wrm-cart-empty p { font-size: 1rem; font-weight: 700; color: #6b7280; margin-bottom: .3rem; }
.wrm-cart-empty span { font-size: .8rem; }

/* Ítem en carrito */
.wrm-cart-item {
  display: grid; grid-template-columns: 48px 1fr auto;
  gap: .75rem; align-items: start;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  animation: fadeIn .2s ease;
}
.wrm-cart-item:last-child { border-bottom: none; }
.wrm-cart-item-img {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover;
  background: #f3f4f6;
}
.wrm-cart-item-noimg {
  width: 48px; height: 48px; border-radius: 10px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.wrm-cart-item-info { min-width: 0; }
.wrm-cart-item-name { font-size: .875rem; font-weight: 700; color: #111; margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrm-cart-item-sub { font-size: .72rem; color: #9ca3af; margin-bottom: .35rem; }
.wrm-cart-item-controls { display: flex; align-items: center; gap: .4rem; }
.wrm-qty-dec, .wrm-qty-inc {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.12);
  background: #fff; font-size: .85rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all .2s; color: #374151;
}
.wrm-qty-dec:hover, .wrm-qty-inc:hover { border-color: var(--wrm-primary); color: var(--wrm-primary); }
.wrm-cart-item-qty { font-size: .82rem; font-weight: 700; min-width: 18px; text-align: center; }
.wrm-cart-item-price-col { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.wrm-cart-item-price { font-size: .9rem; font-weight: 800; color: #111; white-space: nowrap; }
.wrm-cart-item-del {
  background: none; border: none; cursor: pointer; color: #d1d5db; font-size: .9rem;
  padding: .1rem; transition: color .2s; line-height: 1;
}
.wrm-cart-item-del:hover { color: #ef4444; }

/* Footer */
.wrm-cart-footer {
  border-top: 1px solid rgba(0,0,0,.08);
  padding: .9rem 1.25rem max(1rem, env(safe-area-inset-bottom));
  flex-shrink: 0; background: #fff;
}
.wrm-cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .9rem; color: #374151; margin-bottom: .75rem;
}
.wrm-cart-total { font-size: 1.2rem; font-weight: 900; color: #111; }

/* ── Selector entrega ────────────────────────────────── */
.wrm-delivery-selector {
  padding: .75rem 0;
  border-top: 1px solid rgba(0,0,0,.06);
  margin-bottom: .75rem;
}
.wrm-delivery-selector h4 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #6b7280; margin-bottom: .6rem;
}
.wrm-delivery-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.wrm-delivery-opt {
  border: 2px solid rgba(0,0,0,.1); border-radius: 12px;
  padding: .7rem .5rem; cursor: pointer; text-align: center;
  transition: all .2s; background: #fff; user-select: none;
}
.wrm-delivery-opt:hover { border-color: var(--wrm-primary); background: #f0fdf4; }
.wrm-delivery-opt.selected { border-color: var(--wrm-primary); background: #f0fdf4; }
.wrm-delivery-opt .icon { font-size: 1.4rem; display: block; margin-bottom: .25rem; }
.wrm-delivery-opt .label { font-size: .78rem; font-weight: 700; color: #1f2937; }
.wrm-delivery-opt .sublabel { font-size: .68rem; color: #9ca3af; margin-top: .1rem; }
.wrm-delivery-opt.selected .label { color: var(--wrm-primary); }

/* Confirmación recogida */
.wrm-pickup-confirm {
  display: none; align-items: flex-start; gap: .5rem;
  padding: .6rem .75rem;
  background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 10px;
  font-size: .8rem; color: #166534; margin-top: .6rem;
  animation: slideDown .3s ease;
}
.wrm-pickup-confirm.visible { display: flex; }

/* Form delivery */
.wrm-delivery-form-wrap {
  overflow: hidden;
  max-height: 0; opacity: 0;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}
.wrm-delivery-form-wrap.open { max-height: 700px; opacity: 1; }
.wrm-delivery-form { padding-top: .75rem; }
.wrm-delivery-form h4 {
  font-size: .78rem; font-weight: 700; color: #374151; margin-bottom: .6rem;
  display: flex; align-items: center; gap: .4rem;
}
.wrm-req-note { font-size: .65rem; color: #ef4444; font-weight: 400; margin-left: .2rem; }
.wrm-form-row { margin-bottom: .55rem; }
.wrm-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .55rem; }
.wrm-form-row label, .wrm-form-row-2 > div > label {
  font-size: .72rem; font-weight: 700; color: #374151;
  display: block; margin-bottom: .2rem;
}
.req { color: #ef4444; }
.wrm-form-row input, .wrm-form-row textarea,
.wrm-form-row-2 input {
  width: 100%; padding: .5rem .7rem;
  border: 1.5px solid #e5e7eb; border-radius: 8px;
  font-size: .8rem; font-family: var(--wrm-font);
  transition: border-color .2s, box-shadow .2s;
  background: #fff; color: #111;
}
.wrm-form-row input:focus, .wrm-form-row textarea:focus, .wrm-form-row-2 input:focus {
  outline: none; border-color: var(--wrm-primary);
  box-shadow: 0 0 0 3px rgba(37,211,102,.1);
}
.wrm-form-row input.error, .wrm-form-row-2 input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.wrm-form-row textarea { resize: none; min-height: 52px; }
.wrm-delivery-fee-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .75rem;
  background: #fefce8; border: 1px solid #fde68a; border-radius: 8px;
  font-size: .78rem; font-weight: 600; color: #92400e; margin-top: .35rem;
}

/* Botón WhatsApp */
.wrm-wa-order-btn {
  width: 100%; padding: .85rem; border: none; border-radius: 12px;
  font-size: .95rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  transition: all .25s;
  background: var(--wrm-primary); color: #fff;
  font-family: var(--wrm-font);
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
  margin-top: .75rem;
}
.wrm-wa-order-btn:disabled {
  background: #d1d5db; color: #9ca3af;
  cursor: not-allowed; box-shadow: none; transform: none !important;
}
.wrm-wa-order-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37,211,102,.45);
}

@keyframes slideDown { from{transform:translateY(-8px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes fadeIn    { from{opacity:0} to{opacity:1} }
@keyframes popIn     { 0%{transform:scale(.7);opacity:0} 80%{transform:scale(1.1)} 100%{transform:scale(1);opacity:1} }
