/**
 * PNIDesign Premium - New Features CSS
 * Social proof, urgency, quiz, bundle, size guide, dark mode, swatches
 */

/* ── DARK MODE ───────────────────────────────────── */
.pni-dark {
  --pni-white:      #0F1117;
  --pni-off-white:  #171923;
  --pni-cream:      #1A1F2E;
  --pni-gray-50:    #1E2330;
  --pni-gray-100:   #252B3B;
  --pni-gray-200:   #2E3548;
  --pni-gray-400:   #6B7280;
  --pni-text:       #F9FAFB;
  --pni-text-sec:   #9CA3AF;
  --pni-text-muted: #6B7280;
}
.pni-dark .pni-header          { background: rgba(15,17,23,0.95); }
.pni-dark .pni-product-card,
.pni-dark .pni-mini-card,
.pni-dark .pni-faq             { background: var(--pni-gray-50); border-color: var(--pni-gray-200); }
.pni-dark body                 { background: var(--pni-white); color: var(--pni-text); }

/* Dark mode toggle button */
.pni-dark-toggle {
  background: none; border: 1.5px solid var(--pni-gray-200);
  border-radius: var(--pni-radius-full); padding: 6px 12px;
  cursor: pointer; font-size: 0.85rem; color: var(--pni-text-sec);
  display: flex; align-items: center; gap: 6px; transition: all var(--pni-transition);
}
.pni-dark-toggle:hover { border-color: var(--pni-navy); color: var(--pni-navy); }

/* ── LIVE SOCIAL PROOF PILLS ─────────────────────── */
.pni-social-proof {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.pni-proof-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--pni-off-white); border: 1px solid var(--pni-gray-100);
  border-radius: var(--pni-radius-full);
  font-size: 0.78rem; color: var(--pni-text-sec);
}
.pni-proof-pill strong { color: var(--pni-navy); font-weight: 700; }
.pni-proof-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.pni-proof-dot--live   { background: #16a34a; animation: pniPulseDot 2s ease infinite; }
.pni-proof-dot--orange { background: #ea580c; animation: pniPulseDot 2s ease 0.5s infinite; }
@keyframes pniPulseDot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(1.4); }
}

