/* Overlay */
#aliwppop-overlay {
  display: none;
  position: fixed;
  z-index: 998;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 40, 80, 0.33);
  transition: opacity .3s;
}

/* ==================== POPUP ==================== */
/* ==================== POPUP ==================== */
#aliwppop-popup {
  display: none;
  position: fixed;
  right: 10px;
  bottom: 10px;
  width: 250px;            /* largura base – o JS pode sobrescrever */
  max-width: 94vw;
  background: var(--aliwppop-bg, #fff);
  color: var(--aliwppop-text, #222);
  box-shadow: 0 8px 32px rgba(40,40,60,.25), 0 1.5px 10px rgba(40,40,60,.08);
  z-index: 9999;
  border-radius: var(--aliwppop-radius, 5px);
  padding: 0;
  font-family: inherit;

  /* --- nova animação sutil --- */
  opacity: 0;
  transform: translate3d(0, 6px, 0) scale(.985);
  transition:
    opacity .26s ease,
    transform .26s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}

/* estado aberto: independente da posição (center, tr, br, etc.) */
#aliwppop-popup.aliwppop-open {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* durante fechamento forçado (para evitar brilho/ghost) */
#aliwppop-popup.aliwppop-closing {
  pointer-events: none;
}

/*.aliwppop-popup-outer { padding: 24px 24px 12px 24px; }*/
.aliwppop-popup-outer {padding: 12px 12px 12px 12px;border:1px solid #d5d5d5}
.aliwppop-content {
  position: relative;
  background: none;
  color: inherit;
  box-shadow: none;
  padding: 0;
}

.aliwppop-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: inherit; /* cor vem do JS (title_color) */
}

.aliwppop-desc {
  font-size: 13px;
  margin-bottom: 18px;
  color: inherit; /* o JS ajusta desc_color */
}

