:root{
  --fz-pink-500:#C40044;
  --fz-pink-400:#E23C4A;
  --fz-ink:#16181c;
  --fz-muted:#596171;
  --fz-border:rgba(22,24,28,.10);
  --fz-shadow:0 10px 28px rgba(22,24,28,.08);
  --fz-shadow-hover:0 14px 36px rgba(22,24,28,.12);
  --fz-green:#27ae60;
  --fz-green-light:#2ecc71;
}

/* ============================================
   TRIGGER BANNER — compact gift prompt
   ============================================ */
.fg-trigger-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:0 0 20px;
  padding:16px 20px;
  background:#fff;
  border:2px solid var(--fz-border);
  border-radius:14px;
  box-shadow:var(--fz-shadow);
  cursor:pointer;
  transition:all .25s ease;
}

.fg-trigger-banner:hover{
  box-shadow:var(--fz-shadow-hover);
  transform:translateY(-1px);
}

/* Pending state — pink accent border with subtle glow */
.fg-trigger-banner--pending{
  border-color:rgba(196,0,68,.3);
  background:linear-gradient(135deg,#fff5f7 0%,#fff 100%);
}

.fg-trigger-banner--pending:hover{
  border-color:rgba(196,0,68,.5);
}

/* Selected state — green accent */
.fg-trigger-banner--selected{
  border-color:rgba(39,174,96,.3);
  background:linear-gradient(135deg,#f0fdf4 0%,#fff 100%);
}

.fg-trigger-banner--selected:hover{
  border-color:rgba(39,174,96,.5);
}

.fg-trigger-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  flex:1;
}

.fg-trigger-icon-wrap{
  position:relative;
  flex-shrink:0;
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  background:rgba(196,0,68,.08);
}

.fg-trigger-banner--selected .fg-trigger-icon-wrap{
  background:rgba(39,174,96,.08);
}

.fg-trigger-icon{
  font-size:22px;
  line-height:1;
}

/* Pulsing dot for pending */
.fg-trigger-pulse{
  position:absolute;
  top:-2px;
  right:-2px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:var(--fz-pink-500);
  border:2px solid #fff;
  animation:fgPulse 1.8s ease infinite;
}

@keyframes fgPulse{
  0%,100%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(1.4); opacity:.5; }
}

.fg-trigger-text{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}

.fg-trigger-kicker{
  font-size:10px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--fz-pink-500);
  font-weight:700;
}

.fg-trigger-banner--selected .fg-trigger-kicker{
  color:var(--fz-green);
}

.fg-trigger-title{
  font-size:15px;
  font-weight:800;
  color:var(--fz-ink);
  line-height:1.3;
}

.fg-trigger-sub{
  font-size:12px;
  color:var(--fz-muted);
  line-height:1.3;
}

.fg-trigger-btn{
  flex-shrink:0;
  padding:11px 22px;
  border:none;
  border-radius:10px;
  background:linear-gradient(135deg,var(--fz-pink-500),var(--fz-pink-400));
  color:#fff;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:filter .15s ease, transform .1s ease;
  white-space:nowrap;
  display:flex;
  align-items:center;
  gap:4px;
}

.fg-trigger-banner--selected .fg-trigger-btn{
  background:linear-gradient(135deg,var(--fz-green),var(--fz-green-light));
}

.fg-trigger-btn:hover{ filter:brightness(.92); }
.fg-trigger-btn:active{ transform:scale(.97); }


/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */
.fg-modal-overlay{
  position:fixed;
  inset:0;
  z-index:999999;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  opacity:0;
  transition:opacity .25s ease;
}

.fg-modal-overlay.fg-modal-visible{
  opacity:1;
}

.fg-modal{
  position:relative;
  width:100%;
  max-width:700px;
  max-height:85vh;
  background:#fff;
  border-radius:20px;
  box-shadow:0 25px 60px rgba(0,0,0,.2);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transform:translateY(20px) scale(.97);
  transition:transform .3s cubic-bezier(.34,1.56,.64,1);
}

.fg-modal-overlay.fg-modal-visible .fg-modal{
  transform:translateY(0) scale(1);
}


/* ---- Modal Header ---- */
.fg-modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:22px 26px 16px;
  background:linear-gradient(135deg,var(--fz-pink-500),var(--fz-pink-400));
  color:#fff;
}

.fg-modal-kicker{
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  opacity:.8;
  font-weight:600;
  margin-bottom:4px;
}

.fg-modal-title{
  margin:0;
  font-size:22px;
  font-weight:800;
  line-height:1.2;
}

.fg-modal-note{
  margin:6px 0 0;
  font-size:13px;
  opacity:.88;
  line-height:1.45;
}

.fg-modal-close{
  background:rgba(255,255,255,.18);
  border:none;
  color:#fff;
  width:36px;
  height:36px;
  border-radius:50%;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  margin-left:14px;
  transition:background .15s ease;
}

.fg-modal-close:hover{ background:rgba(255,255,255,.35); }


/* ---- Modal Body ---- */
.fg-modal-body{
  padding:18px 26px 22px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}


/* ---- Selection Counter ---- */
.fg-modal-counter{
  margin-bottom:14px;
}

.fg-counter-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 14px;
  border-radius:999px;
  background:rgba(196,0,68,.08);
  color:var(--fz-pink-500);
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
}

