/* PKZ Purchase with Purchase - cart block
   Change the colours here to match the site: */
.pkz-pwp-mount { display: block; clear: both; width: 100%; max-width: 100%; min-width: 0; }
.pkz-pwp-mount:empty { display: none; }
.pkz-pwp {
  --pwp-accent: #d71920;      /* locked state, badge, progress */
  --pwp-ok: #138a36;          /* unlocked state */
  --pwp-dark: #111111;        /* text, selected card, button */
  --pwp-muted: #777777;
  --pwp-border: #e5e5e5;
  --pwp-soft: #f7f7f7;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pwp-dark);
}
.pkz-pwp *, .pkz-pwp *::before, .pkz-pwp *::after { box-sizing: border-box; }

.pkz-pwp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.pkz-pwp-title { margin: 0; font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.pkz-pwp-tag { display: inline-block; background: var(--pwp-accent); color: #fff; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 3px; margin-right: 8px; vertical-align: 3px; letter-spacing: .05em; }
.pkz-pwp-sub { margin: 0; color: var(--pwp-muted); }

.pkz-pwp-notice { background: #fff7e6; border: 1px solid #ffd591; color: #874d00; padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }

.pkz-pwp-campaign { border: 1px solid var(--pwp-border); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: #fff; }
.pkz-pwp-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.pkz-pwp-cname { font-weight: 700; font-size: 15px; }
.pkz-pwp-min { font-weight: 400; color: var(--pwp-muted); font-size: 13px; margin-left: 4px; }
.pkz-pwp-state { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.is-unlocked .pkz-pwp-state { color: var(--pwp-ok); }
.is-locked .pkz-pwp-state { color: var(--pwp-accent); }

.pkz-pwp-progress { height: 6px; background: #eee; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.pkz-pwp-progress span { display: block; height: 100%; background: var(--pwp-accent); border-radius: 99px; transition: width .4s ease; }
.is-unlocked .pkz-pwp-progress span { background: var(--pwp-ok); }

.pkz-pwp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }

.pkz-pwp-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #fff; border: 2px solid var(--pwp-border); border-radius: 8px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pkz-pwp-card:hover { border-color: #c9c9c9; }
.pkz-pwp-card.is-ticked { border-color: var(--pwp-dark); box-shadow: 0 3px 12px rgba(0, 0, 0, .08); }
.pkz-pwp-card.has-error { border-color: var(--pwp-accent); }
.pkz-pwp-card.is-disabled { cursor: default; }
.pkz-pwp-card.is-disabled:hover { border-color: var(--pwp-border); }
.is-locked .pkz-pwp-img img { filter: grayscale(.7); opacity: .65; }
.pkz-pwp-card.is-sold-out .pkz-pwp-img img { opacity: .45; }

/* Tick box */
.pkz-pwp-check { position: absolute; top: 8px; right: 8px; z-index: 2; margin: 0; cursor: pointer; }
.pkz-pwp-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pkz-pwp-check span { display: block; width: 24px; height: 24px; border: 2px solid #bbb; border-radius: 5px; background: #fff; transition: all .15s; }
.pkz-pwp-check input:checked + span { background: var(--pwp-dark); border-color: var(--pwp-dark); }
.pkz-pwp-check input:checked + span::after { content: ""; display: block; width: 7px; height: 12px; margin: 2px 0 0 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pkz-pwp-check input:focus-visible + span { outline: 2px solid var(--pwp-dark); outline-offset: 2px; }
.pkz-pwp-check input:disabled + span { background: var(--pwp-soft); border-color: #ddd; cursor: not-allowed; }

/* Pick-one deals: round radio button with a dot */
.pkz-pwp-check input[type="radio"] + span { border-radius: 50%; }
.pkz-pwp-check input[type="radio"]:checked + span { background: #fff; border-color: var(--pwp-dark); }
.pkz-pwp .pkz-pwp-check input[type="radio"]:checked + span::after { content: ""; display: block; width: 50%; height: 50%; margin: 25% 0 0 25%; border: 0; border-radius: 50%; background: var(--pwp-dark); transform: none; }

.pkz-pwp-badge { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--pwp-accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }

.pkz-pwp-img { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; background: var(--pwp-soft); border-radius: 6px; overflow: hidden; }
.pkz-pwp-img img { max-width: 100%; max-height: 100%; object-fit: contain; }

.pkz-pwp-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--pwp-dark); font-weight: 600; font-size: 13px; min-height: 36px; }
.pkz-pwp-name:hover { color: var(--pwp-dark); text-decoration: underline; }

.pkz-pwp-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.pkz-pwp-price { color: var(--pwp-accent); font-weight: 700; font-size: 16px; }
.pkz-pwp-old { color: var(--pwp-muted); text-decoration: line-through; font-size: 12px; }

/* Size box: our own styled box, with the real dropdown invisible on top of it
   (tapping still opens the phone's normal picker; text/padding can't be overridden by the theme) */
.pkz-pwp-selwrap { position: relative; width: 100%; }
.pkz-pwp-selbox {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 14px;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  background: #f6f6f6;
  color: #8a8a8a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  pointer-events: none;
}
.pkz-pwp-sellabel { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pkz-pwp-selname { color: #8a8a8a; font-weight: 500; margin-right: 8px; }
.pkz-pwp-selval { color: var(--pwp-dark); font-weight: 700; }
.pkz-pwp-selarrow { flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; color: var(--pwp-dark); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.pkz-pwp-selarrow svg { width: 12px; height: 12px; display: block; }

.pkz-pwp .pkz-pwp-selwrap .pkz-pwp-select {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  font-size: 16px; /* 16px = no iPhone zoom (it's invisible anyway) */
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.pkz-pwp-selwrap:hover .pkz-pwp-selbox { border-color: #b8b8b8; }
.pkz-pwp-selwrap.is-focus .pkz-pwp-selbox { border-color: var(--pwp-dark); background: #fff; box-shadow: 0 0 0 3px rgba(17, 17, 17, .08); }
.pkz-pwp-selwrap.has-value .pkz-pwp-selbox { border-color: var(--pwp-dark); background: #fff; }
.pkz-pwp-selwrap.has-value .pkz-pwp-selarrow { background: var(--pwp-dark); color: #fff; box-shadow: none; }
.pkz-pwp-selwrap.is-disabled .pkz-pwp-selbox { background: var(--pwp-soft); border-color: #e8e8e8; color: #b8b8b8; }
.pkz-pwp-selwrap.is-disabled .pkz-pwp-selarrow { opacity: .4; }
.pkz-pwp-selwrap.is-disabled .pkz-pwp-select { cursor: not-allowed; }
.pkz-pwp-card.has-error .pkz-pwp-selbox { border-color: var(--pwp-accent); background: #fff6f6; }

.pkz-pwp-flag { font-size: 12px; font-weight: 600; }
.pkz-pwp-flag.is-in { color: var(--pwp-ok); }
.pkz-pwp-flag.is-out { color: var(--pwp-muted); text-transform: uppercase; }
.pkz-pwp-err { color: var(--pwp-accent); font-size: 12px; }
.pkz-pwp-err:empty { display: none; }

.pkz-pwp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.pkz-pwp-add { min-width: 180px; height: 44px; padding: 0 22px; border: 0; border-radius: 6px; background: var(--pwp-dark); color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; transition: opacity .15s; }
.pkz-pwp-add:disabled { opacity: .35; cursor: not-allowed; }
.pkz-pwp-add.is-locked { background: #999; opacity: .8; text-transform: none; }
.pkz-pwp-add.is-loading { opacity: .6; cursor: wait; }
.pkz-pwp-msg { font-size: 13px; }
.pkz-pwp-msg.is-error { color: var(--pwp-accent); }
.pkz-pwp-msg.is-success { color: var(--pwp-ok); font-weight: 600; }

/* Countdown */
.pkz-pwp-countdown { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: #f1f1f1; color: var(--pwp-dark); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pkz-pwp-countdown.is-urgent { background: #fdeaea; color: var(--pwp-accent); }
.pkz-pwp-countdown.is-ended { background: #eee; color: #999; }
.pkz-pwp-countdown-text:empty::before { content: "\2026"; }

/* "You've unlocked a deal!" popup */
html.pkz-pwp-noscroll, html.pkz-pwp-noscroll body { overflow: hidden; }
.pkz-pwp-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pkz-pwp-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s; }
.pkz-pwp-modal-dialog { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .25s, transform .25s; overflow: hidden; }
.pkz-pwp-modal.is-open .pkz-pwp-modal-backdrop { opacity: 1; }
.pkz-pwp-modal.is-open .pkz-pwp-modal-dialog { opacity: 1; transform: none; }
.pkz-pwp-modal-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2f2f2; color: #111; font-size: 22px; line-height: 34px; cursor: pointer; z-index: 2; padding: 0; }
.pkz-pwp-modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 54px 6px 20px; font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: #111; }
.pkz-pwp-modal-icon { font-size: 24px; line-height: 1; }
.pkz-pwp-modal-body { flex: 1; overflow-y: auto; padding: 4px 20px 0; -webkit-overflow-scrolling: touch; }
.pkz-pwp-modal-body .pkz-pwp { margin: 8px 0; }
.pkz-pwp-modal-body .pkz-pwp-campaign { border: 0; padding: 0; margin: 0; }
.pkz-pwp-modal-foot { display: flex; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid #eee; background: #fff; }
.pkz-pwp-modal-foot > * { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; text-decoration: none; cursor: pointer; }
.pkz-pwp-modal-cart { border: 2px solid #111; color: #111 !important; background: #fff; }
.pkz-pwp-modal-cart:hover { background: #f5f5f5; text-decoration: none; }
.pkz-pwp-modal-continue { border: 0; background: #f1f1f1; color: #555; }

/* Popup: deal is already unlocked - no progress bar */
.pkz-pwp--popup .pkz-pwp-progress { display: none; }
.pkz-pwp--popup .pkz-pwp-status { margin-bottom: 12px; }

/* Popup grid: 2-3 cards across on desktop */
.pkz-pwp--popup .pkz-pwp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }


.pkz-pwp--checkout { margin: 0 0 20px; padding-bottom: 20px; border-bottom: 1px solid var(--pwp-border); }
.pkz-pwp--checkout .pkz-pwp-title { font-size: 16px; }
.pkz-pwp--checkout .pkz-pwp-campaign:last-child { margin-bottom: 0; }

/* Mobile: compact list rows instead of big cards */
@media (max-width: 575px) {
  .pkz-pwp { margin: 16px 0; font-size: 13px; }
  .pkz-pwp-head { margin-bottom: 10px; }
  .pkz-pwp-title { font-size: 15px; display: flex; align-items: center; }
  .pkz-pwp-tag { font-size: 10px; padding: 3px 6px; margin-right: 8px; vertical-align: 0; }
  .pkz-pwp-sub { display: none; }

  .pkz-pwp-campaign { padding: 12px; border-radius: 8px; margin-bottom: 10px; }
  .pkz-pwp-status { gap: 2px; margin-bottom: 8px; }
  .pkz-pwp-cname { font-size: 14px; width: 100%; }
  .pkz-pwp-min { display: block; margin: 1px 0 0; font-size: 12px; }
  .pkz-pwp-state { font-size: 12px; }
  .pkz-pwp-progress { height: 5px; margin-bottom: 10px; }

  .pkz-pwp-grid { display: flex; flex-direction: column; gap: 8px; }
  .pkz-pwp-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    column-gap: 10px;
    row-gap: 0;
    align-items: start;
    padding: 8px 40px 8px 8px;
    border-width: 1.5px;
    border-radius: 8px;
  }
  .pkz-pwp-card > * { grid-column: 2; min-width: 0; }
  .pkz-pwp-card > * + * { margin-top: 4px; }
  .pkz-pwp-card > .pkz-pwp-img { grid-column: 1; grid-row: 1 / span 6; width: 72px; border-radius: 6px; }
  .pkz-pwp-check { top: 50%; right: 8px; transform: translateY(-50%); }
  .pkz-pwp-check span { width: 22px; height: 22px; }
  .pkz-pwp-check input:checked + span::after { width: 6px; height: 11px; margin: 2px 0 0 6px; }
  .pkz-pwp-card > .pkz-pwp-badge { grid-column: 1; grid-row: 1; top: 4px; left: 4px; margin: 0; font-size: 10px; padding: 1px 4px; border-radius: 3px; }
  .pkz-pwp-card > .pkz-pwp-check { margin: 0; }
  .pkz-pwp-card > .pkz-pwp-name, .pkz-pwp-card > .pkz-pwp-img { margin-top: 0; }

  .pkz-pwp-name { font-size: 13px; line-height: 1.3; min-height: 0; text-decoration: none; }
  .pkz-pwp-prices { gap: 6px; }
  .pkz-pwp-price { font-size: 15px; }
  .pkz-pwp-old { font-size: 11px; }
  .pkz-pwp-selbox { height: 38px; font-size: 14px; padding: 0 8px 0 12px; }
  .pkz-pwp-selarrow { width: 24px; height: 24px; }
  .pkz-pwp-flag, .pkz-pwp-err { font-size: 11px; }

  .pkz-pwp-foot { margin-top: 10px; }
  .pkz-pwp-add { width: 100%; height: 44px; font-size: 14px; }
  /* Locked: the red "Add RM X more to unlock" line already says it - no grey button */
  .pkz-pwp-add.is-locked { display: none; }

  /* Popup = bottom sheet on phones */
  .pkz-pwp-modal { align-items: flex-end; padding: 0; }
  .pkz-pwp-modal-dialog { max-width: none; max-height: 88vh; border-radius: 16px 16px 0 0; transform: translateY(100%); }
  .pkz-pwp-modal.is-open .pkz-pwp-modal-dialog { transform: none; }
  .pkz-pwp-modal-head { font-size: 15px; padding: 16px 50px 4px 16px; }
  .pkz-pwp-modal-body { padding: 0 16px; }
  .pkz-pwp-modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .pkz-pwp-modal-foot > * { height: 42px; font-size: 13px; }
  .pkz-pwp-countdown { font-size: 11px; padding: 2px 8px; }
  .is-locked .pkz-pwp-foot { margin-top: 0; }
}
