/**
 * Clearance Pay Later – frontend styles (gate popup + cart modal + checkout)
 * Mobile-first, 360px and up.
 */

/* ============================================================
   Shared tokens matching the clearance-deal theme
   ============================================================ */
:root {
  --cpl-primary:       #ef4444;
  --cpl-primary-hover: #dc2626;
  --cpl-success:       #10b981;
  --cpl-dark:          #0f172a;
  --cpl-text:          #334155;
  --cpl-muted:         #64748b;
  --cpl-border:        #e2e8f0;
  --cpl-bg:            #f8fafc;
  --cpl-white:         #ffffff;
  --cpl-accent:        #f59e0b;
  --cpl-radius:        12px;
  --cpl-radius-sm:     6px;
  --cpl-shadow:        0 10px 40px rgba(0,0,0,.18);
  --cpl-transition:    all .2s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   Screen reader utility
   ============================================================ */
.cpl-sr-only {
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* ============================================================
   GATE OVERLAY
   ============================================================ */
.cpl-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, .80);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;          /* bottom-sheet on mobile */
  justify-content: center;
  /* start invisible; JS reveals it */
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.cpl-gate-overlay.cpl-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Prevent background scroll while gate is open */
body.cpl-gate-open {
  overflow: hidden;
  touch-action: none;
}

.cpl-gate-modal {
  position: relative;
  background: var(--cpl-white);
  border-radius: 20px 20px 0 0;
  padding: 32px 20px 40px;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--cpl-shadow);
}

/* X close button */
.cpl-gate-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--cpl-muted);
  cursor: pointer;
  padding: 0;
  transition: background .15s, color .15s;
  z-index: 1;
}
.cpl-gate-close:hover,
.cpl-gate-close:focus-visible {
  background: rgba(0,0,0,.07);
  color: var(--cpl-dark);
  outline: none;
}

/* Desktop: centred card */
@media (min-width: 640px) {
  .cpl-gate-overlay { align-items: center; }
  .cpl-gate-modal {
    border-radius: var(--cpl-radius);
    max-width: 460px;
    width: 90%;
  }
}

.cpl-gate-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.cpl-gate-logo img { max-height: 48px; width: auto; }

.cpl-gate-title {
  font-size: clamp(1.15rem, 4.5vw, 1.35rem);
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0 0 8px;
  line-height: 1.3;
}
.cpl-gate-subtitle {
  font-size: .95rem;
  color: var(--cpl-muted);
  margin: 0 0 24px;
}

/* Phone field */
.cpl-field-group { margin-bottom: 20px; }

.cpl-phone-wrap {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--cpl-border);
  border-radius: var(--cpl-radius-sm);
  overflow: hidden;
  transition: border-color .2s;
}
.cpl-phone-wrap:focus-within { border-color: var(--cpl-primary); }

.cpl-phone-prefix {
  padding: 0 12px;
  background: var(--cpl-bg);
  color: var(--cpl-muted);
  font-size: .95rem;
  display: flex;
  align-items: center;
  border-right: 2px solid var(--cpl-border);
  white-space: nowrap;
  user-select: none;
}
.cpl-phone-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 14px;
  font-size: 1.05rem;
  height: 52px;
  color: var(--cpl-dark);
  background: transparent;
  min-width: 0;
}
.cpl-phone-input::placeholder { color: #cbd5e1; }

.cpl-field-error {
  color: var(--cpl-primary);
  font-size: .85rem;
  margin: 6px 0 0;
}
.cpl-field-notice {
  font-size: .8rem;
  color: var(--cpl-muted);
  margin: 10px 0 0;
  line-height: 1.5;
}
.cpl-field-notice a {
  color: var(--cpl-primary);
  text-decoration: underline;
}

/* Buttons */
.cpl-btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: var(--cpl-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--cpl-transition);
  line-height: 1;
}
.cpl-btn:focus-visible { outline: 3px solid var(--cpl-primary); outline-offset: 2px; }

.cpl-btn-primary {
  background: var(--cpl-primary);
  color: var(--cpl-white);
}
.cpl-btn-primary:hover { background: var(--cpl-primary-hover); }
.cpl-btn-primary:active { transform: scale(.98); }

.cpl-btn-success {
  background: var(--cpl-success);
  color: var(--cpl-white);
}
.cpl-btn-success:hover { filter: brightness(.92); }

/* Checking screen */
.cpl-checking-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}
.cpl-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--cpl-border);
  border-top-color: var(--cpl-primary);
  border-radius: 50%;
  animation: cpl-spin .8s linear infinite;
}
@keyframes cpl-spin { to { transform: rotate(360deg); } }

