/* Modul „Comandă mâncare” — stiluri theme-agnostic.
   Folosesc variabile CSS din temă (--color-*, --radius) cu fallback-uri,
   ca să arate decent pe orice temă fără ajustări. */
:root {
  --fc-bg:        var(--color-card, #fff);
  --fc-text:      var(--color-text, #1a1a1a);
  --fc-muted:     var(--color-muted, #6b6b6b);
  --fc-border:    var(--color-border, #e5e5e0);
  --fc-accent:    var(--color-accent, #2b6cb0);
  --fc-accent-fg: #fff;
  --fc-radius:    var(--radius, 8px);
  --fc-shadow:    0 12px 40px rgba(0,0,0,.18);
}

/* Butoane add-to-cart + toggle — stil neutru, tema le poate suprascrie */
.fc-add-btn,
.fc-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--fc-radius);
  background: var(--fc-accent); color: var(--fc-accent-fg);
  border: 0; cursor: pointer; font: inherit; font-weight: 600;
}
.fc-add-btn:hover, .fc-toggle-btn:hover { filter: brightness(1.05); }

/* Produs epuizat (urmărit de modulul stoc, stoc ≤ 0) — buton dezactivat, neutru */
.fc-add-btn.fc-soldout {
  background: var(--fc-border); color: var(--fc-muted);
  cursor: not-allowed; filter: none; pointer-events: none;
  position: relative; font-weight: 700; letter-spacing: .02em;
}
.fc-add-btn.fc-soldout::before { content: "•"; margin-right: 2px; color: #b3402f; }

.fc-count {
  display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.25); border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.fc-count[data-fc-empty] { display: none; }

/* Drawer */
.fc-drawer { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.fc-drawer[aria-hidden="false"] { pointer-events: auto; }
.fc-drawer__overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
  opacity: 0; transition: opacity .2s;
}
.fc-drawer[aria-hidden="false"] .fc-drawer__overlay { opacity: 1; }
.fc-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 420px; max-width: 100vw;
  background: var(--fc-bg); color: var(--fc-text);
  display: flex; flex-direction: column;
  box-shadow: var(--fc-shadow);
  transform: translateX(100%); transition: transform .25s ease;
}
.fc-drawer[aria-hidden="false"] .fc-drawer__panel { transform: translateX(0); }
body.fc-drawer-open { overflow: hidden; }

.fc-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--fc-border);
}
.fc-drawer__head h2 { margin: 0; font-size: 18px; }
.fc-drawer__close {
  background: transparent; border: 0; font-size: 28px; line-height: 1;
  cursor: pointer; color: var(--fc-muted); padding: 4px 8px;
}
.fc-drawer__scroll { flex: 1; overflow-y: auto; padding: 16px 20px; }
.fc-closed-note {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
  font-size: 14px; line-height: 1.45;
}

/* Invitație de cont după plasarea comenzii (apare doar cu modulul „members" activ).
   Stilizat aici, theme-agnostic, ca să arate la fel pe orice temă. */
.fc-invite { margin-top: 20px; padding: 15px; border-radius: 14px; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  background: color-mix(in srgb, var(--fc-accent) 8%, var(--fc-bg)); }
.fc-invite__lead { margin: 0; display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; color: var(--fc-text); }
.fc-invite__lead .fc-ic { width: 20px; height: 20px; flex: 0 0 auto; fill: var(--fc-accent); }
.fc-invite__hint { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--fc-muted); }
.fc-invite__pw { border: 1px solid var(--fc-border); border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 14px; background: var(--fc-bg); color: var(--fc-text); }
.fc-invite__pw:focus { outline: none; border-color: var(--fc-accent); }
.fc-invite__msg { margin: 0; font-size: 12.5px; color: #b91c1c; }
.fc-invite__ok { margin: 0; font-size: 13.5px; font-weight: 600; color: #15803d; }
.fc-drawer__foot {
  padding: 14px 20px; border-top: 1px solid var(--fc-border);
  display: flex; flex-direction: column; gap: 10px;
}

/* Listă coș */
.fc-cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.fc-cart-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px;
  align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--fc-border);
}
.fc-cart-item:last-child { border-bottom: 0; }
.fc-cart-item__thumb {
/* Fără poză nu mai rezervăm coloana de 56px — altfel textul ar sta decalat degeaba. */
.fc-cart-item--no-thumb { grid-template-columns: 1fr auto; }
  width: 56px; height: 56px; border-radius: var(--fc-radius);
  background: var(--fc-border) center/cover no-repeat;
}
.fc-cart-item__info { min-width: 0; }
.fc-cart-item__name { font-weight: 600; }
.fc-cart-item__price { color: var(--fc-muted); font-size: 13px; }
.fc-cart-item__remove {
  background: transparent; border: 0; color: var(--fc-muted);
  padding: 4px 0; cursor: pointer; font-size: 12px; text-decoration: underline;
}
.fc-cart-item__right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: end; }
.fc-cart-item__line { font-weight: 700; }
.fc-cart-empty { color: var(--fc-muted); text-align: center; padding: 40px 0; }

