/* =========================================================
   OneMobile — Timer global de propuesta
   Vuexy / legible / arrastrable
   20260817.2
========================================================= */

:root {
  --om-timer-primary: var(--om-primary, #3d67f2);
  --om-timer-primary-dark: var(--om-primary-dark, #3157d5);
  --om-timer-primary-rgb: 61, 103, 242;
  --om-timer-primary-soft: var(--om-primary-soft, #eef3ff);

  --om-timer-warning: var(--om-warning, #ff9f43);
  --om-timer-warning-rgb: 255, 159, 67;
  --om-timer-warning-soft: rgba(255, 159, 67, .10);

  --om-timer-danger: var(--om-danger, #ea5455);
  --om-timer-danger-rgb: 234, 84, 85;
  --om-timer-danger-soft: rgba(234, 84, 85, .10);

  --om-timer-title: var(--om-title, #243056);
  --om-timer-text: var(--om-text, #667085);
  --om-timer-muted: var(--om-muted, #8b95ad);
  --om-timer-border: #cfdcff;

  --om-timer-radius: .5rem;
  --om-timer-shadow: 0 .75rem 2rem rgba(36, 48, 86, .16);
}

.om-proposal-timer[hidden] {
  display: none !important;
}

/* =========================================================
   Contenedor
========================================================= */

.om-proposal-timer {
  position: fixed;
  right: max(1.15rem, env(safe-area-inset-right));
  bottom: max(1.15rem, env(safe-area-inset-bottom));
  z-index: 1090;

  display: grid;
  grid-template-columns: 1.35rem 3.1rem minmax(0, 1fr);
  align-items: center;
  column-gap: .82rem;

  width: min(22rem, calc(100vw - 2rem));
  min-height: 5.65rem;
  padding: .88rem .95rem .86rem .66rem;

  overflow: hidden;

  border: 1px solid var(--om-timer-border);
  border-radius: var(--om-timer-radius);

  background: rgba(255, 255, 255, .98);
  box-shadow: var(--om-timer-shadow);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  font-family: var(
    --bs-body-font-family,
    "Public Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif
  );
  font-synthesis: none;

  pointer-events: auto;
  user-select: none;
  touch-action: none;

  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease,
    background-color .2s ease;
}

.om-proposal-timer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--om-timer-primary-rgb), .065),
      transparent 8rem
    );
}

.om-proposal-timer > * {
  position: relative;
  z-index: 1;
}

/* =========================================================
   Línea inferior de estado
========================================================= */

.om-proposal-timer-accent {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;

  display: block;
  height: 4px;

  background: linear-gradient(
    90deg,
    var(--om-timer-primary),
    #8299ff
  );
}

/* =========================================================
   Handle
========================================================= */

.om-proposal-timer-drag {
  width: 1.3rem;
  height: 3.1rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: .375rem;

  background: transparent;
  color: #a1aac0;

  cursor: grab;
  appearance: none;
  -webkit-appearance: none;
  touch-action: none;
}

.om-proposal-timer-drag:hover {
  background: #f5f7fb;
  color: var(--om-timer-title);
}

.om-proposal-timer-drag:focus-visible {
  outline: 2px solid rgba(var(--om-timer-primary-rgb), .32);
  outline-offset: 2px;
}

.om-proposal-timer-drag:active,
.om-proposal-timer.is-dragging .om-proposal-timer-drag {
  cursor: grabbing;
}

.om-proposal-timer-drag svg {
  width: .78rem;
  height: 1.25rem;
  display: block;
  fill: currentColor;
}

.om-proposal-timer.is-dragging {
  transform: scale(1.01);
  box-shadow: 0 .8rem 2rem rgba(36, 48, 86, .17);
}

/* =========================================================
   Icono
========================================================= */

.om-proposal-timer-icon {
  width: 3.1rem;
  height: 3.1rem;

  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #cbd9ff;
  border-radius: .5rem;

  background: var(--om-timer-primary-soft);
  color: var(--om-timer-primary-dark);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.om-proposal-timer-icon svg {
  width: 1.48rem;
  height: 1.48rem;
  display: block;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   Texto
========================================================= */

.om-proposal-timer-copy {
  min-width: 0;
}

.om-proposal-timer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
}

.om-proposal-timer-copy small {
  min-width: 0;
  color: var(--om-timer-muted);

  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;

  white-space: normal;
}

.om-proposal-timer-copy strong {
  flex: 0 0 auto;

  color: var(--om-timer-title);

  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .025em;

  font-variant-numeric: tabular-nums;
}

.om-proposal-timer-copy > span {
  display: -webkit-box;
  overflow: hidden;

  margin-top: .38rem;

  color: var(--om-timer-text);

  font-size: .76rem;
  font-weight: 500;
  line-height: 1.35;

  white-space: normal;
  text-overflow: clip;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* =========================================================
   Warning
========================================================= */

.om-proposal-timer.is-warning {
  border-color: rgba(var(--om-timer-warning-rgb), .42);
  box-shadow: 0 .55rem 1.6rem rgba(var(--om-timer-warning-rgb), .11);
}

.om-proposal-timer.is-warning::before {
  background: radial-gradient(
    circle at 100% 0%,
    rgba(var(--om-timer-warning-rgb), .09),
    transparent 8rem
  );
}

.om-proposal-timer.is-warning .om-proposal-timer-icon {
  border-color: rgba(var(--om-timer-warning-rgb), .28);
  background: var(--om-timer-warning-soft);
  color: #c57924;
}

.om-proposal-timer.is-warning .om-proposal-timer-copy small {
  color: #a9651c;
}

.om-proposal-timer.is-warning .om-proposal-timer-accent {
  background: linear-gradient(90deg, #f5a33a, #ffc775);
}

/* =========================================================
   Danger
========================================================= */

.om-proposal-timer.is-danger {
  border-color: rgba(var(--om-timer-danger-rgb), .42);
  box-shadow: 0 .6rem 1.7rem rgba(var(--om-timer-danger-rgb), .12);
}

.om-proposal-timer.is-danger::before,
.om-proposal-timer.is-expired::before {
  background: radial-gradient(
    circle at 100% 0%,
    rgba(var(--om-timer-danger-rgb), .08),
    transparent 8rem
  );
}

.om-proposal-timer.is-danger .om-proposal-timer-icon,
.om-proposal-timer.is-expired .om-proposal-timer-icon {
  border-color: rgba(var(--om-timer-danger-rgb), .28);
  background: var(--om-timer-danger-soft);
  color: var(--om-timer-danger);
}

.om-proposal-timer.is-danger .om-proposal-timer-copy small,
.om-proposal-timer.is-danger .om-proposal-timer-copy strong,
.om-proposal-timer.is-expired .om-proposal-timer-copy small,
.om-proposal-timer.is-expired .om-proposal-timer-copy strong {
  color: var(--om-timer-danger);
}

.om-proposal-timer.is-danger .om-proposal-timer-accent,
.om-proposal-timer.is-expired .om-proposal-timer-accent {
  background: linear-gradient(90deg, #ea5455, #ff8b8c);
}

.om-proposal-timer.is-danger .om-proposal-timer-icon {
  animation: omTimerDangerPulse 1.5s ease-in-out infinite;
}

/* =========================================================
   Expirado
========================================================= */

.om-proposal-timer.is-expired {
  border-color: rgba(var(--om-timer-danger-rgb), .42);
  background: rgba(255, 255, 255, .99);
}

/* =========================================================
   Desktop amplio
========================================================= */

@media (min-width: 1400px) {
  .om-proposal-timer {
    right: max(1.35rem, env(safe-area-inset-right));
    bottom: max(1.35rem, env(safe-area-inset-bottom));
    width: 22.5rem;
  }
}

/* =========================================================
   Laptop / tablet horizontal
========================================================= */

@media (max-width: 1199.98px) {
  .om-proposal-timer {
    right: max(.85rem, env(safe-area-inset-right));
    bottom: max(.85rem, env(safe-area-inset-bottom));

    width: min(20rem, calc(100vw - 1.7rem));
    min-height: 5.15rem;

    padding: .78rem .82rem .76rem .58rem;
  }

  .om-proposal-timer-icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  .om-proposal-timer-copy strong {
    font-size: 1.4rem;
  }
}

/* =========================================================
   Tablet vertical
========================================================= */

@media (max-width: 767.98px) {
  .om-proposal-timer {
    top: calc(4.5rem + env(safe-area-inset-top));
    right: max(.75rem, env(safe-area-inset-right));
    bottom: auto;

    width: min(19.5rem, calc(100vw - 1.5rem));
  }
}

/* =========================================================
   Móvil
========================================================= */

@media (max-width: 575.98px) {
  .om-proposal-timer {
    top: calc(4.25rem + env(safe-area-inset-top));
    right: max(.6rem, env(safe-area-inset-right));
    bottom: auto;

    grid-template-columns: 1rem 2.5rem minmax(0, 1fr);
    column-gap: .55rem;

    width: min(18.5rem, calc(100vw - 1.2rem));
    min-height: 4.55rem;

    padding: .64rem .7rem .62rem .44rem;

    box-shadow: 0 .4rem 1.2rem rgba(36, 48, 86, .11);
  }

  .om-proposal-timer-drag {
    width: 1rem;
    height: 2.6rem;
  }

  .om-proposal-timer-drag svg {
    width: .66rem;
  }

  .om-proposal-timer-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .om-proposal-timer-icon svg {
    width: 1.15rem;
    height: 1.15rem;
  }

  .om-proposal-timer-copy small {
    font-size: .69rem;
  }

  .om-proposal-timer-copy strong {
    font-size: 1.18rem;
  }

  .om-proposal-timer-copy > span {
    margin-top: .22rem;
    font-size: .68rem;
    line-height: 1.3;
  }
}

/* =========================================================
   Teléfonos pequeños
========================================================= */

@media (max-width: 374.98px) {
  .om-proposal-timer {
    right: .45rem;
    width: calc(100vw - .9rem);
  }

  .om-proposal-timer-heading {
    gap: .4rem;
  }
}

/* =========================================================
   Poca altura / horizontal
========================================================= */

@media (max-height: 520px) and (max-width: 991.98px) {
  .om-proposal-timer {
    top: auto;
    right: max(.55rem, env(safe-area-inset-right));
    bottom: max(.55rem, env(safe-area-inset-bottom));
  }
}

/* =========================================================
   Motion
========================================================= */

@keyframes omTimerDangerPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .om-proposal-timer,
  .om-proposal-timer *,
  .om-proposal-timer *::before,
  .om-proposal-timer *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Solo el handle necesita interacción directa. */
.om-proposal-timer-icon,
.om-proposal-timer-copy,
.om-proposal-timer-accent {
  pointer-events: none;
}


/* =========================================================
   Presencia visual adicional · 20260817.2
========================================================= */
.om-proposal-timer {
  outline: 1px solid rgba(var(--om-timer-primary-rgb), .035);
  outline-offset: 1px;
}

.om-proposal-timer:hover {
  border-color: rgba(var(--om-timer-primary-rgb), .34);
  box-shadow: 0 .9rem 2.25rem rgba(36, 48, 86, .19);
}

.om-proposal-timer-copy small {
  color: #69748f;
}

.om-proposal-timer-copy > span {
  color: #596681;
}

.om-proposal-timer-icon {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    0 .3rem .75rem rgba(var(--om-timer-primary-rgb), .08);
}

@media (max-width: 575.98px) {
  .om-proposal-timer-copy > span {
    -webkit-line-clamp: 2;
  }
}