.cpl-checking-text {
  text-align: center;
  font-size: 1rem;
  color: var(--cpl-text);
  font-weight: 500;
  margin: 0 0 16px;
}

/* Progress bar */
.cpl-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--cpl-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cpl-progress-fill {
  height: 100%;
  width: 0;
  background: var(--cpl-primary);
  border-radius: 3px;
  transition: width .2s linear;
}

/* Result screen */
.cpl-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cpl-success);
  color: var(--cpl-white);
  font-size: 2rem;
  line-height: 64px;
  text-align: center;
  margin: 0 auto 16px;
}
.cpl-result-title {
  font-size: clamp(1.1rem, 4vw, 1.3rem);
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0 0 12px;
  text-align: center;
}
.cpl-result-message {
  font-size: .95rem;
  color: var(--cpl-text);
  line-height: 1.6;
  text-align: center;
  margin: 0 0 24px;
}

/* ============================================================
   CART PAYMENT-CHOICE MODAL
   ============================================================ */
.cpl-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(15, 23, 42, .75);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cpl-cart-overlay[hidden] { display: none !important; }

body.cpl-cart-open,
body.cpl-no-scroll { overflow: hidden; overscroll-behavior: none; }

.cpl-cart-modal {
  background: var(--cpl-white);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px 40px;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--cpl-shadow);
}

@media (min-width: 640px) {
  .cpl-cart-overlay { align-items: center; }
  .cpl-cart-modal {
    border-radius: var(--cpl-radius);
    max-width: 460px;
    width: 90%;
  }
}

.cpl-cart-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0 0 20px;
}

/* Radio option cards */
.cpl-plan-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cpl-plan-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--cpl-border);
  border-radius: var(--cpl-radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.cpl-plan-option:has(.cpl-plan-radio:checked),
.cpl-plan-option.cpl-checked {
  border-color: var(--cpl-primary);
  background: #fff5f5;
}
.cpl-plan-option--bnpl:has(.cpl-plan-radio:checked),
.cpl-plan-option--bnpl.cpl-checked {
  border-color: var(--cpl-success);
  background: #f0fdf4;
}

.cpl-plan-radio {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--cpl-primary);
  margin-top: 2px;
  cursor: pointer;
}

.cpl-plan-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cpl-plan-badge {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--cpl-success);
  color: var(--cpl-white);
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
  margin-bottom: 4px;
}

.cpl-plan-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--cpl-dark);
}
.cpl-plan-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cpl-primary);
}
.cpl-plan-sub {
  font-size: .82rem;
  color: var(--cpl-muted);
}
.cpl-plan-instalment {
  font-size: .82rem;
  font-weight: 600;
  color: var(--cpl-success);
}

.cpl-btn-full { width: 100%; }

/* ============================================================
   CART / CHECKOUT BREAKDOWN CARD
   ============================================================ */
.cpl-breakdown-card {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--cpl-radius);
  padding: 16px;
  margin: 0 0 20px;
}

.cpl-breakdown-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cpl-breakdown-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0;
}
.cpl-breakdown-icon { font-size: 1.1rem; }

.cpl-breakdown-rows { margin: 0; display: flex; flex-direction: column; gap: 6px; }

.cpl-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: .88rem;
}
.cpl-breakdown-row dt { color: var(--cpl-muted); }
.cpl-breakdown-row dd { font-weight: 600; color: var(--cpl-text); margin: 0; text-align: right; }

.cpl-breakdown-row--highlight dt { color: var(--cpl-text); font-weight: 600; }
.cpl-breakdown-row--highlight dd { color: var(--cpl-primary); font-size: 1.05rem; }

.cpl-breakdown-row--instalment dt { color: var(--cpl-dark); font-weight: 700; font-size: .95rem; }
.cpl-breakdown-row--instalment dd { color: var(--cpl-success); font-weight: 800; font-size: 1.05rem; }
.cpl-breakdown-row--instalment .cpl-per-month { font-weight: 700; color: var(--cpl-success); }

.cpl-breakdown-row--total {
  border-top: 1px solid #fed7aa;
  padding-top: 8px;
  margin-top: 4px;
}
.cpl-breakdown-row--total dt,
.cpl-breakdown-row--total dd { font-weight: 700; font-size: .92rem; }

.cpl-per-month { font-size: .75rem; font-weight: 400; color: var(--cpl-muted); margin-left: 2px; }

