/* ============================================================================
   FairCart — components
   ============================================================================ */

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-fc {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .82rem 1.5rem;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--leaf); color: #fff;
  font-weight: 700; font-size: .93rem; letter-spacing: .005em;
  cursor: pointer; transition: var(--t); white-space: nowrap;
}
.btn-fc:hover  { background: var(--leaf-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--e-leaf); }
.btn-fc:active { transform: translateY(0); }
.btn-fc[disabled], .btn-fc.is-disabled { opacity: .5; pointer-events: none; }

.btn-fc--ghost   { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-fc--ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--e-2); }
.btn-fc--ink     { background: var(--ink); }
.btn-fc--ink:hover { background: var(--ink-2); box-shadow: var(--e-3); }
.btn-fc--amber   { background: var(--amber); color: var(--ink); }
.btn-fc--amber:hover { background: var(--amber-dark); color: var(--ink); box-shadow: var(--e-amber); }
.btn-fc--danger  { background: var(--danger); }
.btn-fc--light   { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-fc--light:hover { background: var(--paper-2); color: var(--ink); }
.btn-fc--on-dark { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); color: #fff; }
.btn-fc--on-dark:hover { background: #fff; color: var(--ink); }
.btn-fc--sm  { padding: .5rem 1rem; font-size: .82rem; }
.btn-fc--lg  { padding:1rem 2rem; font-size: 1rem; }
.btn-fc--block { width: 100%; }

.icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: transparent; color: var(--ink); cursor: pointer; position: relative; transition: var(--t-fast);
}
.icon-btn:hover { background: var(--paper-2); color: var(--leaf); }
.icon-btn__badge {
  position: absolute; top: 2px; right: 0;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--leaf); color: #fff;
  border-radius: var(--r-pill); font-size: .66rem; font-weight: 800;
  border: 2px solid var(--card);
}
.icon-btn__badge--amber { background: var(--amber); color: var(--ink); }

/* ── Chips, pills & badges ──────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .34rem .8rem; border-radius: var(--r-pill);
  background: var(--paper-2); color: var(--text-2);
  font-size: .76rem; font-weight: 700; border: 1px solid transparent;
  transition: var(--t-fast); cursor: pointer; white-space: nowrap;
}
.chip:hover  { background: var(--ink); color: #fff; }
.chip.is-on  { background: var(--leaf); color: #fff; }
.chip--static { cursor: default; }
.chip--static:hover { background: var(--paper-2); color: var(--text-2); }

.badge-fc {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .26rem .62rem; border-radius: var(--r-xs);
  font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.badge-fc--leaf   { background: var(--leaf-wash);  color: var(--leaf-dark); }
.badge-fc--amber  { background: var(--amber-wash); color: var(--amber-dark); }
.badge-fc--coral  { background: var(--coral-wash); color: var(--coral); }
.badge-fc--ink    { background: var(--ink); color: #fff; }
.badge-fc--muted  { background: var(--paper-2); color: var(--text-2); }

/* Status pill used by orders + reseller state */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: var(--r-pill); font-size: .74rem; font-weight: 700; }
.pill--ok     { background: var(--leaf-wash);  color: var(--leaf-dark); }
.pill--warn   { background: var(--amber-wash); color: var(--amber-dark); }
.pill--info   { background: #E8F0F6; color: var(--info); }
.pill--danger { background: var(--coral-wash); color: var(--danger); }
.pill--muted  { background: var(--paper-2); color: var(--text-2); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card-fc {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--e-1);
  transition: var(--t);
}
.card-fc--pad { padding: 1.5rem; }
.card-fc--hover:hover { box-shadow: var(--e-3); transform: translateY(-3px); border-color: var(--line-strong); }

/* ── Product card ───────────────────────────────────────────────────────── */
.p-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
  transition: var(--t); position: relative;
}
.p-card:hover { box-shadow: var(--e-3); transform: translateY(-4px); border-color: var(--line-strong); }

.p-card__media { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--paper-2); }
.p-card__img   { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.p-card:hover .p-card__img { transform: scale(1.055); }

.p-card__badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: .35rem; z-index: 2; }
.p-card__tools  { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: .4rem; z-index: 2;
                  opacity: 0; transform: translateX(8px); transition: var(--t); }