/* ==================== BOTÃO ==================== */
.aliwppop-btn {
  display: block;
  width: 100%;
  background: var(--aliwppop-btn-bg, #2196f3);
  color: var(--aliwppop-btn-color, #fff);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  padding: 5px 0;
  border-radius: 5px;
  margin-top: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.4,0,.2,1),
              box-shadow .22s cubic-bezier(.4,0,.2,1),
              filter .18s;
  box-shadow: 0 3px 18px rgba(0,0,0,.12);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.aliwppop-btn:hover,
.aliwppop-btn:focus {
  filter: brightness(1.05);
  transform: scale(1.035) translateY(-1px);
  box-shadow: 0 6px 26px rgba(0,0,0,.18);
}

/* opcional: varredura suave de luz, respeitando a cor atual */
.aliwppop-btn::after {
  content: '';
  position: absolute;
  left: -60%;
  top: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%,
                                      rgba(255,255,255,.18) 55%,
                                      rgba(255,255,255,0) 100%);
  transition: left .4s cubic-bezier(.3,.8,.7,1.1);
  pointer-events: none;
}
.aliwppop-btn:hover::after { left: 105%; }

/* ==================== FECHAMENTO ==================== */
.aliwppop-close {
  position: absolute;
  top: -25px;
  right: -24px;
  background: var(--aliwppop-x-bg, #fff);
  color: var(--aliwppop-x-color, #333);
  border: none;
  border-radius: var(--aliwppop-x-radius, 0);
  width: 35px;
  height: 35px;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: background .16s, color .16s;
  z-index: 101;
}
.aliwppop-close:hover {
  filter: brightness(1.05);
}

/* mini loader (se for usar) */
.aliwppop-loader {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.76);
  z-index: 9000;
}

/* ==================== RESPONSIVO (MOBILE) ==================== */
@media (max-width: 600px) {
  #aliwppop-popup {
    left: 0; right: 0; bottom: 18px;
    width: 98vw; max-width: 97vw;
    border-radius: 18px;
    margin: 0 auto;
    box-shadow: 0 4px 28px rgba(0,0,0,.11);
    padding: 0;
  }
  .aliwppop-popup-outer { padding: 0 !important; }

  .aliwppop-content.aliwppop-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 10px 13px 6px;
    background: var(--aliwppop-bg, #fff);
    border-radius: 4px;
    box-shadow: none;
    min-height: 96px;
    position: relative;
    border: 1px solid #ededed;
  }

  .aliwppop-card-wrap {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .aliwppop-thumb {
    width: 64px; min-width: 64px; height: 64px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 12px 0 0;
    background: #eaeaea;
    box-shadow: 0 2px 10px rgba(180,180,180,.08);
    display: block;
  }

  .aliwppop-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding-left: 15PX;
    PADDING-TOP: 10PX;
  }

  .aliwppop-title {
    font-size: 1.01rem;
    font-weight: 700;
    color: inherit;
    margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .aliwppop-desc {
    font-size: .91rem;
    color: inherit;
    margin-bottom: 8px;
    line-height: 1.28;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 98%;
  }

  .aliwppop-btn {
    border-radius: 11px;
    font-size: 1.06rem;
    font-weight: 600;
    padding: 8px 0;
    text-align: center;
    margin-top: 2px;
    width: 100%;
    max-width: 164px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
  }

  .aliwppop-footer {
    margin: 4px 0 0 0;
    font-size: .85rem;
    color: #aaa;
    text-align: center;
  }

  .aliwppop-close {
    top: -1px; right: -1px;
    width: 26px; height: 26px;
    font-size: 1.1rem;
    border-radius: 0;
    background: var(--aliwppop-x-bg, #fff);
    box-shadow: 0 1px 4px rgba(80,80,80,.11);
  }
}

/* Thumb padrão (desktop) */
.aliwppop-thumb {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 16px;
  display: block;
  background: #eaeaea;
}

/* Permite <a class="aliwppop-btn classe-danilo"> sem sublinhado */
a.aliwppop-btn { text-decoration: none; }

/* ===== Mobile refinado: título + descrição + botão ===== */
@media (max-width:600px){

  #aliwppop-popup{
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 18px !important;

    width: 340px !important;
    max-width: 92vw !important;

    background: var(--aliwppop-bg, #fff) !important;
    color: var(--aliwppop-text, #222) !important;

    border: 1px solid rgba(0,0,0,.08) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.12) !important;
    overflow: hidden !important;
  }

  .aliwppop-popup-outer{ padding: 12px !important; }

  /* Layout vertical */
  .aliwppop-content.aliwppop-card{
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 0 !important;
    background: transparent !important;
  }

  /* Linha superior: thumb + textos + X */
  .aliwppop-card-wrap{
    display: grid !important;
    grid-template-columns: 56px 1fr 20px !important;
    gap: 10px !important;
    align-items: flex-start !important;
    width: 100% !important;
  }

  .aliwppop-thumb{
    width: 56px !important;
    height: 56px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    margin-top: 2px !important;
  }

  .aliwppop-title{
    margin: 0 0 4px 0 !important;
    font-weight: 600 !important;            /* menos pesado */
    font-size: .95rem !important;
    line-height: 1.25 !important;
    color: inherit !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .aliwppop-desc{
    margin: 0 !important;
    font-size: .88rem !important;
    line-height: 1.3 !important;
    color: rgba(0,0,0,.75) !important;      /* cor legível e suave */
    opacity: 1 !important;

    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;      /* até 2 linhas */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .aliwppop-close{
    justify-self: end !important;
    align-self: start !important;
    width: 20px !important; height: 20px !important;
    font-size: 14px !important;
    background: transparent !important;
    color: #d65a5a !important;
    border: 0 !important;
  }

  /* Botão centralizado e alinhado */
  .aliwppop-actions{
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(0,0,0,.06) !important;
  }

  .aliwppop-btn{
    text-transform: uppercase !important;
    font-weight: 700 !important;
    font-size: .93rem !important;
    letter-spacing: .3px !important;
    MARGIN-TOP: 10px;
    padding: 4px 18px !important;
    width: 70% !important;
    max-width: 200px !important;
    text-align: center !important;

    border-radius: 7px !important;
    background: var(--aliwppop-btn-bg, #111) !important;
    color: var(--aliwppop-btn-color, #fff) !important;

    box-shadow: 0 2px 10px rgba(0,0,0,.12) !important;
    transition: transform .12s ease, box-shadow .12s ease !important;
  }
  .aliwppop-btn:hover{
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.16) !important;
  }
}

