/* =====================================================================
   PTEKNO - Popup promo v3 (storefront)
   Markup: app/Views/partials/promo_popup.php (root .ppv3)
   Perilaku: public/assets/js/promo-popup.js (tidak berubah)
   Desktop: modal tengah 2 bagian (promo + produk pilihan).
   < 640px: bottom sheet, produk pilihan bergeser horizontal.
   promo-popup.css lama tetap dipakai pratinjau di CMS.
   ===================================================================== */
.ppv3 {
  --pp-navy: #0B2E4F;
  --pp-navy-h: #12406B;
  --pp-orange: #F5A623;
  --pp-orange-t: #B05A00;
  --pp-neutral: #F4F6F8;
  --pp-rule: #DCE2E8;
  --pp-t2: #3E5269;
  --pp-t3: #5E6E80;
  --pp-link: #1667C5;

  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--pp-navy);
}
.ppv3[hidden] { display: none; }
html.promo-lock, html.promo-lock body { overflow: hidden; }

.ppv3__backdrop { position: absolute; inset: 0; background: rgba(7, 32, 57, .62); opacity: 0; transition: opacity .2s ease-out; }
.ppv3.is-open .ppv3__backdrop { opacity: 1; }

.ppv3__card {
  position: relative; width: 100%; max-width: 760px; max-height: calc(100dvh - 48px);
  overflow: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 8px; box-shadow: 0 28px 70px -20px rgba(7, 32, 57, .6);
  opacity: 0; transform: translateY(14px);
  transition: opacity .2s ease-out, transform .28s cubic-bezier(.2, .8, .2, 1);
}
.ppv3__card:focus { outline: none; }
.ppv3.is-open .ppv3__card { opacity: 1; transform: none; }

.ppv3__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: #fff; color: var(--pp-navy); cursor: pointer;
  box-shadow: 0 2px 10px rgba(7, 32, 57, .18);
}
.ppv3__close:hover { background: var(--pp-neutral); }
.ppv3__close:focus-visible { outline: 2px solid var(--pp-link); outline-offset: 2px; }

/* ---------- bagian promo ---------- */
.ppv3__hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 20px;
  padding: 30px 32px 24px; background: #fff;
}
.ppv3__hero--noimg { grid-template-columns: minmax(0, 1fr); }
.ppv3__chip {
  display: inline-block; margin: 0; padding: 4px 9px; border-radius: 3px;
  background: var(--pp-orange); color: var(--pp-navy);
  font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.ppv3__title { margin: 12px 0 0; font-size: 34px; line-height: 1.05; font-weight: 800; font-stretch: 88%; letter-spacing: -.3px; text-wrap: balance; }
.ppv3__desc { margin: 10px 0 0; max-width: 34ch; font-size: 15px; line-height: 1.45; color: var(--pp-t2); }

.ppv3__cd { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--pp-t2); }
.ppv3__cdnum { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.ppv3__cdnum b { min-width: 30px; padding: 4px 0; border-radius: 3px; background: var(--pp-navy); color: #fff; text-align: center; font-size: 15px; font-weight: 800; }
.ppv3__cdnum i { font-style: normal; font-weight: 800; }

.ppv3__voucher { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; font-size: 13px; color: var(--pp-t2); }
.ppv3__voucher b { padding: 5px 10px; border: 1px dashed var(--pp-navy); border-radius: 3px; color: var(--pp-navy); font-size: 15px; letter-spacing: .06em; }
.ppv3__voucher button { border: 0; background: none; color: var(--pp-link); font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; padding: 6px 0; }
.ppv3__voucher button.is-done { color: #1C7C4A; }

.ppv3__cta {
  display: inline-flex; align-items: center; justify-content: center; margin-top: 18px;
  height: 46px; padding: 0 24px; border-radius: 4px;
  background: var(--pp-navy); color: #fff; font-size: 15px; font-weight: 700; text-decoration: none;
}
.ppv3__cta:hover { background: var(--pp-navy-h); color: #fff; }
.ppv3__cta:focus-visible { outline: 2px solid var(--pp-link); outline-offset: 2px; }

.ppv3__media { align-self: stretch; display: grid; place-items: center; min-height: 200px; }
.ppv3__media img { width: 100%; max-height: 240px; object-fit: contain; display: block; }

/* ---------- jaminan ---------- */
.ppv3__trust {
  list-style: none; margin: 0; padding: 12px 32px; display: flex; flex-wrap: wrap; gap: 8px 28px;
  border-top: 1px solid var(--pp-rule); border-bottom: 1px solid var(--pp-rule);
  font-size: 13px; color: var(--pp-t2);
}
.ppv3__trust li { display: inline-flex; align-items: center; gap: 8px; }
.ppv3__trust svg { color: var(--pp-navy); flex: none; }

/* ---------- produk pilihan ---------- */
.ppv3__picks { padding: 18px 24px 24px; }
.ppv3__pickhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ppv3__pickhead h3 { margin: 0; font-size: 17px; font-weight: 700; }
.ppv3__pickhead a { font-size: 13px; font-weight: 600; color: var(--pp-link); text-decoration: none; }
.ppv3__pickhead a:hover { text-decoration: underline; }

.ppv3__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ppv3__item { display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--pp-rule); border-radius: 6px; background: #fff; }
.ppv3__item:hover { border-color: var(--pp-navy); }
.ppv3__thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: #fff; text-decoration: none; }
.ppv3__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ppv3__thumb span { font-size: 12px; color: var(--pp-t3); }
.ppv3__off {
  position: absolute; top: 0; left: 0; padding: 2px 6px; border-radius: 3px;
  background: var(--pp-orange); color: var(--pp-navy); font-size: 12px; font-weight: 800;
}
.ppv3__name {
  margin-top: 8px; min-height: 36px; font-size: 13px; line-height: 1.38; color: var(--pp-navy); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ppv3__name:hover { text-decoration: underline; }
.ppv3__buy { margin-top: auto; padding-top: 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.ppv3__buy p { margin: 0; min-width: 0; font-variant-numeric: tabular-nums; }
.ppv3__buy b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; }
.ppv3__buy s { display: block; margin-top: 2px; font-size: 12px; color: var(--pp-t3); white-space: nowrap; }
.ppv3__cart {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 4px; background: var(--pp-orange); color: var(--pp-navy); cursor: pointer;
}
.ppv3__cart:hover { background: #FFB53D; }
.ppv3__cart:focus-visible { outline: 2px solid var(--pp-link); outline-offset: 2px; }
.ppv3__cart:disabled { background: #E6EAEF; color: #8D9BAA; cursor: not-allowed; }

/* ---------- mobile: bottom sheet ---------- */
@media (max-width: 639.98px) {
  .ppv3 { place-items: end center; padding: 0; }
  .ppv3__card {
    max-width: none; max-height: 92dvh; border-radius: 12px 12px 0 0;
    transform: translateY(24px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .ppv3__hero { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 16px 16px; }
  .ppv3__media { order: -1; min-height: 0; margin: 0 40px; }
  .ppv3__media img { max-height: 150px; }
  .ppv3__title { font-size: 26px; }
  .ppv3__desc { font-size: 14px; }
  .ppv3__cta { display: flex; width: 100%; margin-top: 14px; }
  .ppv3__trust { padding: 10px 16px; gap: 6px 16px; font-size: 12px; }
  .ppv3__picks { padding: 14px 16px 18px; }
  .ppv3__grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px;
  }
  .ppv3__grid::-webkit-scrollbar { display: none; }
  .ppv3__item { scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .ppv3__backdrop, .ppv3__card { transition: none; }
  .ppv3__card { transform: none; }
}