.p-card:hover .p-card__tools, .p-card:focus-within .p-card__tools { opacity: 1; transform: none; }
.p-card__tool {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink); cursor: pointer; backdrop-filter: blur(8px); transition: var(--t-fast);
}
.p-card__tool:hover  { background: var(--ink); color: #fff; border-color: var(--ink); }
.p-card__tool.is-on  { background: var(--coral); border-color: var(--coral); color: #fff; }

.p-card__body { padding: 1rem 1.05rem .5rem; flex: 1; display: flex; flex-direction: column; }
.p-card__brand {
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: .35rem;
}
.p-card__name {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1.3;
  margin: 0 0 .3rem; color: var(--ink);
}
.p-card__name a:hover { color: var(--leaf); }
.p-card__meta { font-size: .78rem; color: var(--text-3); margin-bottom: .6rem; }

.p-card__price { margin-top: auto; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.p-card__price .now  { font-size: 1.22rem; color: var(--ink); }
.p-card__price .was  { font-size: .85rem; color: var(--text-3); text-decoration: line-through; }

/* The reseller strip — the thing that makes this catalogue different. */
.p-card__margin {
  margin: .6rem -1.05rem -.5rem; padding: .6rem 1.05rem;
  background: var(--amber-wash); border-top: 1px solid #F3E3BE;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  font-size: .78rem;
}
.p-card__margin .lbl  { color: var(--amber-dark); font-weight: 700; }
.p-card__margin .val  { font-family: var(--font-display); font-weight: 800; color: var(--ink); }

.p-card__foot { padding: .85rem 1.05rem 1.05rem; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.05rem; }
.field > label, .form-label-fc {
  display: block; font-size: .8rem; font-weight: 700; color: var(--text-2);
  margin-bottom: .38rem; letter-spacing: .01em;
}
.input-fc, .select-fc, .textarea-fc {
  width: 100%; padding: .78rem 1rem;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-family: inherit; font-size: .93rem; transition: var(--t-fast);
}
.input-fc:focus, .select-fc:focus, .textarea-fc:focus {
  outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(18,128,92,.13);
}
.input-fc::placeholder { color: var(--text-3); }
.textarea-fc { min-height: 130px; resize: vertical; }
.select-fc {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237C8899' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.4rem;
}
.field__hint  { font-size: .76rem; color: var(--text-3); margin-top: .3rem; }
.field__error { font-size: .78rem; color: var(--danger); margin-top: .3rem; font-weight: 600; }

/* Radio / checkbox presented as a selectable card */
.opt-card {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--r);
  cursor: pointer; transition: var(--t-fast); background: var(--card);
}
.opt-card:hover { border-color: var(--leaf-light); background: var(--leaf-wash); }
.opt-card input { margin-top: .25rem; accent-color: var(--leaf); flex-shrink: 0; }
.opt-card:has(input:checked) { border-color: var(--leaf); background: var(--leaf-wash); box-shadow: 0 0 0 3px rgba(18,128,92,.10); }
.opt-card__title { font-weight: 700; font-size: .92rem; color: var(--ink); display: flex; align-items: center; gap: .45rem; }
.opt-card__blurb { font-size: .8rem; color: var(--text-2); margin-top: .15rem; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert-fc {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .95rem 1.1rem; border-radius: var(--r); font-size: .88rem;
  border: 1px solid transparent; margin-bottom: 1.1rem;
}
.alert-fc i { margin-top: .15rem; }
.alert-fc--ok     { background: var(--leaf-wash);  color: var(--leaf-dark);  border-color: #BFE3D5; }
.alert-fc--warn   { background: var(--amber-wash); color: var(--amber-dark); border-color: #F3E3BE; }
.alert-fc--danger { background: var(--coral-wash); color: var(--danger);     border-color: #F6D3CC; }
.alert-fc--info   { background: #E8F0F6; color: var(--info); border-color: #C9DDEA; }

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 4000; display: flex; flex-direction: column; gap: .6rem; }
.toast-fc {
  display: flex; align-items: center; gap: .7rem;
  background: var(--ink); color: #fff; padding: .85rem 1.15rem;
  border-radius: var(--r); box-shadow: var(--e-3); font-size: .88rem; font-weight: 600;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1);
  max-width: min(360px, calc(100vw - 40px));
}
.toast-fc--ok i     { color: var(--leaf-light); }
.toast-fc--danger i { color: var(--coral); }
.toast-fc.is-out { animation: toastOut .25s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── Section furniture ──────────────────────────────────────────────────── */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.section__head { margin-bottom: 2.2rem; }
.section__head p { color: var(--text-2); max-width: 62ch; margin: 0; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.35rem;
}

/* ── Star rating ────────────────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 1px; color: var(--amber); font-size: .82rem; }
.stars .off { color: var(--line-strong); }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 4rem 1.5rem; color: var(--text-2);
}
.empty__icon {
  width: 76px; height: 76px; margin: 0 auto 1.2rem; display: grid; place-items: center;
  background: var(--paper-2); border-radius: var(--r-pill); color: var(--text-3); font-size: 1.7rem;
}

/* ── Table ──────────────────────────────────────────────────────────────── */
.table-fc { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-fc th {
  text-align: left; padding: .8rem 1rem; background: var(--paper);
  font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table-fc td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-fc tbody tr:hover { background: var(--paper); }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pager { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-top: 2.5rem; }
.pager a, .pager span {
  min-width: 40px; height: 40px; padding: 0 .7rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: .86rem; font-weight: 700; background: var(--card); color: var(--text-2); transition: var(--t-fast);
}
.pager a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .is-on  { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.pager .is-off { opacity: .4; pointer-events: none; }

/* ── Quantity stepper ───────────────────────────────────────────────────── */
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); overflow: hidden; background: var(--card);
}
.qty button {
  width: 38px; height: 40px; border: 0; background: transparent; color: var(--ink);
  cursor: pointer; font-size: .9rem; transition: var(--t-fast);
}
.qty button:hover { background: var(--paper-2); color: var(--leaf); }
.qty input {
  width: 48px; height: 40px; border: 0; text-align: center;
  font-weight: 700; font-family: var(--font-display); background: transparent; color: var(--ink);
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input[type=number] { -moz-appearance: textfield; }

/* ── Promotional banner carousel ─────────────────────────────────────────
   The artwork is 3:1 with the headline and CTA baked into the LEFT half and
   product imagery on the right. At full width that reads fine, but on a
   phone a 3:1 strip is ~125px tall and the headline becomes unreadable — so
   below 768px the frame goes taller and the crop is biased left, keeping the
   message legible and sacrificing the product shot instead. */
.banner-carousel {
  position: relative;
  margin: 0 auto;
  max-width: var(--container);
  padding-inline: 20px;
}
.banner-carousel__viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--paper-2);
  box-shadow: var(--e-1);
}
.banner-carousel__track {
  display: flex;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.banner-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  display: block;
  aspect-ratio: 3 / 1;
  background: var(--paper-2);
}
.banner-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.banner-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  box-shadow: var(--e-2);
  cursor: pointer;
  opacity: 0;
  transition: var(--t);
  z-index: 2;
}
.banner-carousel:hover .banner-carousel__arrow,
.banner-carousel:focus-within .banner-carousel__arrow { opacity: 1; }
.banner-carousel__arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.banner-carousel__arrow--prev { left: 32px; }
.banner-carousel__arrow--next { right: 32px; }

.banner-carousel__dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
  z-index: 2;
}
.banner-carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 1px 3px rgba(14, 23, 38, .3);
  cursor: pointer;
  transition: var(--t-fast);
}
.banner-carousel__dot:hover { background: rgba(255, 255, 255, .85); }
.banner-carousel__dot.is-on { background: #fff; width: 26px; }

/* ── Standalone promo tile (portrait artwork) ───────────────────────────── */
.promo-tile {
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: var(--e-1);
  transition: var(--t);
}
.promo-tile:hover { box-shadow: var(--e-3); transform: translateY(-3px); }
.promo-tile img { width: 100%; height: auto; display: block; }

@media (max-width: 767.98px) {
  .banner-carousel { padding-inline: 12px; }
  .banner-carousel__slide { aspect-ratio: 5 / 3; }
  .banner-carousel__slide img { object-position: left center; }
  .banner-carousel__arrow { opacity: 1; width: 34px; height: 34px; }
  .banner-carousel__arrow--prev { left: 20px; }
  .banner-carousel__arrow--next { right: 20px; }
}

/* ── Newsletter sign-up gate / popup ──────────────────────────────────────
   locked: covers the shop until an email is given (body.is-gated stops the
   page scrolling from first paint, before any script runs).
   popup:  the same panel, dismissible, shown after a delay. */
body.is-gated, body.nl-open { overflow: hidden; }

.nl-gate {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(14, 23, 38, .58);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  overflow-y: auto;
}
.nl-gate[hidden] { display: none; }
.nl-gate--popup { opacity: 0; transition: opacity .22s ease; }
.nl-gate--popup.is-visible { opacity: 1; }
.nl-gate--locked { background: rgba(14, 23, 38, .72); }

.nl-gate__panel {
  position: relative;
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  width: 100%; max-width: 820px;
  background: var(--card); border-radius: var(--r-xl);
  box-shadow: 0 30px 80px rgba(8, 14, 26, .45);
  overflow: hidden;
  margin: auto;
}
.nl-gate--popup .nl-gate__panel { transform: translateY(14px) scale(.98); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.nl-gate--popup.is-visible .nl-gate__panel { transform: none; }

.nl-gate__art { position: relative; background: var(--leaf-wash); min-height: 100%; }
.nl-gate__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nl-gate__badge {
  position: absolute; left: 1.1rem; top: 1.1rem;
  width: 104px; height: 104px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--amber); color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: .95rem; line-height: 1;
  text-transform: uppercase; text-align: center;
  box-shadow: var(--e-amber); transform: rotate(-8deg);
}
.nl-gate__badge b { font-size: 1.9rem; letter-spacing: -.03em; }
.nl-gate__badge small { font-family: var(--font-sans); font-size: .56rem; font-weight: 700; letter-spacing: .04em; margin-top: .3rem; max-width: 76px; line-height: 1.2; }

.nl-gate__body { padding: 2.4rem 2.3rem 2rem; }
.nl-gate__logo { display: block; height: 34px; width: auto; margin-bottom: 1.4rem; }
.nl-gate__body h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.55rem, 3.2vw, 2.05rem); line-height: 1.12; letter-spacing: -.02em;
  margin: .35rem 0 .7rem; color: var(--ink);
}
.nl-gate__text { color: var(--text-2); font-size: .95rem; line-height: 1.6; margin: 0 0 1.3rem; }

.nl-gate__form { display: flex; gap: .5rem; }
.nl-gate__form .input-fc { flex: 1; min-width: 0; }
.nl-gate__form .btn-fc { white-space: nowrap; }
.nl-gate__error { min-height: 1.2em; margin: .45rem 0 0; font-size: .82rem; font-weight: 600; color: var(--danger); }
.nl-gate__form .input-fc[aria-invalid="true"] { border-color: var(--danger); }

.nl-gate__fine { margin: .6rem 0 0; font-size: .74rem; line-height: 1.5; color: var(--text-3); }
.nl-gate__fine a, .nl-gate__alt a { color: var(--leaf); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.nl-gate__alt { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--text-2); }

.nl-gate__skip {
  display: block; margin: 1rem 0 0; padding: 0; border: 0; background: none;
  font-size: .82rem; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.nl-gate__skip:hover { color: var(--text-2); }

.nl-gate__close {
  position: absolute; top: .8rem; right: .8rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 1.05rem;
  box-shadow: var(--e-2); cursor: pointer; transition: var(--t-fast);
}
.nl-gate__close:hover { background: var(--ink); color: #fff; }

/* Success state */
.nl-gate__done { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.nl-gate__done[hidden] { display: none; }
.nl-gate__tick {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--leaf-wash); color: var(--leaf); font-size: 1.5rem; margin-bottom: .4rem;
}
.nl-gate__code {
  width: 100%; margin: .3rem 0 1.3rem; padding: 1rem;
  border: 2px dashed var(--amber); background: var(--amber-wash); border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
}
.nl-gate__code[hidden] { display: none; }
.nl-gate__code-label { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-dark); }
.nl-gate__code-value {
  border: 0; background: none; cursor: pointer; color: var(--ink);
  font-family: var(--font-mono); font-size: 1.7rem; font-weight: 800; letter-spacing: .14em;
}
.nl-gate__code-value i { font-size: 1rem; color: var(--text-3); letter-spacing: 0; }
.nl-gate__code-hint { font-size: .76rem; color: var(--text-3); }

@media (max-width: 767.98px) {
  .nl-gate { align-items: flex-end; padding: 0; }
  .nl-gate__panel {
    grid-template-columns: 1fr; max-width: none;
    border-radius: var(--r-xl) var(--r-xl) 0 0; margin: auto 0 0;
    max-height: 100dvh; overflow-y: auto;
  }
  .nl-gate__art { min-height: 150px; height: 150px; }
  .nl-gate__badge { width: 84px; height: 84px; top: .8rem; left: .8rem; }
  .nl-gate__badge b { font-size: 1.5rem; }
  .nl-gate__body { padding: 1.5rem 1.3rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .nl-gate__logo { display: none; }
  .nl-gate__form { flex-direction: column; }
  .nl-gate__form .btn-fc { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .nl-gate--popup, .nl-gate--popup .nl-gate__panel { transition: none; }
}

/* ── Newsletter admin ─────────────────────────────────────────────────── */
.nl-admin-tabs a {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  padding: .7rem .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-size: .86rem; font-weight: 700; color: var(--text-2); text-decoration: none;
}
.nl-admin-tabs a:hover { color: var(--ink); }
.nl-admin-tabs a.is-on { color: var(--leaf); border-bottom-color: var(--leaf); }
.nl-admin-tabs__count {
  background: var(--paper-2); color: var(--text-2); border-radius: var(--r-pill);
  padding: .05rem .5rem; font-size: .72rem;
}
.nl-mode { border-radius: var(--r-pill); padding: .08rem .5rem; font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nl-mode--locked { background: var(--coral-wash); color: var(--danger); }
.nl-mode--popup  { background: var(--amber-wash); color: var(--amber-dark); }
.nl-mode--off    { background: var(--paper-2); color: var(--text-3); }

/* Sending progress */
.nl-sending { margin-bottom: 1rem; border-left: 4px solid var(--amber); }
.nl-progress { height: 10px; border-radius: var(--r-pill); background: var(--paper-2); overflow: hidden; margin: 1rem 0 .6rem; }
.nl-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--leaf-light)); border-radius: inherit; transition: width .4s ease; }
.nl-sending__meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; font-weight: 600; }

/* Compose: form on the left, a sticky live preview on the right */
.nl-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.nl-compose__form { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.nl-compose__form [hidden] { display: none !important; }
.nl-step { display: flex; align-items: center; gap: .6rem; font-size: 1rem; margin: 0 0 1rem; }
.nl-step span {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--ink); color: #fff; font-size: .78rem;
}

.nl-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.nl-template input { position: absolute; opacity: 0; pointer-events: none; }
.nl-template__card {
  display: flex; flex-direction: column; gap: .3rem; height: 100%;
  padding: .85rem .9rem; border: 1.5px solid var(--line-strong); border-radius: var(--r);
  cursor: pointer; transition: var(--t-fast); background: var(--card);
}
.nl-template__card i { font-size: 1.05rem; color: var(--leaf); }
.nl-template__card b { font-size: .86rem; }
.nl-template__card small { font-size: .72rem; line-height: 1.4; color: var(--text-3); }
.nl-template__card:hover { border-color: var(--leaf-light); }
.nl-template input:checked + .nl-template__card { border-color: var(--leaf); background: var(--leaf-wash); box-shadow: 0 0 0 3px rgba(18,128,92,.12); }
.nl-template input:focus-visible + .nl-template__card { outline: 3px solid var(--leaf-light); outline-offset: 2px; }

.nl-picker { border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.nl-picker__bar { padding: .65rem; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .5rem; }
.nl-picker__quick { display: flex; flex-wrap: wrap; gap: .35rem; }
.nl-picker__quick .chip { border: 0; }
.nl-picker__list { max-height: 330px; overflow-y: auto; }
.nl-picker__foot { padding: .5rem .8rem; background: var(--paper); border-top: 1px solid var(--line); font-size: .76rem; color: var(--text-3); }
.nl-pick {
  display: grid; grid-template-columns: auto 42px minmax(0, 1fr) auto 24px; align-items: center; gap: .65rem;
  padding: .5rem .8rem; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
}
.nl-pick[hidden] { display: none; }
.nl-pick:last-child { border-bottom: 0; }
.nl-pick:hover { background: var(--paper); }
.nl-pick.is-picked { background: var(--leaf-wash); }
.nl-pick input { accent-color: var(--leaf); width: 16px; height: 16px; }
.nl-pick input:disabled + img { opacity: .45; }
.nl-pick img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: var(--paper-2); }
.nl-pick__name { min-width: 0; line-height: 1.25; }
.nl-pick__name b { display: block; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-pick__name small { font-size: .72rem; color: var(--text-3); }
.nl-pick__price { font-size: .82rem; font-weight: 700; }
.nl-pick__order {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 800; color: #fff; background: var(--leaf);
}
.nl-pick__order:empty { background: transparent; }

.nl-actions__test { display: flex; gap: .5rem; margin-bottom: .9rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.nl-actions__test .input-fc { flex: 1; min-width: 0; }
.nl-actions__main { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

.nl-compose__preview { position: sticky; top: 1rem; min-width: 0; }
.nl-preview { background: var(--paper-2); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.nl-preview__bar { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; background: var(--card); border-bottom: 1px solid var(--line); font-size: .86rem; }
.nl-preview__size { display: flex; background: var(--paper-2); border-radius: var(--r-sm); padding: 3px; }
.nl-preview__size button { border: 0; background: none; padding: .3rem .6rem; border-radius: 7px; color: var(--text-3); cursor: pointer; }
.nl-preview__size button.is-on { background: var(--card); color: var(--ink); box-shadow: var(--e-1); }
.nl-inbox { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; background: var(--card); border-bottom: 1px solid var(--line); }
.nl-inbox__avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: #fff; font-weight: 800; }
.nl-inbox__text { min-width: 0; font-size: .8rem; line-height: 1.35; }
.nl-inbox__text > b { display: block; font-size: .84rem; }
.nl-inbox__text > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.nl-inbox__text > span b { color: var(--ink); font-weight: 700; }
.nl-preview__frame { position: relative; max-height: calc(100vh - 11rem); overflow: auto; display: flex; justify-content: center; }
.nl-preview__frame iframe { display: block; width: 600px; max-width: 100%; min-height: 420px; border: 0; background: #EEF1F5; transition: width .25s ease; }
.nl-preview__loading { position: absolute; top: .8rem; right: .9rem; color: var(--text-3); }
.nl-preview__loading[hidden] { display: none; }

@media (max-width: 1199.98px) {
  .nl-compose { grid-template-columns: 1fr; }
  .nl-compose__preview { position: static; }
  .nl-preview__frame { max-height: none; }
}

/* Subscribers + sign-up settings */
.nl-sources { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.nl-sources .chip b { margin-left: .2rem; }
.nl-filter { display: flex; flex-wrap: wrap; gap: .5rem; padding: .9rem; border-bottom: 1px solid var(--line); }
.nl-filter .input-fc { flex: 1 1 200px; }
.nl-filter .select-fc { flex: 0 1 160px; }
.nl-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .84rem; font-weight: 600; cursor: pointer; }
.nl-consent input { margin-top: .2rem; accent-color: var(--leaf); width: 16px; height: 16px; flex: none; }
.nl-consent small { display: block; font-weight: 400; color: var(--text-3); font-size: .76rem; }

.nl-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.nl-mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.nl-mode-card > span {
  display: flex; flex-direction: column; gap: .3rem; height: 100%;
  padding: 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--r); cursor: pointer; transition: var(--t-fast);
}
.nl-mode-card i { font-size: 1.15rem; color: var(--leaf); }
.nl-mode-card small { font-size: .76rem; line-height: 1.45; color: var(--text-3); }
.nl-mode-card:hover > span { border-color: var(--leaf-light); }
.nl-mode-card input:checked + span { border-color: var(--leaf); background: var(--leaf-wash); box-shadow: 0 0 0 3px rgba(18,128,92,.12); }
.nl-mode-card input:focus-visible + span { outline: 3px solid var(--leaf-light); outline-offset: 2px; }

.nl-locked-note {
  display: flex; gap: .8rem; margin-top: 1rem; padding: 1rem 1.1rem;
  background: var(--amber-wash); border: 1px solid #F3D9A4; border-radius: var(--r); font-size: .84rem; color: #6B4A06;
}
.nl-locked-note[hidden] { display: none; }
.nl-locked-note > i { color: var(--amber-dark); font-size: 1.1rem; margin-top: .1rem; }
.nl-locked-note ul { margin: .5rem 0; padding-left: 1.1rem; }
.nl-locked-note li { margin-bottom: .3rem; }
.nl-locked-note > div > span { color: #8A6A2A; font-size: .8rem; }

.nl-big-number { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.nl-source-bar { font-size: .84rem; }
.nl-source-bar > span { color: var(--text-2); }
.nl-source-bar > b { float: right; }

@media (max-width: 767.98px) {
  .nl-modes { grid-template-columns: 1fr; }
}

/* AI writer box on the newsletter compose page */
.nl-ai { background: var(--leaf-wash); border: 1px dashed var(--leaf); border-radius: var(--r-sm, 10px); padding: .8rem .9rem; margin-bottom: 1rem; }
.nl-ai .textarea-fc { background: #fff; }