.fc-qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--fc-border); border-radius: 99px; overflow: hidden;
}
.fc-qty button {
  background: transparent; border: 0; width: 28px; height: 28px;
  cursor: pointer; font-size: 16px; color: var(--fc-text);
}
.fc-qty span { min-width: 24px; text-align: center; font-weight: 600; font-size: 14px; }

/* Total + butoane */
.fc-total { display: flex; justify-content: space-between; align-items: baseline; }
.fc-total strong { font-size: 18px; }
.fc-sumline { display: flex; justify-content: space-between; font-size: 14px; color: var(--fc-muted, #666); }
.fc-sumline span:last-child { font-weight: 600; }
.fc-ship-hint { margin: 0; font-size: 13px; font-weight: 600; color: var(--fc-accent, #c13a2a); }
.fc-btn {
  border: 0; padding: 12px 16px; border-radius: var(--fc-radius);
  font: inherit; font-weight: 600; cursor: pointer; width: 100%;
}
.fc-btn--primary { background: var(--fc-accent); color: var(--fc-accent-fg); }
.fc-btn--primary:disabled { opacity: .6; cursor: progress; }
.fc-btn--ghost { background: transparent; color: var(--red, var(--accent, var(--fc-accent)));
  border: 1px solid var(--line, var(--fc-border)); width: auto; white-space: nowrap; padding: 0 14px; }
.fc-btn--ghost:disabled { opacity: .6; cursor: progress; }

/* CUI + preluare ANAF */
.fc-cui-row { display: flex; gap: 8px; align-items: stretch; }
.fc-cui-row input { flex: 1; min-width: 0; }
.fc-anaf-msg { margin: 2px 0 0; font-size: 12.5px; color: var(--muted, var(--fc-muted)); }
.fc-anaf-msg--ok { color: #2f7a3e; font-weight: 600; }

/* Autentificare la checkout + „ține-mă minte" */
.fc-login { margin-bottom: 6px; }
.fc-login__toggle { background: none; border: 0; padding: 6px 0; cursor: pointer; font: inherit; font-size: 13.5px;
  color: var(--muted, var(--fc-muted)); text-align: left; }
.fc-login__toggle strong { color: var(--red, var(--accent, var(--fc-accent))); }
.fc-login__form { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-top: 4px;
  border: 1px solid var(--line, var(--fc-border)); border-radius: var(--fc-radius); background: var(--surface-soft, transparent); }
.fc-login__msg { margin: 0; font-size: 12.5px; color: var(--red, #a33); }
.fc-remember { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.fc-remember input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--red, var(--fc-accent)); }

/* Checkout */
.fc-checkout { display: flex; flex-direction: column; gap: 12px; }
.fc-back {
  background: transparent; border: 0; color: var(--fc-muted); cursor: pointer;
  align-self: start; padding: 4px 0; font: inherit;
}
/* Checkout-ul e un flex column scrollabil → copiii NU au voie să se micșoreze,
   altfel segmentele (grid) se strivesc la 0 pe ecrane mici și „dispar". */
.fc-checkout > * { flex-shrink: 0; }
.fc-segment {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--fc-border); border-radius: var(--fc-radius); overflow: hidden;
  flex-shrink: 0;
}
.fc-segment label {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; cursor: pointer; font-weight: 500;
}
.fc-segment label span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fc-segment label .picon { flex: 0 0 auto; width: 18px; height: 18px; }
.fc-segment label:has(input:checked) { background: var(--fc-accent); color: var(--fc-accent-fg); }
.fc-segment input { position: absolute; opacity: 0; pointer-events: none; }
/* Plata cu cardul fără procesator configurat: opțiunea rămâne vizibilă, dar inertă —
   clientul vede că există și că azi nu e disponibilă, în loc să dispară fără explicație. */
.fc-segment label[data-fc-card-off] { opacity: .45; cursor: not-allowed; }
.fc-segment label[data-fc-card-off]:has(input:checked) { background: transparent; color: inherit; }
.fc-pay-off { font-size: 11px; font-weight: 600; text-transform: lowercase; opacity: .8; }
.fc-paylabel { font-size: 13px; font-weight: 600; margin: 4px 0 -4px; }
.fc-pay-hint { font-size: 13px; color: var(--fc-text); opacity: .75; margin: 0; }
.fc-pickup {
  background: var(--fc-border); padding: 10px 12px; border-radius: var(--fc-radius);
  font-size: 13px; color: var(--fc-text); margin: 0;
}
.fc-field { display: flex; flex-direction: column; gap: 4px; }
.fc-field > span { font-size: 13px; font-weight: 600; }
.fc-field input, .fc-field textarea {
  border: 1px solid var(--fc-border); border-radius: var(--fc-radius);
  padding: 10px 12px; font: inherit; background: var(--fc-bg); color: var(--fc-text);
}
.fc-field input:focus, .fc-field textarea:focus { outline: 2px solid var(--fc-accent); outline-offset: 1px; }
.fc-form-error { color: #a33; font-size: 13px; margin: 0; }

/* Done */
.fc-done { text-align: center; padding: 60px 20px; }
.fc-done__check {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--fc-accent); color: var(--fc-accent-fg);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.fc-done__check--fail { background: #8a8a8a; }
.fc-done h3 { margin: 0 0 8px; }
.fc-done p { color: var(--fc-muted); }

@media (max-width: 480px) {
  .fc-drawer__panel { width: 100%; }
}

/* ── Anunț „suntem în vacanță" ──────────────────────────────────────────────
   Modal simplu peste tot site-ul, cu aceleași variabile de temă ca restul modulului.
   z-index PESTE drawer (9000): dacă anunțul apare cât coșul e deschis, trebuie să fie deasupra,
   nu estompat sub panoul lui. */
.fc-vac {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0, 0, 0, .55);
  animation: fc-vac-in .18s ease-out;
}
.fc-vac[hidden] { display: none; }
.fc-vac__box {
  width: 100%; max-width: 440px; text-align: center;
  background: var(--fc-bg); color: var(--fc-text);
  border-radius: calc(var(--fc-radius) * 2); padding: 30px 26px 24px;
  box-shadow: var(--fc-shadow);
  animation: fc-vac-up .22s cubic-bezier(.32, .72, 0, 1);
}
.fc-vac__title { margin: 0 0 10px; font-size: 24px; line-height: 1.2; font-weight: 800; }
.fc-vac__msg { margin: 0 0 22px; font-size: 16.5px; line-height: 1.5; color: var(--fc-muted); }
.fc-vac__ok {
  width: 100%; min-height: 50px; border: 0; cursor: pointer;
  border-radius: var(--fc-radius); padding: 13px 20px;
  background: var(--fc-accent); color: var(--fc-accent-fg);
  font: inherit; font-size: 16px; font-weight: 700;
}
@keyframes fc-vac-in { from { opacity: 0; } }
@keyframes fc-vac-up { from { transform: translateY(14px) scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fc-vac, .fc-vac__box { animation: none; }
}
/* Livrare închisă după ora limită (orders_delivery_until) */
.fc-segment label.is-disabled { opacity: .45; cursor: not-allowed; }
.fc-delivery-hint { margin: 8px 0 0; }

/* Cod de reducere (coduri emise de modulul „momente-nais", validate server-side) */
.fc-coupon .fc-field > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.fc-coupon .fc-field svg { width: 16px; height: 16px; }
.fc-coupon input[name="coupon"] { text-transform: uppercase; letter-spacing: .04em; }
.fc-coupon-msg { margin: 2px 0 8px; font-size: 12.5px; }
.fc-coupon-msg--ok { color: #2f7a3e; font-weight: 600; }
.fc-coupon-msg--err { color: #b91c1c; font-weight: 600; }
.fc-sumline--discount span:last-child { color: #2f7a3e; font-weight: 700; }
/* Personalizare (picant / fără X / extra) sub numele produsului */
.fc-cart-item__mods { font-size: 12.5px; line-height: 1.35; color: var(--fc-muted); margin: 1px 0 2px; }

/* Comandă minimă la livrare: mesaj în coș și la finalizare */
.fc-min-hint { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; background: #FFF4E5; border: 1px solid #F5C77E; color: #7A4B00; font-size: 13px; line-height: 1.4; font-weight: 600; }
.fc-min-hint[hidden] { display: none; }
