/* metas-sheet.css — "Metas de la semana" premium BOTTOM SHEET (Cliente Frecuente · Fase 1).
   Abierto desde la tarjeta de lealtad (.lc-metas) en index.html y shop-products.html.
   Markup inyectado por js/metas-sheet.js. Estética alineada con la loyalty card (.lc-*). */

.ms-overlay {
  position: fixed;
  inset: 0;
  z-index: 10072;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(18, 24, 20, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.ms-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.ms-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: #f4f8ef;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.2, 0.85, 0.25, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ms-overlay.open .ms-sheet {
  transform: translateY(0);
}

/* Handle (grabber) flotando SOBRE el verde, sin banda blanca arriba */
.ms-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.6);
  z-index: 3;
}

/* ── Header: gradiente verde premium, llega hasta el borde superior redondeado ── */
.ms-hero {
  position: relative;
  overflow: hidden;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  background: linear-gradient(150deg, #2f7d12 0%, #4d9c14 48%, #6cb01a 100%);
  color: #fff;
  padding: 28px 20px 18px;
  flex-shrink: 0;
}
.ms-hero-glow {
  position: absolute;
  top: -60px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 90, 0.22), transparent 70%);
  pointer-events: none;
}
.ms-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ms-hero-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.ms-hero-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  margin-top: 2px;
}
.ms-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  font-weight: 700;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ms-countdown i {
  font-size: 12px;
}
.ms-countdown.is-urgent {
  background: #ffce54;
  color: #5b3b00;
}

/* ── Scrollable body ── */
.ms-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 18px;
}

/* ── Footer fijo (CTA siempre visible, sin scrollear) ── */
.ms-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #f4f8ef;
  border-top: 1px solid #e7eede;
}
.ms-footer:empty { display: none; }
.ms-footer .ms-cta { margin-top: 0; }

/* ── Banner del premio (anzuelo) ── */
.ms-reward {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7e6 0%, #fdeccb 100%);
  border: 1.5px solid #f6d999;
  margin-bottom: 16px;
}
.ms-reward-ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  background: linear-gradient(180deg, #ffc24d, #f59e0b);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
}
.ms-reward-txt {
  min-width: 0;
}
.ms-reward-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b07a12;
}
.ms-reward-name {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #1f2a24;
  line-height: 1.2;
}

/* ── Lista de metas ── */
.ms-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7b8a82;
  margin: 4px 2px 10px;
}
.ms-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ms-mission {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border-radius: 18px;
  background: #fff;
  border: 1.5px solid #e7eede;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ms-mission.is-done {
  background: #f1f9e8;
  border-color: #bfe39a;
}
.ms-mission-ic {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #eef5e6;
}
.ms-mission.is-done .ms-mission-ic {
  background: #dcf0c6;
}
.ms-mission-body {
  flex: 1;
  min-width: 0;
}
.ms-mission-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #1f2a24;
}
.ms-mission-desc {
  font-size: 12.5px;
  color: #7b8a82;
  margin-top: 2px;
  line-height: 1.35;
}
.ms-check {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px dashed #cdd8c8;
  color: transparent;
}
.ms-mission.is-done .ms-check {
  background: #4d9c14;
  border: none;
  color: #fff;
  box-shadow: 0 4px 10px rgba(77, 156, 20, 0.4);
}

/* ── Estado de éxito (las 3 completadas) ── */
.ms-success {
  text-align: center;
  padding: 17px 18px;
  border-radius: 20px;
  background: linear-gradient(150deg, #2f7d12 0%, #4d9c14 55%, #6cb01a 100%);
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 16px 36px -16px rgba(45, 110, 18, 0.6);
}
.ms-success-emoji {
  font-size: 32px;
  line-height: 1;
}
.ms-success-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 18px;
  margin-top: 7px;
}
.ms-success-sub {
  font-size: 12.5px;
  opacity: 0.92;
  margin-top: 5px;
  line-height: 1.35;
}
.ms-success-reward {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-size: 13px;
  font-weight: 700;
}
.ms-success-reward b { font-weight: 800; }
.ms-list.is-locked {
  opacity: 0.7;
}

/* ── CTA ── */
.ms-cta {
  width: 100%;
  margin-top: 18px;
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 15px;
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #4d9c14, #6cb01a);
  box-shadow: 0 10px 22px -10px rgba(77, 156, 20, 0.7);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}
.ms-cta:active {
  transform: scale(0.985);
}
.ms-cta.is-ghost {
  background: #fff;
  color: #4d7c0f;
  border: 1.5px solid #d7e6c4;
  box-shadow: none;
}

/* ── Estados loading / error ── */
.ms-state {
  text-align: center;
  padding: 40px 20px;
  color: #7b8a82;
}
.ms-state i {
  font-size: 30px;
  color: #6ca50a;
}
.ms-state p {
  margin-top: 12px;
  font-size: 14px;
}
.ms-spin {
  animation: ms-spin 0.9s linear infinite;
}
@keyframes ms-spin {
  to { transform: rotate(360deg); }
}

/* ════════════════ Entry point dentro de la loyalty card (.lc-card) ════════════════ */
.lc-metas {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 15px;
  padding: 11px 13px;
  text-align: left;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.2s ease;
}
.lc-metas:active { transform: scale(0.985); }
.lc-metas-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  background: linear-gradient(155deg, #ff8a3d 0%, #f5515f 100%);
  box-shadow: 0 6px 14px rgba(245, 81, 95, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.lc-metas-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-metas-tt { font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 14px; }
.lc-metas-sub { font-size: 11.5px; opacity: 0.88; margin-top: 1px; }
.lc-metas-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 13px;
}
.lc-metas-count {
  background: #fff;
  color: #2f7d12;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
}
.lc-metas.is-complete .lc-metas-count { background: #ffce54; color: #5b3b00; }

/* ════════════════ Banner "¡Ganaste tus metas!" en la sección Cliente Frecuente ════════════════ */
.metas-win {
  margin: 0 15px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2f7d12 0%, #4d9c14 55%, #6cb01a 100%);
  color: #fff;
  box-shadow: 0 12px 28px -14px rgba(45, 110, 18, 0.7);
}
.metas-win-ic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.metas-win-body { flex: 1; min-width: 0; }
.metas-win-tt { font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 14.5px; }
.metas-win-sub { font-size: 12px; opacity: 0.92; margin-top: 2px; line-height: 1.3; }
.metas-win-x {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