.cpl-breakdown-note {
  font-size: .82rem;
  color: var(--cpl-muted);
  margin: 10px 0 0;
  text-align: center;
}
.cpl-breakdown-note--green {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--cpl-radius-sm);
  padding: 10px 12px;
  font-weight: 500;
  line-height: 1.5;
}

/* Delivery notice */
.cpl-delivery-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--cpl-radius-sm);
  padding: 12px 14px;
  font-size: .88rem;
  color: #1e40af;
  margin: 12px 0;
  line-height: 1.5;
}
.cpl-notice-icon { margin-right: 6px; }

/* Terms checkbox */
.cpl-terms-check { margin: 12px 0 !important; }
.cpl-terms-check label { font-size: .88rem !important; line-height: 1.5; }

/* Change number notice */
.cpl-change-number-notice {
  font-size: .85rem;
  color: var(--cpl-muted);
  padding: 10px 0;
}
.cpl-change-number-notice a {
  color: var(--cpl-primary);
  text-decoration: underline;
  cursor: pointer;
}

/* My Account plan */
.cpl-myaccount-plan {
  margin-top: 24px;
  border: 1px solid var(--cpl-border);
  border-radius: var(--cpl-radius);
  padding: 20px;
}
.cpl-myaccount-title, .cpl-schedule-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0 0 16px;
}
.cpl-schedule-title { margin-top: 20px; }
.cpl-schedule-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cpl-schedule-table th, .cpl-schedule-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--cpl-border);
}
.cpl-row-paid td { color: var(--cpl-muted); }
.cpl-status-paid { color: var(--cpl-success); font-weight: 600; }
.cpl-status-pending { color: var(--cpl-muted); }

@media (max-width: 480px) {
  .cpl-schedule-table thead th:last-child { display: none; }
  .cpl-schedule-table td:last-child { display: none; }
}

/* ============================================================
   CHECKOUT PLAN SWITCHER
   Shown above the order review at the top of the right column.
   ============================================================ */
.cpl-checkout-switcher {
  margin: 0 0 20px;
  padding: 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--cpl-radius);
}
.cpl-checkout-switcher__label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--cpl-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 0 0 12px;
}
.cpl-checkout-switcher__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 500px) {
  .cpl-checkout-switcher__options { flex-direction: row; }
}

.cpl-checkout-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 2px solid var(--cpl-border);
  border-radius: var(--cpl-radius-sm);
  background: var(--cpl-white);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.cpl-checkout-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cpl-checkout-option--active {
  border-color: var(--cpl-success);
  background: #f0fdf4;
}
.cpl-checkout-option--bnpl.cpl-checkout-option--active {
  border-color: var(--cpl-success);
}

.cpl-checkout-option__badge {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--cpl-success);
  color: var(--cpl-white);
  padding: 2px 7px;
  border-radius: 20px;
  align-self: flex-start;
  margin-bottom: 2px;
}
.cpl-checkout-option__title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--cpl-dark);
  line-height: 1.3;
}
.cpl-checkout-option__sub {
  font-size: .78rem;
  color: var(--cpl-muted);
}

/* ============================================================
   HEADER CART ICON BUTTON
   ============================================================ */
.cpl-cart-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cpl-dark);
  padding: 0;
  border-radius: 50%;
  transition: background .15s;
  flex-shrink: 0;
}
.cpl-cart-icon-btn:hover { background: var(--cpl-bg); }
.cpl-cart-icon-btn:focus-visible { outline: 2px solid var(--cpl-primary); outline-offset: 2px; }

.cpl-cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--cpl-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 4px;
  pointer-events: none;
}
.cpl-cart-count:empty,
.cpl-cart-count[data-count="0"] { display: none; }

/* ============================================================
   MINI-CART PANEL (right-side drawer on desktop,
   bottom-sheet on mobile)
   ============================================================ */
.cpl-mini-cart-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100vw, 380px);
  background: var(--cpl-white);
  box-shadow: -4px 0 24px rgba(0,0,0,.14);
  z-index: 99997;
  display: none;
  flex-direction: column;
}
.cpl-mini-cart-panel.cpl-mc-open { display: flex; }

@media (max-width: 480px) {
  .cpl-mini-cart-panel {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 85dvh;
    border-radius: 20px 20px 0 0;
  }
}

/* Backdrop */
.cpl-mini-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 99996;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
}
.cpl-mini-cart-backdrop.cpl-mc-open { display: block; }

.cpl-mini-cart-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.cpl-mini-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cpl-border);
  flex-shrink: 0;
}
.cpl-mini-cart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0;
}
.cpl-mini-cart-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--cpl-bg);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cpl-muted);
  transition: background .15s;
  flex-shrink: 0;
}
.cpl-mini-cart-close:hover { background: var(--cpl-border); color: var(--cpl-dark); }