/* ── FREE SHIPPING BAR ───────────────────────────── */
.pni-shipping-bar {
  background: var(--pni-cream); border: 1px solid var(--pni-gray-200);
  border-radius: var(--pni-radius-lg); padding: 0.9rem 1.25rem;
  margin-bottom: 1.25rem;
}
.pni-shipping-bar__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem; gap: 0.5rem;
}
.pni-shipping-bar__text { font-size: 0.82rem; font-weight: 600; color: var(--pni-navy); }
.pni-shipping-bar__text--success { color: var(--pni-success, #16a34a); }
.pni-shipping-bar__amounts { font-size: 0.75rem; color: var(--pni-text-muted); flex-shrink: 0; }
.pni-shipping-bar__track { height: 6px; background: var(--pni-gray-200); border-radius: 999px; overflow: hidden; }
.pni-shipping-bar__fill { height: 100%; background: linear-gradient(90deg, var(--pni-gold), #D4729F); border-radius: 999px; transition: width 0.6s ease; }

/* ── URGENCY BLOCK ───────────────────────────────── */
.pni-urgency-block {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B; border-radius: var(--pni-radius-lg);
  padding: 0.9rem 1.1rem; margin-bottom: 1.25rem;
}
.pni-urgency-icon { font-size: 1.25rem; flex-shrink: 0; }
.pni-urgency-text { font-size: 0.82rem; font-weight: 600; color: #92400E; }
.pni-urgency-text strong { color: #B45309; }
.pni-stock-bar { height: 4px; background: rgba(180,83,9,0.2); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.pni-stock-fill { height: 100%; background: #F59E0B; border-radius: 999px; }

/* ── FLASH SALE COUNTDOWN ────────────────────────── */
.pni-countdown-wrap {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.5rem; margin-bottom: 1.25rem;
}
.pni-countdown-label { font-size: 0.8rem; font-weight: 600; color: var(--pni-text-sec); }
.pni-countdown-digits { display: flex; align-items: center; gap: 4px; }
.pni-cd-block {
  background: var(--pni-navy); color: var(--pni-white);
  border-radius: 6px; padding: 4px 9px;
  font-family: var(--pni-font-mono, 'JetBrains Mono', monospace);
  font-size: 0.88rem; font-weight: 700; min-width: 34px; text-align: center;
  line-height: 1.4;
}
.pni-cd-sep { color: var(--pni-navy); font-weight: 700; font-size: 0.9rem; }

/* ── STICKY BUY BAR ──────────────────────────────── */
.pni-sticky-buy-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--pni-white); border-top: 1px solid var(--pni-gray-100);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.10); padding: 0.9rem 0;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.pni-sticky-buy-bar.is-visible { transform: translateY(0); }
.pni-sticky-bar__inner {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.pni-sticky-bar__product { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.pni-sticky-bar__thumb {
  width: 46px; height: 46px; border-radius: var(--pni-radius);
  overflow: hidden; flex-shrink: 0;
}
.pni-sticky-bar__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pni-sticky-bar__name { font-size: 0.875rem; font-weight: 700; color: var(--pni-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pni-sticky-bar__variant { font-size: 0.78rem; color: var(--pni-text-sec); }
.pni-sticky-bar__price { font-size: 1.2rem; font-weight: 800; color: var(--pni-navy); flex-shrink: 0; }

/* ── ORDER TOAST ─────────────────────────────────── */
.pni-order-toast {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 150;
  background: var(--pni-white); border-radius: var(--pni-radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.16); padding: 1rem 1rem 1rem 1.25rem;
  display: flex; align-items: center; gap: 0.9rem;
  max-width: 310px; min-width: 260px;
  border-left: 3px solid var(--pni-gold);
  transform: translateX(calc(-100% - 2rem)); transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.pni-order-toast.is-visible { transform: translateX(0); }
.pni-order-toast__emoji { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.pni-order-toast__body { flex: 1; min-width: 0; }
.pni-order-toast__name   { font-size: 0.8rem; font-weight: 700; color: var(--pni-navy); }
.pni-order-toast__item   { font-size: 0.75rem; color: var(--pni-text-sec); }
.pni-order-toast__time   { font-size: 0.68rem; color: var(--pni-text-muted); margin-top: 2px; }
.pni-order-toast__close  { background: none; border: none; cursor: pointer; color: var(--pni-text-muted); line-height: 1; padding: 4px; flex-shrink: 0; font-size: 0.9rem; transition: color 0.2s; }
.pni-order-toast__close:hover { color: var(--pni-text); }
@media (max-width: 480px) { .pni-order-toast { bottom: 1rem; left: 1rem; max-width: calc(100vw - 2rem); } }

/* ── SIZE GUIDE MODAL ────────────────────────────── */
.pni-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,58,95,0.55); backdrop-filter: blur(6px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; transition: opacity 0.3s ease;
}
.pni-modal-overlay.is-open { opacity: 1; }
.pni-modal-overlay[hidden] { display: none; }
.pni-modal {
  background: var(--pni-white); border-radius: var(--pni-radius-xl);
  max-width: 640px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden; max-height: 90vh; overflow-y: auto;
}
.pni-modal-overlay.is-open .pni-modal { transform: translateY(0) scale(1); }
.pni-modal__header {
  padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--pni-gray-100);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--pni-white); z-index: 1;
}
.pni-modal__title  { font-size: 1.15rem; color: var(--pni-navy); }
.pni-modal__close  { background: none; border: none; cursor: pointer; color: var(--pni-text-muted); font-size: 1.1rem; padding: 6px; border-radius: var(--pni-radius); transition: all 0.2s; }
.pni-modal__close:hover { background: var(--pni-gray-50); color: var(--pni-text); }
.pni-modal__body   { padding: 1.75rem; }
.pni-size-guide__hint { font-size: 0.82rem; color: var(--pni-text-sec); margin-bottom: 1.1rem; }
.pni-size-guide__tip  { font-size: 0.78rem; color: var(--pni-text-muted); margin-top: 1rem; }
.pni-size-table { width: 100%; border-collapse: collapse; }
.pni-size-table th {
  background: var(--pni-navy); color: var(--pni-white);
  padding: 0.7rem 1rem; text-align: left;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.pni-size-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--pni-gray-100); font-size: 0.875rem; color: var(--pni-text-sec); }
.pni-size-table tr:hover td { background: var(--pni-off-white); }
.pni-size-table .highlight td { background: var(--pni-cream); font-weight: 700; color: var(--pni-navy); }
.pni-size-guide-trigger { font-size: 0.8rem !important; }
.pni-size-guide-inline { margin-bottom: 0.5rem; }

/* ── COLOR SWATCHES ──────────────────────────────── */
.pni-color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.5rem; }
.pni-color-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; position: relative;
  transition: transform 0.2s ease; flex-shrink: 0;
}
.pni-color-swatch::after {
  content: ''; position: absolute; inset: -5px;
  border-radius: 50%; border: 2px solid transparent;
  transition: border-color 0.2s;
}
.pni-color-swatch.active::after, .pni-color-swatch:hover::after { border-color: var(--pni-gold); }
.pni-color-swatch:hover { transform: scale(1.12); }
.pni-variant-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; font-weight: 700; color: var(--pni-text-sec);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem;
}
.pni-variant-label .pni-variant-selected { font-weight: 400; color: var(--pni-text-muted); text-transform: none; letter-spacing: 0; }

/* Size options */
.pni-size-options  { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.pni-size-opt {
  padding: 7px 14px; border: 2px solid var(--pni-gray-200);
  border-radius: var(--pni-radius); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; background: var(--pni-white); color: var(--pni-text-sec);
}
.pni-size-opt:hover    { border-color: var(--pni-navy); color: var(--pni-navy); }
.pni-size-opt.active   { border-color: var(--pni-navy); background: var(--pni-navy); color: var(--pni-white); }
.pni-size-opt.unavailable { opacity: 0.32; cursor: not-allowed; text-decoration: line-through; pointer-events: none; }

/* ── GIFT FINDER QUIZ ────────────────────────────── */
.pni-gift-quiz {
  background: linear-gradient(135deg, var(--pni-navy) 0%, #2A507A 100%);
  border-radius: var(--pni-radius-xl); padding: 2.5rem;
  position: relative; overflow: hidden;
}
.pni-gift-quiz::before {
  content: ''; position: absolute; top: -40%; right: -15%; width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(194,87,143,0.10) 0%, transparent 65%);
  border-radius: 50%; pointer-events: none;
}
.pni-quiz__progress { display: flex; gap: 4px; margin-bottom: 2rem; }
.pni-quiz__step { height: 3px; flex: 1; background: rgba(255,255,255,0.15); border-radius: 999px; transition: background 0.35s; }
.pni-quiz__step--done { background: var(--pni-gold); }
.pni-quiz__q { font-family: var(--pni-font-head, 'Playfair Display',serif); font-size: clamp(1.2rem,2.5vw,1.65rem); color: var(--pni-white); margin-bottom: 1.75rem; }
.pni-quiz__options {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 0.9rem; margin-bottom: 1.5rem;
}
.pni-quiz__opt {
  padding: 1.1rem; background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12); border-radius: var(--pni-radius-lg);
  cursor: pointer; transition: all 0.25s; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pni-quiz__opt:hover, .pni-quiz__opt.selected {
  background: rgba(194,87,143,0.14); border-color: var(--pni-gold);
  transform: translateY(-2px);
}
.pni-quiz__opt-icon  { font-size: 1.85rem; display: block; }
.pni-quiz__opt-label { font-size: 0.85rem; font-weight: 700; color: var(--pni-white); }
.pni-quiz__opt-desc  { font-size: 0.73rem; color: rgba(255,255,255,0.5); }
.pni-quiz__results-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.pni-quiz__result-card {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--pni-radius-lg); padding: 1rem; text-align: center;
  transition: all 0.25s;
}
.pni-quiz__result-card:hover { background: rgba(255,255,255,0.12); transform: translateY(-3px); }
.pni-quiz__result-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--pni-radius); margin-bottom: 0.6rem; }
.pni-quiz__result-name  { font-size: 0.78rem; font-weight: 600; color: var(--pni-white); margin-bottom: 0.25rem; }
.pni-quiz__result-price { font-size: 0.78rem; color: var(--pni-gold); margin-bottom: 0.75rem; }
.pni-quiz__loading { text-align: center; color: rgba(255,255,255,0.6); padding: 2rem; }
@media (max-width: 600px) {
  .pni-quiz__options { grid-template-columns: 1fr 1fr; }
  .pni-quiz__results-grid { grid-template-columns: 1fr 1fr; }
}

/* ── RECENTLY VIEWED ─────────────────────────────── */
.pni-recently-viewed { padding: 2.5rem 0; }
.pni-recently-viewed__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.pni-recently-viewed__title { font-size: 1.25rem; color: var(--pni-navy); }
.pni-recently-viewed__strip { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x mandatory; }
.pni-recently-viewed__strip::-webkit-scrollbar { display: none; }
.pni-mini-card { flex: 0 0 175px; background: var(--pni-white); border: 1px solid var(--pni-gray-100); border-radius: var(--pni-radius-lg); overflow: hidden; scroll-snap-align: start; transition: all 0.25s; }
.pni-mini-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.10); transform: translateY(-3px); }
.pni-mini-card__img-link { display: block; }
.pni-mini-card__img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pni-mini-card__body { padding: 0.75rem; }
.pni-mini-card__name  { display: block; font-size: 0.78rem; font-weight: 600; color: var(--pni-navy); margin-bottom: 4px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pni-mini-card__name:hover { color: var(--pni-gold-dark, #A3446F); }
.pni-mini-card__price { font-size: 0.8rem; font-weight: 700; color: var(--pni-gold-dark, #A3446F); margin-bottom: 0.6rem; }

/* ── BUNDLE UPSELL ───────────────────────────────── */
.pni-bundle-upsell { padding: 3rem 0; }
.pni-bundle-upsell__title { font-size: 1.35rem; color: var(--pni-navy); margin-bottom: 1.25rem; }
.pni-bundle-upsell__box {
  background: var(--pni-cream); border: 2px dashed var(--pni-gray-200);
  border-radius: var(--pni-radius-xl); padding: 2rem;
}
.pni-bundle-products { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pni-bundle-item { text-align: center; flex: 1; min-width: 100px; }
.pni-bundle-item__img { width: 80px; height: 80px; margin: 0 auto 0.5rem; border-radius: var(--pni-radius-lg); overflow: hidden; background: var(--pni-white); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.pni-bundle-item__img img { width: 100%; height: 100%; object-fit: cover; }
.pni-bundle-item__name  { font-size: 0.73rem; font-weight: 600; color: var(--pni-navy); }
.pni-bundle-item__price { font-size: 0.73rem; color: var(--pni-text-muted); }
.pni-bundle-plus { font-size: 1.5rem; color: var(--pni-gray-200); flex-shrink: 0; }
.pni-bundle-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px dashed var(--pni-gray-200); padding-top: 1.25rem; }
.pni-bundle-total { font-size: 0.9rem; color: var(--pni-text-sec); }
.pni-bundle-total strong { color: var(--pni-navy); font-size: 1.1rem; }
.pni-bundle-was { font-size: 0.85rem; color: var(--pni-text-muted); text-decoration: line-through; margin-left: 0.5rem; }
.pni-bundle-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pni-bundle-save { font-size: 0.82rem; font-weight: 700; color: #16a34a; background: #DCFCE7; padding: 4px 12px; border-radius: var(--pni-radius-full); }

/* ── BACK IN STOCK ───────────────────────────────── */
.pni-back-in-stock {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--pni-off-white); border: 1px solid var(--pni-gray-200);
  border-radius: var(--pni-radius-lg); padding: 1.5rem;
  margin: 1.5rem 0;
}
.pni-back-in-stock__icon {
  width: 44px; height: 44px; background: var(--pni-navy);
  border-radius: var(--pni-radius); display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.pni-back-in-stock__content h4 { font-size: 0.9rem; font-weight: 700; color: var(--pni-navy); margin-bottom: 0.25rem; }
.pni-back-in-stock__content p  { font-size: 0.82rem; color: var(--pni-text-sec); margin-bottom: 0.75rem; line-height: 1.6; }
.pni-back-in-stock__form { display: flex; gap: 0.5rem; }
.pni-back-in-stock__privacy { font-size: 0.72rem; color: var(--pni-text-muted); margin-top: 0.5rem; }

/* ── FAQ ACCORDION ───────────────────────────────── */
.pni-faq { border: 1px solid var(--pni-gray-200); border-radius: var(--pni-radius-lg); overflow: hidden; }
.pni-faq__item { border-bottom: 1px solid var(--pni-gray-100); }
.pni-faq__item:last-child { border-bottom: none; }
.pni-faq__trigger {
  width: 100%; padding: 1.1rem 1.5rem; background: none; border: none;
  text-align: left; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  font-size: 0.9rem; font-weight: 600; color: var(--pni-navy);
  transition: background 0.2s; font-family: inherit;
}
.pni-faq__trigger:hover { background: var(--pni-off-white); }
.pni-faq__trigger svg, .pni-faq__trigger .pni-faq__arrow { transition: transform 0.25s; flex-shrink: 0; }
.pni-faq__item.is-open .pni-faq__trigger svg,
.pni-faq__item.is-open .pni-faq__trigger .pni-faq__arrow { transform: rotate(180deg); }
.pni-faq__body { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.pni-faq__item.is-open .pni-faq__body { max-height: 400px; }
.pni-faq__body-inner { padding: 0 1.5rem 1.25rem; font-size: 0.875rem; color: var(--pni-text-sec); line-height: 1.75; }

/* ── LOYALTY STRIP ───────────────────────────────── */
.pni-loyalty-strip {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, var(--pni-cream), var(--pni-white));
  border: 1px solid var(--pni-gray-200); border-radius: var(--pni-radius-lg);
  padding: 0.9rem 1.25rem; margin-top: 1rem;
}
.pni-loyalty-strip__icon { font-size: 1.4rem; flex-shrink: 0; }
.pni-loyalty-strip__text { flex: 1; font-size: 0.82rem; color: var(--pni-text-sec); line-height: 1.5; }
.pni-loyalty-strip__text strong { color: var(--pni-navy); }
.pni-loyalty-strip__pts {
  font-family: var(--pni-font-mono, monospace); font-size: 0.82rem; font-weight: 700;
  color: var(--pni-gold-dark, #A3446F); background: var(--pni-cream);
  padding: 4px 12px; border-radius: var(--pni-radius-full);
  border: 1px solid var(--pni-gray-200); flex-shrink: 0;
}

/* ── SPINNER ─────────────────────────────────────── */
.pni-spinner {
  width: 28px; height: 28px; border: 3px solid var(--pni-gray-200);
  border-top-color: var(--pni-gold); border-radius: 50%;
  animation: pniSpin 0.7s linear infinite; margin: 0 auto 0.75rem;
}
@keyframes pniSpin { to { transform: rotate(360deg); } }

/* ── SUCCESS MESSAGE ─────────────────────────────── */
.pni-success { color: #16a34a; font-weight: 600; font-size: 0.875rem; display: flex; align-items: center; gap: 6px; }

/* ── MOBILE: Floating CTA ────────────────────────── */
@media (max-width: 767px) {
  .pni-mobile-buy-cta {
    display: block; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 89; padding: 0.9rem 1rem;
    background: var(--pni-white); border-top: 1px solid var(--pni-gray-100);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
  }
  .pni-mobile-buy-cta .pni-btn { width: 100%; justify-content: center; font-size: 1rem; padding: 0.9rem; }
  body.single-product { padding-bottom: 80px; }
  .pni-quiz__options { grid-template-columns: 1fr 1fr; }
  .pni-quiz__results-grid { grid-template-columns: 1fr 1fr; }
  .pni-gift-quiz { padding: 1.75rem 1.25rem; }
}
