/* ==========================================================
   ML-WARNING.CSS — Modal de aviso do Mercado Livre
   Glass fosco claro — palheta da marca, sem neon
   ========================================================== */

/* ----------------------------------------------------------
   BACKDROP — desfoque forte, escurece levemente o fundo
   ---------------------------------------------------------- */
#mlWarningModal::backdrop {
  background: rgba(12, 20, 44, 0.50);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

/* ----------------------------------------------------------
   MODAL SHELL — vidro fosco claro
   ---------------------------------------------------------- */
#mlWarningModal {
  border: none;
  border-radius: 28px;
  padding: 0;
  max-width: min(460px, calc(100vw - 32px));
  width: 100%;
  overflow: hidden;
  outline: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;

  /* GLASS CLARO */
  background: rgba(235, 238, 245, 0.55);
  backdrop-filter: blur(40px) saturate(180%) brightness(1.12);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.12);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.80) inset,
    0 32px 72px rgba(10, 20, 50, 0.22),
    0 8px 24px rgba(10, 20, 50, 0.12);
}

/* ----------------------------------------------------------
   ANIMAÇÃO
   ---------------------------------------------------------- */
@keyframes mlModalIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 20px)) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

#mlWarningModal[open] {
  animation: mlModalIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ----------------------------------------------------------
   SURFACE
   ---------------------------------------------------------- */
.ml-warning__surface {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ----------------------------------------------------------
   HEADER
   ---------------------------------------------------------- */
.ml-warning__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 28px 22px;
  border-bottom: 1px solid rgba(21, 57, 121, 0.09);
}

.ml-warning__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 80, 0, 0.12);
  border: 1px solid rgba(184, 80, 0, 0.24);
  position: relative;
}

.ml-warning__icon::before {
  content: "!";
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #b85000;
}

.ml-warning__pretitle {
  margin: 0 0 4px;
  font-family: "Outfit", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b85000;
}

.ml-warning__title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0e1828;
  line-height: 1.2;
}

/* ----------------------------------------------------------
   BODY
   ---------------------------------------------------------- */
.ml-warning__body {
  padding: 22px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ml-warning__desc {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.65;
  color: rgba(14, 24, 40, 0.62);
  font-family: "Roboto", sans-serif;
}

.ml-warning__desc strong {
  color: #0e1828;
  font-weight: 600;
}

/* Comparação — painéis de vidro dentro do vidro */
.ml-warning__compare {
  display: flex;
  gap: 10px;
}

.ml-warning__compare-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.70);
  box-shadow: 0 2px 8px rgba(10, 20, 50, 0.06);
}

.ml-warning__compare-item--accent {
  background: rgba(184, 80, 0, 0.08);
  border: 1px solid rgba(184, 80, 0, 0.22);
}

.ml-warning__compare-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(14, 24, 40, 0.38);
}

.ml-warning__compare-item--accent .ml-warning__compare-label {
  color: #b85000;
}

.ml-warning__compare-value {
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0e1828;
  letter-spacing: -0.02em;
}

.ml-warning__compare-note {
  font-size: 0.70rem;
  color: rgba(14, 24, 40, 0.42);
  font-family: "Roboto", sans-serif;
}

.ml-warning__compare-item--accent .ml-warning__compare-note {
  color: rgba(184, 80, 0, 0.70);
}

/* ----------------------------------------------------------
   ACTIONS — barra inferior frosted separada
   ---------------------------------------------------------- */
.ml-warning__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 20px;
  margin: 0 14px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 10px rgba(10, 20, 50, 0.07);
}

.ml-warning__btn {
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 13px;
  font-family: "Outfit", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.005em;
  transition:
    transform 200ms cubic-bezier(0.34, 1.26, 0.64, 1),
    box-shadow 200ms ease,
    background 180ms ease,
    opacity 180ms ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

/* Primário — site com a cor da marca */
.ml-warning__btn--primary {
  background: #b85000;
  color: #ffffff;
  border-color: transparent;
  box-shadow:
    0 4px 16px rgba(184, 80, 0, 0.28),
    0 1px 4px rgba(184, 80, 0, 0.20);
}

.ml-warning__btn--primary:hover {
  background: #9e4500;
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(184, 80, 0, 0.32),
    0 2px 6px rgba(184, 80, 0, 0.22);
}

.ml-warning__btn--primary:active {
  transform: translateY(0);
}

/* Secundário — amarelo ML, desativado até o contador zerar */
.ml-warning__btn--secondary {
  background: #FFE600;
  color: #333333;
  border-color: #FFE600;
  box-shadow: 0 3px 12px rgba(255, 230, 0, 0.22);
}

.ml-warning__btn--secondary::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url('/assets/img/image.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.ml-warning__btn--secondary:not(:disabled):hover {
  background: #f0d800;
  color: #333333;
  border-color: #f0d800;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 230, 0, 0.40);
}

.ml-warning__btn--secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* Contador */
.ml-warning__countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 100px;
  background: rgba(21, 57, 121, 0.10);
  border: 1px solid rgba(21, 57, 121, 0.14);
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(14, 24, 40, 0.42);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ml-warning__btn--secondary:not(:disabled) .ml-warning__countdown {
  display: none;
}

/* ----------------------------------------------------------
   MOBILE — bottom sheet
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  #mlWarningModal {
    border-radius: 24px;
    top: 50%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    max-width: calc(100vw - 32px);
    width: 100%;
    margin: 0;
    position: fixed;
  }

  @keyframes mlModalIn {
    from {
      opacity: 0;
      transform: translate(-50%, calc(-50% + 20px)) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  #mlWarningModal[open] {
    animation: mlModalIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  /* Remove pill handle (não é mais bottom sheet) */
  .ml-warning__surface::before {
    display: none;
  }

  .ml-warning__header,
  .ml-warning__body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .ml-warning__actions {
    margin: 0 10px 12px;
  }
}
