/* ==========================================================================
   GoEldo Riders - Panel operativo (riders-panel.html)
   Navbar + campanita, centro de pedidos, mapa/rastreo y vistas.
   Depende de las variables de css/styles.css
   ========================================================================== */

/* ---------- 1. Estructura ---------- */
.rp {
  min-height: 100vh;
  background: #F2F4EC;
  display: flex;
  flex-direction: column;
}
.rp-view {
  flex: 1 1 auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.rp-view[hidden] { display: none !important; }

/* ---------- 2. Navbar superior ---------- */
.rp-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #2E331E;
  color: #FFFFFF;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}
.rp-nav-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
}
.rp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #FFFFFF;
  flex: 0 0 auto;
}
.rp-brand img { height: 34px; width: auto; display: block; }
.rp-brand .go {
  font-size: 17px; font-weight: 900; letter-spacing: 0.4px; line-height: 1;
}
.rp-brand .eldo {
  font-size: 9.5px; font-weight: 800; letter-spacing: 2.4px; text-transform: uppercase;
  color: #8A9A5B; display: block; margin-top: 2px;
}
.rp-nav-spacer { flex: 1 1 auto; }

/* selector de vista */
.rp-seg {
  display: none;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.rp-seg button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.rp-seg button[aria-current="page"] {
  background: #8A9A5B;
  color: #FFFFFF;
}

/* ---------- 3. Campanita + badge ---------- */
.rp-bell {
  position: relative;
  flex: 0 0 auto;
}
.rp-bell-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.rp-bell-btn:hover { background: rgba(255, 255, 255, 0.16); }
.rp-bell-btn[aria-expanded="true"] { background: #8A9A5B; border-color: #8A9A5B; }
.rp-bell-btn .pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #8A9A5B;
  animation: rp-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes rp-pulse {
  0%   { transform: scale(1); opacity: 0.65; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
.rp-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #C4443A;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  border: 2px solid #2E331E;
  cursor: pointer;
}
.rp-badge[hidden] { display: none; }
.rp-badge.bump { animation: rp-bump 0.4s ease; }
@keyframes rp-bump {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.35); }
}

/* ---------- 4. Menú de notificaciones ---------- */
.rp-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(370px, calc(100vw - 24px));
  background: #FFFFFF;
  color: #2E331E;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  z-index: 70;
}
.rp-menu[hidden] { display: none !important; }
.rp-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #E3E7D5;
}
.rp-menu-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #5C673C;
}
.rp-menu-head button {
  border: 0;
  background: #EDF0E2;
  color: #5C673C;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.rp-menu-head button:hover { background: #E3E7D5; }
.rp-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(58vh, 420px);
  overflow-y: auto;
}
.rp-menu-empty {
  padding: 28px 18px;
  text-align: center;
  font-size: 12.5px;
  color: #8A9A5B;
}
.rp-note {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font-family: inherit;
  padding: 14px 16px;
  border-bottom: 1px solid #F0F2E8;
  cursor: pointer;
  position: relative;
}
.rp-note:last-child { border-bottom: 0; }
.rp-note:hover { background: #F7F9F1; }
.rp-note .ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #EDF0E2;
  color: #5C673C;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.rp-note.pending .ic { background: #8A9A5B; color: #FFFFFF; }
.rp-note .tx { min-width: 0; flex: 1 1 auto; }
.rp-note .tt {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #2E331E;
  line-height: 1.4;
  margin-bottom: 3px;
}
.rp-note .ds {
  display: block;
  font-size: 11.8px;
  color: #5C673C;
  line-height: 1.5;
}
.rp-note .dot {
  position: absolute;
  top: 18px; right: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #C4443A;
}
.rp-menu-foot {
  padding: 10px 16px;
  background: #F7F9F1;
  border-top: 1px solid #E3E7D5;
  font-size: 11px;
  color: #8A9A5B;
}

/* ---------- 5. Perfil ---------- */
.rp-perfil {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.rp-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid #8A9A5B;
  overflow: hidden;
  flex: 0 0 auto;
  background: #8A9A5B;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.rp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-avatar span { color: #FFFFFF; font-weight: 900; font-size: 15px; }
.rp-who { display: none; line-height: 1.25; }
.rp-who b { display: block; font-size: 12.5px; color: #FFFFFF; }
.rp-who span { display: block; font-size: 10.5px; color: #8A9A5B; }

/* ---------- 6. Cabecera de vista ---------- */
.rp-head { margin: 0 0 16px; }
.rp-head h1 {
  font-size: 22px;
  font-weight: 900;
  color: #2E331E;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.rp-head p {
  margin: 0;
  font-size: 13px;
  color: #5C673C;
  line-height: 1.55;
}

/* ---------- 7. Tarjeta de estado ---------- */
.rp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 18px;
}
.rp-stat {
  background: #FFFFFF;
  border: 1px solid #E3E7D5;
  border-radius: 14px;
  padding: 13px 14px;
}
.rp-stat b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #2E331E;
  line-height: 1.1;
}
.rp-stat span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #8A9A5B;
  margin-top: 4px;
}
.rp-stat.on b { color: #8A9A5B; }

/* ---------- 8. Centro de pedidos ---------- */
.rp-filter {
  display: flex;
  gap: 7px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding-bottom: 3px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rp-filter::-webkit-scrollbar { display: none; height: 0; }
.rp-filter button {
  border: 1.5px solid #D7DDC5;
  background: #FFFFFF;
  color: #5C673C;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}
.rp-filter button[aria-pressed="true"] {
  background: #8A9A5B;
  border-color: #8A9A5B;
  color: #FFFFFF;
}

.rp-orders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.rp-card {
  background: #FFFFFF;
  border: 1.5px solid #E3E7D5;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rp-in 0.32s ease both;
  position: relative;
}
@keyframes rp-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.rp-card.nuevo { border-color: #8A9A5B; box-shadow: 0 0 0 3px rgba(138, 154, 91, 0.14); }
.rp-card.flash { animation: rp-flash 1.5s ease; }
@keyframes rp-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(138, 154, 91, 0); }
  25%      { box-shadow: 0 0 0 5px rgba(138, 154, 91, 0.34); }
}
.rp-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 15px 10px;
}
.rp-logo {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: #EDF0E2;
  color: #5C673C;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 15px;
  flex: 0 0 auto;
  overflow: hidden;
}
.rp-logo img { width: 100%; height: 100%; object-fit: cover; }
.rp-card-id { flex: 1 1 auto; min-width: 0; }
.rp-card-id b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #2E331E;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.rp-card-id span {
  display: block;
  font-size: 11px;
  color: #8A9A5B;
  margin-top: 2px;
}
.rp-pay {
  flex: 0 0 auto;
  background: #2E331E;
  color: #D7DDC5;
  border-radius: 11px;
  padding: 7px 11px;
  text-align: center;
  line-height: 1.1;
}
.rp-pay b { display: block; font-size: 14.5px; font-weight: 900; color: #FFFFFF; }
.rp-pay span { display: block; font-size: 9px; letter-spacing: 0.4px; text-transform: uppercase; opacity: 0.75; margin-top: 2px; }

.rp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 15px 11px;
}
.rp-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 9px;
  background: #F0F2E8;
  color: #5C673C;
}
.rp-tag.d { background: #EDF0E2; }
.rp-tag.t { background: #2E331E; color: #D7DDC5; }
.rp-tag.hot { background: #8A9A5B; color: #FFFFFF; }

.rp-ruta {
  padding: 0 15px 12px;
  border-top: 1px solid #F0F2E8;
  padding-top: 11px;
  margin: 0 15px 12px;
  border-left: 0; border-right: 0; border-bottom: 0;
  display: flex;
  gap: 11px;
}
.rp-ruta .pts { display: flex; flex-direction: column; align-items: center; padding-top: 4px; flex: 0 0 auto; }
.rp-ruta .pts i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #8A9A5B;
  display: block;
  flex: 0 0 auto;
}
.rp-ruta .pts i.fin { background: #2E331E; }
.rp-ruta .pts .line {
  width: 2px;
  flex: 1 1 auto;
  min-height: 14px;
  background: #D7DDC5;
  margin: 3px 0;
}
.rp-ruta .tx { min-width: 0; }
.rp-ruta .tx div { margin-bottom: 7px; }
.rp-ruta .tx div:last-child { margin-bottom: 0; }
.rp-ruta .tx .lb {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #8A9A5B;
  margin-bottom: 1px;
}
.rp-ruta .tx .vl {
  display: block;
  font-size: 12.3px;
  color: #2E331E;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rp-acts {
  display: flex;
  gap: 8px;
  padding: 0 15px 15px;
  margin-top: auto;
}
.rp-btn {
  flex: 1 1 0;
  min-height: 46px;
  border-radius: 13px;
  border: 1.5px solid #D7DDC5;
  background: #FFFFFF;
  color: #5C673C;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.rp-btn:active { transform: translateY(1px); }
.rp-btn-ok {
  background: #8A9A5B;
  border-color: #8A9A5B;
  color: #FFFFFF;
}
.rp-btn-ok:hover { filter: brightness(0.94); }
.rp-btn-no:hover { background: #FDF3F2; border-color: #E3B0AA; color: #C4443A; }
.rp-btn-dark {
  background: #2E331E;
  border-color: #2E331E;
  color: #FFFFFF;
  width: 100%;
  min-height: 52px;
  font-size: 14.5px;
  margin-top: 14px;
}
.rp-btn-dark:hover { filter: brightness(1.18); }
.rp-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.rp-btn:focus-visible { outline: 3px solid rgba(138, 154, 91, 0.5); outline-offset: 2px; }

.rp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: #FFFFFF;
  border: 1.5px dashed #D7DDC5;
  border-radius: 18px;
}
.rp-empty .ic {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #EDF0E2;
  color: #8A9A5B;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.rp-empty b { display: block; font-size: 15px; color: #2E331E; margin-bottom: 5px; }
.rp-empty span { font-size: 12.5px; color: #8A9A5B; }

/* ---------- 9. Vista de mapa y rastreo ---------- */
.rp-map-wrap {
  position: relative;
  background: #FFFFFF;
  border: 1.5px solid #E3E7D5;
  border-radius: 20px;
  overflow: hidden;
}
.rp-map {
  width: 100%;
  height: min(60vh, 520px);
  min-height: 300px;
  background: #E8EBDF;
  z-index: 1;
}
.rp-map-top {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}
.rp-chip {
  background: #2E331E;
  color: #FFFFFF;
  border-radius: 13px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.rp-chip.ghost { background: rgba(46, 51, 30, 0.86); font-weight: 700; }
.rp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #C4443A;
  color: #FFFFFF;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.rp-live i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #FFFFFF;
  animation: rp-blink 1.1s ease-in-out infinite;
}
@keyframes rp-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.rp-chip .x {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.rp-chip .x:hover { background: rgba(255, 255, 255, 0.3); }

.rp-track {
  padding: 16px 18px 18px;
}
.rp-track h2 {
  font-size: 15px;
  font-weight: 900;
  color: #2E331E;
  margin: 0 0 4px;
}
.rp-track .sub { font-size: 12px; color: #8A9A5B; margin: 0 0 14px; }
.rp-prog {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.rp-prog .bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: #EDF0E2;
  overflow: hidden;
}
.rp-prog .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #8A9A5B;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.rp-prog .pct {
  font-size: 12.5px;
  font-weight: 800;
  color: #2E331E;
  flex: 0 0 auto;
  min-width: 42px;
  text-align: right;
}
.rp-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.rp-fact {
  background: #F7F9F1;
  border: 1px solid #E3E7D5;
  border-radius: 13px;
  padding: 11px 13px;
}
.rp-fact b {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #8A9A5B;
  margin-bottom: 3px;
}
.rp-fact span { display: block; font-size: 13px; font-weight: 700; color: #2E331E; overflow-wrap: anywhere; }
.rp-acts-2 { display: flex; gap: 8px; }
.rp-acts-2 .rp-btn { min-height: 48px; }

/* marcadores del mapa */
.rp-pin {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #8A9A5B;
  border: 3px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.rp-pin.fin { background: #2E331E; }
.rp-pin.me {
  background: #C4443A;
  animation: rp-me 1.4s ease-out infinite;
}
@keyframes rp-me {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 68, 58, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35); }
  60%      { box-shadow: 0 0 0 12px rgba(196, 68, 58, 0), 0 4px 12px rgba(0, 0, 0, 0.35); }
}
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { font-family: var(--font); font-size: 12.5px; margin: 11px 14px; }
.leaflet-popup-content b { color: #2E331E; }

/* ---------- 10. Vistas sin mapa activo ---------- */
.rp-idle {
  text-align: center;
  padding: 54px 22px;
  background: #FFFFFF;
  border: 1.5px dashed #D7DDC5;
  border-radius: 20px;
}
.rp-idle .ic {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: #EDF0E2;
  color: #8A9A5B;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 15px;
}
.rp-idle b { display: block; font-size: 16px; color: #2E331E; margin-bottom: 6px; }
.rp-idle span { display: block; font-size: 13px; color: #8A9A5B; max-width: 420px; margin: 0 auto; line-height: 1.6; }

/* ---------- 11. Toast ---------- */
.rp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  background: #2E331E;
  color: #FFFFFF;
  border-radius: 14px;
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: calc(100vw - 28px);
  text-align: center;
}
.rp-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.rp-toast.ok { background: #5C673C; }
.rp-toast.no { background: #C4443A; }

/* ---------- 12. Aviso de sistema ---------- */
.rp-alert {
  display: flex;
  gap: 11px;
  background: #2E331E;
  color: #D7DDC5;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 16px;
  align-items: flex-start;
}
.rp-alert .ic { flex: 0 0 auto; color: #8A9A5B; margin-top: 1px; }
.rp-alert b { display: block; color: #FFFFFF; font-size: 13.5px; margin-bottom: 3px; }
.rp-alert p { margin: 0 0 8px; font-size: 12.3px; line-height: 1.55; }
.rp-alert .rp-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 15px;
  font-size: 12px;
  background: #8A9A5B;
  border-color: #8A9A5B;
  color: #FFFFFF;
}
.rp-alert.done { background: #EDF0E2; }
.rp-alert.done .ic { color: #8A9A5B; }
.rp-alert.done b { color: #2E331E; }
.rp-alert.done p { color: #5C673C; margin-bottom: 0; }

/* ---------- 13. Escritorio ---------- */
@media (min-width: 720px) {
  .rp-seg { display: flex; }
  .rp-who { display: block; }
  .rp-view { padding: 24px 20px 40px; }
  .rp-head h1 { font-size: 26px; }
  .rp-stats { gap: 12px; }
  .rp-stat { padding: 16px 18px; }
  .rp-stat b { font-size: 23px; }
  .rp-orders { gap: 14px; }
  .rp-map { height: min(58vh, 560px); }
  .rp-toast { bottom: 30px; }
}
@media (min-width: 1000px) {
  .rp-view { padding: 28px 24px 48px; }
}

/* ---------- 14. Movil ---------- */
@media (max-width: 560px) {
  .rp-view { padding: 14px 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .rp-nav-in { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); gap: 9px; }
  .rp-brand img { height: 30px; }
  .rp-bell-btn, .rp-avatar { width: 38px; height: 38px; }
  .rp-head h1 { font-size: 19px; }
  .rp-head p { font-size: 12.3px; }
  .rp-stats { gap: 7px; }
  .rp-stat { padding: 11px 10px; border-radius: 12px; }
  .rp-stat b { font-size: 17px; }
  .rp-stat span { font-size: 9px; }
  .rp-orders { grid-template-columns: minmax(0, 1fr); }
  .rp-btn { min-height: 44px; font-size: 13px; }
  .rp-map { height: 52vh; min-height: 260px; }
  .rp-map-top { top: 8px; left: 8px; right: 8px; }
  .rp-chip { font-size: 11px; padding: 8px 11px; }
  .rp-facts { grid-template-columns: minmax(0, 1fr); }
  .rp-alert { flex-wrap: wrap; }
  /* en movil el menu se ancla al viewport para no salirse por la izquierda */
  .rp-menu {
    position: fixed;
    top: 60px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }
}
/* ---------- 15. Constancia imprimible ---------- */
.k-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 16px 46px;
}
.k-doc {
  background: #FFFFFF;
  border: 1.5px solid #E3E7D5;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.k-head {
  background: #2E331E;
  color: #FFFFFF;
  padding: 26px 28px;
  text-align: center;
}
.k-head .tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8A9A5B;
}
.k-head h1 { font-size: 24px; font-weight: 900; margin: 8px 0 4px; color: #FFFFFF; }
.k-head p { margin: 0; font-size: 12.5px; color: #A9AF96; }
.k-code {
  display: inline-block;
  margin: 18px 0 0;
  background: #8A9A5B;
  color: #FFFFFF;
  font-family: "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.4px;
  padding: 11px 22px;
  border-radius: 11px;
}
.k-body { padding: 24px 28px 28px; }
.k-sec {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #5C673C;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #E3E7D5;
  margin: 0 0 14px;
}
.k-dl {
  display: grid;
  grid-template-columns: minmax(0, 168px) minmax(0, 1fr);
  gap: 9px 16px;
  margin: 0 0 22px;
  font-size: 13px;
}
.k-dl dt { color: #5C673C; font-weight: 800; margin: 0; }
.k-dl dd { margin: 0; color: #2E331E; overflow-wrap: anywhere; }
.k-note {
  background: #F0F2E8;
  border-left: 3px solid #8A9A5B;
  border-radius: 0 12px 12px 0;
  padding: 14px 17px;
  font-size: 12.4px;
  line-height: 1.68;
  color: #3A4028;
  margin: 0 0 22px;
}
.k-acts { display: flex; gap: 9px; margin: 0 0 6px; }
.k-acts button,
.k-acts a {
  flex: 1 1 0;
  min-height: 48px;
  border-radius: 13px;
  border: 1.5px solid #8A9A5B;
  background: #8A9A5B;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 14px;
}
.k-acts .g { background: #FFFFFF; border-color: #D7DDC5; color: #5C673C; }
.k-acts button:hover, .k-acts a:hover { filter: brightness(0.95); }
.k-empty { text-align: center; padding: 46px 22px; }
.k-empty h2 { font-size: 18px; color: #2E331E; margin: 0 0 8px; }
.k-empty p { font-size: 13.5px; color: #8A9A5B; margin: 0 0 20px; line-height: 1.6; }
.k-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 13px;
  background: #8A9A5B;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.k-cta:hover { filter: brightness(0.95); }
.k-foot {
  border-top: 1px solid #E3E7D5;
  background: #FCFDF8;
  padding: 16px 28px;
  font-size: 11.5px;
  color: #8A9A5B;
  text-align: center;
  line-height: 1.7;
}
.k-foot a { color: #5C673C; font-weight: 700; }
@media (max-width: 600px) {
  .k-wrap { padding: 16px 12px 36px; }
  .k-head { padding: 22px 18px; }
  .k-head h1 { font-size: 19px; }
  .k-body { padding: 18px 16px 22px; }
  .k-dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; font-size: 12.6px; }
  .k-dl dt { margin-top: 11px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; }
  .k-code { font-size: 15px; letter-spacing: 1px; padding: 10px 16px; }
  .k-acts { flex-direction: column; }
}
@media print {
  body { background: #FFFFFF; }
  .k-wrap { max-width: none; padding: 0; }
  .k-acts { display: none; }
  .k-doc { border: none; border-radius: 0; box-shadow: none; }
  .k-head, .k-code { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Botón Conectar / Desconectar ---------- */
.rp-dispo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rp-dispo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid;
  font-size: 12.5px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}
.rp-dispo-btn.conectado {
  border-color: #8A9A5B;
  color: #2E5A2E;
}
.rp-dispo-btn.conectado .rp-dispo-dot {
  background: #8A9A5B;
  box-shadow: 0 0 0 6px rgba(138,154,176,.25);
}
.rp-dispo-btn.desconectado {
  border-color: #C9A227;
  color: #8A5A00;
}
.rp-dispo-btn.desconectado .rp-dispo-dot {
  background: #C9A227;
  box-shadow: 0 0 0 6px rgba(201,162,39,.25);
}
.rp-dispo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.rp-dispo-btn:active { transform: scale(0.96); }

@media (max-width: 768px) {
  .rp-dispo-btn { padding: 7px 12px; font-size: 12px; }
  .rp-dispo-btn span#rpDispoTxt { display: none; }
}

/* ---------- Touch target mínimo 44px (WCAG / Apple HIG) ---------- */
.rp-seg button,
.rp-bell-btn,
.rp-dispo-btn,
.rp-avatar,
.rp-btn,
.rp-fab {
  min-height: 44px !important;
  min-width: 44px !important;
}

/* Botones de acción del centro de pedidos */
.rp-acts .rp-btn {
  min-height: 48px;
  padding: 12px 16px;
  font-size: 13px;
}

/* Badge de notificaciones accesible */
.rp-badge {
  min-height: 32px;
  min-width: 32px;
  height: 32px;
  line-height: 32px;
}

/* ---------- Productos del pedido ---------- */
.rp-tag.p {
  background: #F3EFE5;
  color: #2E331E;
  border: 1px solid #C8C2B2;
  font-size: 11.5px;
  font-weight: 700;
}

/* Lista de productos en el drawer */
.rp-drawer-productos {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #EAE6D9;
}
.rp-drawer-productos-head {
  font-size: 12.5px;
  font-weight: 800;
  color: #5C673C;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.rp-drawer-productos-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rp-drawer-producto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 6px;
  background: #F9F7F2;
  border-radius: 10px;
  font-size: 12px;
}
.rp-drawer-producto-nombre {
  flex: 1;
  color: #2E331E;
}
.rp-drawer-producto-cant {
  margin: 0 10px;
  color: #8A9A5B;
  font-weight: 700;
}
.rp-drawer-producto-precio {
  color: #5C673C;
  font-weight: 700;
}
.rp-drawer-producto-vacio {
  color: #8A9374;
  font-style: italic;
  text-align: center;
  padding: 12px;
}

/* Responsive: en pantallas muy chicas, apilar info de producto */
@media (max-width: 320px) {
  .rp-drawer-producto-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .rp-drawer-producto-cant {
    margin: 0;
  }
}

/* ---------- Teléfono del comercio en tarjeta ---------- */
.rp-comercio-tel {
  margin: 6px 0;
  font-size: 12px;
  color: #5C673C;
}
.rp-comercio-tel-label {
  color: #8A9374;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 6px;
}

/* ---------- Mensajes rápidos en el drawer ---------- */
.rp-drawer-mensajes {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #EAE6D9;
}
.rp-drawer-mensajes-head {
  font-size: 12.5px;
  font-weight: 800;
  color: #5C673C;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.rp-drawer-mensajes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.rp-btn-mensaje {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  background: #F9F7F2;
  border: 1px solid #C8C2B2;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: #2E331E;
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  transition: background 0.15s ease;
}
.rp-btn-mensaje:active {
  background: #EAE6D9;
}
.rp-btn-mensaje:hover {
  background: #F3EFE5;
}

/* Responsive mensajes: 2 columnas en pantallas muy chicas */
@media (max-width: 320px) {
  .rp-drawer-mensajes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rp-btn-mensaje {
    font-size: 10px;
    padding: 7px 4px;
  }
}
/* ---------- Comprobante de entrega (modal) ---------- */
.rp-modal-comprobante {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 51, 30, 0.35);
}
.rp-modal-backdrop { position: absolute; inset: 0; }
.rp-modal-sheet {
  background: #FFFFFF;
  border-radius: 18px;
  width: min(92vw, 420px);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  position: relative;
  z-index: 910;
  animation: rp-sheet-up 0.25s ease;
}
@keyframes rp-sheet-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.rp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #EAE6D9;
}
.rp-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #2E331E;
}
.rp-modal-close {
  border: 0;
  background: transparent;
  color: #5C673C;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.rp-modal-body { padding: 14px 16px; }
.rp-cb-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F7F9F1;
  border: 1.5px solid #C8C2B2;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #2E331E;
}
.rp-cb-label input { display: none; }
.rp-cb-texto { flex: 1; }
.rp-modal-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #EAE6D9;
}
.rp-modal-foot .rp-btn { flex: 1; min-height: 44px; font-size: 13px; }
.rp-btn-ghost {
  background: #FFFFFF;
  border-color: #D7DDC5;
  color: #5C673C;
}
.rp-btn-ghost:hover { background: #F3EFE5; }