.fg-counter-badge--done{
  background:rgba(39,174,96,.1);
  color:var(--fz-green);
}


/* ---- Modal Footer ---- */
.fg-modal-footer{
  padding:12px 26px 16px;
  border-top:1px solid rgba(0,0,0,.06);
  background:#fafafa;
}

.fg-modal-footer-note{
  display:flex;
  align-items:flex-start;
  gap:8px;
  font-size:11px;
  color:#888;
  line-height:1.4;
}

.fg-modal-footer-note svg{
  flex-shrink:0;
  margin-top:1px;
  color:#aaa;
}


/* ============================================
   FREEBIE CARDS
   ============================================ */
.fg-freebie-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(145px,1fr));
  gap:14px;
}

.fg-freebie-card{
  position:relative;
  background:#fff;
  border:2px solid var(--fz-border);
  border-radius:14px;
  padding:10px;
  box-shadow:0 4px 14px rgba(22,24,28,.04);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.fg-freebie-card:hover{
  transform:translateY(-3px);
  box-shadow:var(--fz-shadow-hover);
  border-color:rgba(196,0,68,.3);
}

.fg-freebie-card.selected{
  border-color:rgba(39,174,96,.5);
  box-shadow:0 0 0 3px rgba(39,174,96,.12), var(--fz-shadow-hover);
}

.fg-freebie-card.selected:hover{
  border-color:rgba(39,174,96,.6);
}


/* ---- Card Ribbon ---- */
.fg-card-ribbon{
  position:absolute;
  top:12px;
  right:-30px;
  padding:3px 36px;
  background:var(--fz-green);
  color:#fff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.08em;
  transform:rotate(45deg);
  z-index:2;
  box-shadow:0 2px 6px rgba(0,0,0,.12);
}


/* ---- Card Content ---- */
.fg-thumb{
  border-radius:10px;
  overflow:hidden;
  background:#f6f7f9;
  border:1px solid rgba(22,24,28,.06);
}

.fg-thumb img{
  display:block;
  width:100%;
  height:auto;
}

.fg-card-info{
  flex-grow:1;
  padding:2px 0;
}

.fg-title{
  margin:8px 0 4px;
  font-size:13px;
  line-height:1.25;
  font-weight:700;
  color:var(--fz-ink);
  min-height:2.5em;
  overflow:hidden;
}

.fg-price-saved{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
}

.fg-price-was{
  font-size:12px;
  color:#999;
  text-decoration:line-through;
}

.fg-price-free{
  font-size:11px;
  font-weight:800;
  color:var(--fz-green);
  background:rgba(39,174,96,.1);
  padding:2px 7px;
  border-radius:4px;
  letter-spacing:.04em;
}


/* ---- Buttons ---- */
.fg-select-btn{
  width:100%;
  padding:10px 12px;
  border:none;
  border-radius:10px;
  background:linear-gradient(135deg,var(--fz-pink-500),var(--fz-pink-400));
  color:#fff;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  transition:filter .15s ease, transform .1s ease;
}

.fg-select-btn:hover{ filter:brightness(.92); }
.fg-select-btn:active{ transform:scale(.97); }
.fg-select-btn:disabled{
  opacity:.65;
  cursor:not-allowed;
  filter:grayscale(.2);
}

.fg-badge-selected{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(39,174,96,.1);
  color:var(--fz-green);
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(39,174,96,.25);
}


/* ---- Inline badge for cart ---- */
.fg-inline-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(196,0,68,.1);
  color:#b6002b;
  font-size:12px;
  font-weight:800;
  line-height:1.4;
  vertical-align:middle;
  border:1px solid rgba(196,0,68,.2);
}


/* ============================================
   LOADING SPINNER
   ============================================ */
.fg-select-btn.fg-loading{
  position:relative;
  color:transparent;
}

.fg-select-btn.fg-loading::after{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:18px;
  height:18px;
  margin:-9px 0 0 -9px;
  border:2.5px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:fgSpin .6s linear infinite;
}

@keyframes fgSpin{
  to{ transform:rotate(360deg); }
}


/* ============================================
   ANIMATIONS
   ============================================ */
.animate-in{
  animation:fgFadeInSlide .45s ease-out;
}

@keyframes fgFadeInSlide{
  0%{opacity:0;transform:translateY(-6px)}
  100%{opacity:1;transform:translateY(0)}
}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width:600px){
  .fg-modal{
    max-width:100%;
    max-height:90vh;
    border-radius:18px 18px 0 0;
    margin-top:auto;
  }
  .fg-modal-overlay{
    align-items:flex-end;
    padding:0;
  }
  .fg-modal-header{ padding:18px 16px 12px; }
  .fg-modal-title{ font-size:19px; }
  .fg-modal-body{ padding:14px 16px 18px; }
  .fg-modal-footer{ padding:12px 16px 14px; }
  .fg-freebie-grid{ grid-template-columns:repeat(2,1fr); gap:10px; }

  .fg-trigger-banner{
    flex-direction:column;
    gap:12px;
    text-align:center;
    padding:14px;
  }
  .fg-trigger-left{
    flex-direction:column;
    align-items:center;
  }
  .fg-trigger-text{ align-items:center; }
  .fg-trigger-title{ white-space:normal; text-align:center; }
  .fg-trigger-btn{ width:100%; justify-content:center; }
}

@media (max-width:380px){
  .fg-freebie-grid{ grid-template-columns:1fr; }
}