/* Body: scrollable items */
.cpl-mini-cart-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px;
}

/* Footer */
.cpl-mini-cart-footer {
  padding: 16px;
  border-top: 1px solid var(--cpl-border);
  flex-shrink: 0;
}
.cpl-mini-cart-footer.cpl-mc-empty-footer { display: none; }

/* Spinner inside mini-cart */
.cpl-mc-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--cpl-border);
  border-top-color: var(--cpl-primary);
  border-radius: 50%;
  animation: cpl-spin .7s linear infinite;
  margin: 32px auto;
}

/* Empty message */
.cpl-mc-empty {
  text-align: center;
  color: var(--cpl-muted);
  font-size: .9rem;
  margin: 32px 0;
}

/* Cart item row */
.cpl-mc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cpl-border);
}
.cpl-mc-item:last-child { border-bottom: none; }

.cpl-mc-img-wrap { flex-shrink: 0; width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--cpl-bg); }
.cpl-mc-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cpl-mc-info { flex: 1; min-width: 0; }
.cpl-mc-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--cpl-dark);
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Qty controls */
.cpl-mc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.cpl-mc-qty-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--cpl-border);
  border-radius: 6px;
  overflow: hidden;
}
.cpl-mc-minus,
.cpl-mc-plus {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--cpl-bg);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cpl-dark);
  transition: background .15s;
  flex-shrink: 0;
}
.cpl-mc-minus:hover, .cpl-mc-plus:hover { background: var(--cpl-border); }
.cpl-mc-qty {
  min-width: 28px;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--cpl-dark);
  padding: 0 4px;
}
.cpl-mc-subtotal { font-size: .85rem; font-weight: 700; color: var(--cpl-primary); }

/* Remove button */
.cpl-mc-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--cpl-muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  align-self: flex-start;
  margin-top: 2px;
}
.cpl-mc-remove:hover { background: #fee2e2; color: var(--cpl-primary); }

/* Total row */
.cpl-mc-total-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 0;
  font-size: .9rem;
  font-weight: 700;
  color: var(--cpl-dark);
  margin-top: 4px;
}

/* ============================================================
   CHECKOUT PAGE – REMOVE BUTTON PER ITEM
   ============================================================ */
.cpl-checkout-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: var(--cpl-primary);
  border-radius: 50%;
  font-size: .75rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
  vertical-align: middle;
  flex-shrink: 0;
}
.cpl-checkout-remove:hover { background: var(--cpl-primary); color: #fff; border-color: var(--cpl-primary); }
.cpl-checkout-remove:focus-visible { outline: 2px solid var(--cpl-primary); outline-offset: 2px; }
.cpl-checkout-remove[disabled] { opacity: .5; cursor: wait; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cpl-spinner, .cpl-mc-spinner { animation: none; border-top-color: var(--cpl-primary); }
  .cpl-progress-fill { transition: none; }
  .cpl-mini-cart-panel { transition: none; }
}

/* ============================================================
   VARIATION SELECTOR MODAL
   ============================================================ */
.cpl-var-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, .80);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cpl-var-overlay[hidden] { display: none !important; }

.cpl-var-modal {
  background: var(--cpl-white);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px 40px;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--cpl-shadow);
  position: relative;
}

@media (min-width: 640px) {
  .cpl-var-overlay { align-items: center; }
  .cpl-var-modal {
    border-radius: var(--cpl-radius);
    max-width: 440px;
    width: 90%;
  }
}

.cpl-var-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--cpl-bg);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--cpl-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.cpl-var-close:hover { background: var(--cpl-border); color: var(--cpl-dark); }

.cpl-var-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cpl-dark);
  margin: 0 0 20px;
  padding-right: 36px;
}

.cpl-var-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.cpl-var-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--cpl-border);
  border-radius: var(--cpl-radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cpl-var-option:has(input:checked),
.cpl-var-option.cpl-var-checked {
  border-color: var(--cpl-primary);
  background: #fff5f5;
}
.cpl-var-option input[type="radio"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--cpl-primary);
  cursor: pointer;
}
.cpl-var-label {
  flex: 1;
  font-size: .95rem;
  font-weight: 600;
  color: var(--cpl-dark);
}
.cpl-var-price {
  font-size: .95rem;
  font-weight: 700;
  color: var(--cpl-primary);
  white-space: nowrap;
}

.cpl-var-footer {
  padding-top: 4px;
}
