/* ═══════════════════════════════════════════════
   NEW CATERING – Catalogo Online
   Design: clean, modern, mobile-first
═══════════════════════════════════════════════ */

:root {
  --nc-red:     #d32f2f;
  --nc-red-dk:  #b71c1c;
  --nc-red-lt:  #ffebee;
  --nc-orange:  #e64a19;
  --nc-gray:    #616161;
  --nc-gray-lt: #f5f5f5;
  --nc-border:  #e0e0e0;
  --nc-text:    #212121;
  --nc-muted:   #757575;
  --nc-white:   #ffffff;
  --nc-green:   #2e7d32;
  --nc-green-lt:#e8f5e9;
  --nc-blue:    #1565c0;
  --nc-blue-lt: #e3f2fd;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.12);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.16);

  --header-h:      64px;
  --action-bar-h:  44px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f9f9f9;
  color: var(--nc-text);
  min-height: 100vh;
}

/* ─── HEADER ─────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nc-red);
  box-shadow: var(--shadow-md);
  height: var(--header-h);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--nc-white);
  color: var(--nc-red);
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--nc-white);
  letter-spacing: .5px;
}

.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,.75);
  letter-spacing: .2px;
}

.branch-select {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  background-color: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px;
  padding: 2px 20px 2px 8px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,.7)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  max-width: 130px;
  letter-spacing: .2px;
  transition: background-color .2s;
}
.branch-select:hover { background-color: rgba(255,255,255,.28); }
.branch-select option { color: #333; background: #fff; }

.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 100px;
  padding: 0 14px;
  gap: 8px;
  transition: background .2s, border-color .2s;
}

.search-wrap:focus-within {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.7);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,.8);
  flex-shrink: 0;
}

#searchInput {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--nc-white);
  font-size: 15px;
  outline: none;
  padding: 10px 0;
}

#searchInput::placeholder { color: rgba(255,255,255,.65); }

.btn-icon {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 50%;
  line-height: 1;
  transition: background .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.2); }

.btn-upload-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.2);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 100px;
  color: var(--nc-white);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
  white-space: nowrap;
}
.btn-upload-header svg { width: 16px; height: 16px; }
.btn-upload-header:hover { background: rgba(255,255,255,.32); }

/* ─── STATUS BAR (nascosta — aggiornata da JS ma non visibile) ─── */
.status-bar { display: none; }

/* ─── ACTION BAR ─────────────────────────────── */
.action-bar {
  background: var(--nc-white);
  border-bottom: 1px solid var(--nc-border);
  position: sticky;
  top: var(--header-h);
  z-index: 91;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--action-bar-h);
}

/* placeholder .badge mantenuto per compatibilità JS */
.badge { display: none; }
.badge-blue, .badge-green, .badge-gray {}

/* ─── ACTION BAR: settori e separatori ────────── */
.sector-divider {
  width: 1px;
  height: 22px;
  background: var(--nc-border);
  margin: 0 4px;
  flex-shrink: 0;
}

.sector-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1.5px solid var(--nc-border);
  background: var(--nc-white);
  font-size: 12px;
  font-weight: 600;
  color: var(--nc-gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.sector-filter-btn:hover {
  border-color: var(--nc-red);
  color: var(--nc-red);
}
.sector-filter-btn.active {
  background: var(--nc-red);
  border-color: var(--nc-red);
  color: #fff;
}

/* Checkboxes settori nel modal */
.sector-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 16px;
}

.empty-state-icon { font-size: 64px; }

.empty-state h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--nc-text);
}

.empty-state p {
  font-size: 15px;
  color: var(--nc-muted);
  max-width: 400px;
  line-height: 1.6;
}

/* ─── ACTION BAR — toggle e futuri filtri catalogo ─── */
.availability-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--nc-border);
  background: var(--nc-white);
  font-size: 13px;
  font-weight: 500;
  color: var(--nc-gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.availability-toggle svg {
  opacity: 0;
  transition: opacity .15s;
}
.availability-toggle:hover {
  border-color: #22c55e;
  color: #22c55e;
}
.availability-toggle:hover svg { opacity: .5; }
.availability-toggle.active {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.availability-toggle.active svg { opacity: 1; }

/* ─── FILTER BAR — chip categoria scrollabili ───── */
.filter-bar {
  background: var(--nc-white);
  border-bottom: 1px solid var(--nc-border);
  position: sticky;
  top: calc(var(--header-h) + var(--action-bar-h));
  z-index: 90;
}

.filter-scroll {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--nc-border);
  background: var(--nc-white);
  font-size: 13px;
  font-weight: 500;
  color: var(--nc-gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}

.filter-chip:hover {
  border-color: var(--nc-red);
  color: var(--nc-red);
}

.filter-chip.active {
  background: var(--nc-red);
  border-color: var(--nc-red);
  color: var(--nc-white);
}

/* ─── CATALOG MAIN ───────────────────────────── */
.catalog {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ─── CATEGORIA SEZIONE ──────────────────────── */
.cat-section {
  margin-bottom: 24px;
  background: var(--nc-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--nc-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  background: var(--nc-white);
  transition: background .15s;
}
.cat-header:hover { background: #fafafa; }

.cat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-icon { font-size: 22px; }

.cat-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--nc-text);
}

.cat-count {
  font-size: 12px;
  color: var(--nc-muted);
  font-weight: 400;
}

.cat-arrow {
  width: 20px;
  height: 20px;
  color: var(--nc-muted);
  transition: transform .25s;
  flex-shrink: 0;
}

.cat-section.collapsed .cat-arrow { transform: rotate(-90deg); }

.cat-body {
  border-top: 1px solid var(--nc-border);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  transition: all .25s;
}

.cat-section.collapsed .cat-body { display: none; }

/* ─── PRODUCT CARD ───────────────────────────── */
.product-card {
  border: 1.5px solid var(--nc-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--nc-white);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #bdbdbd;
}

.product-card.out-of-stock {
  opacity: .62;
  filter: grayscale(.3);
}

.product-card.out-of-stock .product-img-wrap { background: #f0f0f0; }

/* ── Immagine prodotto ── */
.product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  box-sizing: border-box;
}

.product-placeholder-icon {
  font-size: 40px;
  opacity: .35;
}

/* Badge disponibilità angolo superiore */
.product-stock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.badge-in-stock {
  background: var(--nc-green);
  color: var(--nc-white);
}

.badge-on-order {
  background: rgba(0,0,0,.55);
  color: var(--nc-white);
}

/* ── Corpo card ── */
.product-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Nome marchio sotto immagine ── */
.product-brand-name {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--nc-red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-code-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.product-code {
  font-size: 10px;
  color: var(--nc-muted);
  font-family: 'SF Mono', 'Consolas', monospace;
  letter-spacing: .3px;
  flex-shrink: 0;
}

.product-tablet-name {
  font-size: 10px;
  color: var(--nc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.product-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--nc-text);
  line-height: 1.35;
  /* Tronca a 3 righe */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--nc-border);
}

.product-unit {
  font-size: 10px;
  color: var(--nc-muted);
}

.product-qty {
  font-size: 12px;
  font-weight: 700;
  color: var(--nc-green);
}

.product-qty.zero {
  color: var(--nc-muted);
  font-size: 10px;
  font-weight: 500;
  font-style: italic;
}

/* ─── NO RESULTS ─────────────────────────────── */
.no-results {
  text-align: center;
  padding: 60px 24px;
  color: var(--nc-muted);
}
.no-results h3 { font-size: 18px; margin-bottom: 8px; color: var(--nc-text); }
.no-results p  { font-size: 14px; }

/* ─── UPLOAD PANEL ───────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.upload-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 210;
  width: min(520px, calc(100vw - 32px));
  background: var(--nc-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.upload-panel-inner {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-panel h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--nc-text);
}

.upload-panel p {
  font-size: 14px;
  color: var(--nc-muted);
  line-height: 1.6;
}

.drop-zone {
  border: 2px dashed var(--nc-border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--nc-red);
  background: var(--nc-red-lt);
}

.drop-zone svg {
  width: 40px;
  height: 40px;
  color: var(--nc-muted);
}

.drop-zone p {
  font-size: 14px;
  color: var(--nc-muted);
}

.btn-file-label {
  display: inline-block;
  padding: 8px 20px;
  background: var(--nc-red);
  color: var(--nc-white);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-file-label:hover { background: var(--nc-red-dk); }

.file-name-display {
  font-size: 13px;
  color: var(--nc-green);
  font-weight: 600;
  min-height: 18px;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 12px;
  color: var(--nc-muted);
  font-size: 14px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--nc-border);
  border-top-color: var(--nc-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-result {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}

.upload-result.success {
  background: var(--nc-green-lt);
  color: var(--nc-green);
}

.upload-result.error {
  background: #ffebee;
  color: var(--nc-red);
}

.upload-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── PULSANTI ───────────────────────────────── */
.btn-primary {
  padding: 10px 24px;
  background: var(--nc-red);
  color: var(--nc-white);
  border: none;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-primary:hover { background: var(--nc-red-dk); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary.btn-large { padding: 14px 32px; font-size: 16px; }

.btn-secondary {
  padding: 10px 24px;
  background: transparent;
  color: var(--nc-gray);
  border: 1.5px solid var(--nc-border);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-secondary:hover { border-color: var(--nc-gray); color: var(--nc-text); }

/* ─── FOOTER ─────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  color: var(--nc-muted);
  border-top: 1px solid var(--nc-border);
}
.footer a { color: var(--nc-red); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ─── SEARCH HIGHLIGHT ───────────────────────── */
.highlight {
  background: #fff59d;
  border-radius: 2px;
  padding: 0 1px;
}

/* ─── AUTH AREA ──────────────────────────────── */
.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.login-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-inline input {
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 100px;
  color: var(--nc-white);
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  width: 130px;
  transition: background .2s, border-color .2s;
}

.login-inline input::placeholder { color: rgba(255,255,255,.6); }
.login-inline input:focus {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.7);
}

.btn-login {
  padding: 8px 16px;
  background: rgba(255,255,255,.22);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 100px;
  color: var(--nc-white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.btn-login:hover { background: rgba(255,255,255,.35); }

.login-error {
  font-size: 12px;
  color: #ffcdd2;
  white-space: nowrap;
}

/* User badge (loggato) */
.user-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
}
.user-badge:hover { background: rgba(255,255,255,.28); }

.user-badge-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--nc-white);
}

.user-badge-role {
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,.25);
  color: var(--nc-white);
  padding: 2px 7px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.user-chevron {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,.8);
  transition: transform .2s;
}
.user-badge.open .user-chevron { transform: rotate(180deg); }

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--nc-white);
  border: 1px solid var(--nc-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  z-index: 200;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--nc-text);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--nc-gray-lt); }
.dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.dropdown-item-danger { color: var(--nc-red); }
.dropdown-item-danger:hover { background: var(--nc-red-lt); }

/* ─── MODAL PRODOTTO ─────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  padding: 16px;
}

.modal-box {
  background: var(--nc-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(540px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--nc-gray-lt);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 14px;
  cursor: pointer;
  color: var(--nc-gray);
  transition: background .15s;
  line-height: 1;
}
.modal-close:hover { background: var(--nc-border); }

/* Foto */
.modal-photo-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #fff8e1, #fff3e0);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-photo-placeholder {
  font-size: 64px;
  opacity: .3;
}

.modal-photo-upload-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.55);
  color: var(--nc-white);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .15s;
}
.modal-photo-upload-btn:hover { background: rgba(0,0,0,.75); }
.modal-photo-upload-btn svg { width: 14px; height: 14px; }

/* ── Riga label + bottone ⚑ ── */
.modal-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-flag-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #e67e22;
  background: transparent;
  color: #e67e22;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s, color .15s;
  padding: 0;
}
.alert-flag-btn:hover,
.alert-flag-btn.alert-flag-sent { background: #e67e22; color: #fff; }

/* Flag sulla foto (angolo superiore sinistro) */
.modal-photo-wrap .alert-flag-btn {
  position: absolute;
  top: 8px;
  left: 8px;
}

/* ── Popup segnalazione ── */
.alert-popup {
  position: absolute;
  z-index: 200;
  background: #fff;
  border: 1.5px solid #e67e22;
  border-radius: 10px;
  padding: 12px 14px;
  width: 250px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.alert-popup-title { font-size: 12px; font-weight: 700; color: #e67e22; margin-bottom: 6px; }
.alert-popup-field { font-size: 11px; color: var(--nc-text); margin-bottom: 8px; }
.alert-popup-note {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--nc-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  resize: none;
  font-family: inherit;
  margin-bottom: 8px;
}
.alert-popup-note:focus { outline: none; border-color: #e67e22; }
.alert-popup-actions { display: flex; gap: 8px; }
.alert-popup-send {
  flex: 1;
  padding: 6px;
  background: #e67e22;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.alert-popup-send:hover { background: #cf6d17; }
.alert-popup-cancel {
  padding: 6px 10px;
  background: var(--nc-bg);
  border: 1.5px solid var(--nc-border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--nc-muted);
}

/* URL foto */
.modal-photo-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0 2px;
}
.modal-photo-url-input {
  flex: 1;
  font-size: 12px;
}

/* Badge stock */
.modal-stock-badge {
  display: inline-flex;
  align-self: flex-start;
}
.modal-stock-badge .badge-in-stock,
.modal-stock-badge .badge-on-order {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

/* Campi */
.modal-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-field-row--half {
  flex-direction: row;
  gap: 16px;
}
.modal-field-row--half > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.modal-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--nc-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.modal-code-val {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 13px;
  color: var(--nc-muted);
}

.modal-name-view {
  font-size: 20px;
  font-weight: 800;
  color: var(--nc-text);
  line-height: 1.2;
}

.modal-desc-internal {
  font-size: 12px;
  color: var(--nc-muted);
  font-style: italic;
}

.modal-value-chip {
  font-size: 14px;
  font-weight: 700;
  color: var(--nc-text);
}

.modal-text-view {
  font-size: 14px;
  color: var(--nc-gray);
  line-height: 1.6;
}
.modal-text-view:empty::before { content: '—'; color: var(--nc-border); }

.modal-recipe-view { font-style: italic; }

.modal-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--nc-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.modal-input:focus { border-color: var(--nc-red); }

.modal-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--nc-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
}
.modal-textarea:focus { border-color: var(--nc-red); }

/* Scheda tecnica */
.modal-techsheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-techsheet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--nc-blue-lt);
  color: var(--nc-blue);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.btn-techsheet:hover { background: #bbdefb; }
.btn-techsheet svg { width: 14px; height: 14px; }

.btn-upload-small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--nc-gray-lt);
  border: 1.5px solid var(--nc-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--nc-gray);
  cursor: pointer;
  transition: background .15s;
}
.btn-upload-small:hover { background: var(--nc-border); }
.btn-upload-small svg { width: 13px; height: 13px; }

.modal-empty-hint {
  font-size: 13px;
  color: var(--nc-muted);
  font-style: italic;
}

/* Cross-selling pills */
.modal-cross-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cross-pill {
  padding: 4px 10px;
  background: var(--nc-gray-lt);
  border-radius: 100px;
  font-size: 12px;
  color: var(--nc-text);
  cursor: pointer;
  border: 1.5px solid var(--nc-border);
  transition: background .15s;
}
.cross-pill:hover { background: var(--nc-red-lt); border-color: var(--nc-red); color: var(--nc-red); }

/* Admin actions */
.modal-admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--nc-border);
}

.modal-save-msg {
  font-size: 13px;
  color: var(--nc-green);
  font-weight: 600;
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
  .login-inline input { width: 100px; }
  .login-inline input[type="email"] { display: none; }
}

@media (max-width: 600px) {
  .brand-sub { display: none; }

  .login-inline { display: none; }
  .user-badge-name { display: none; }

  .cat-body {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: 12px;
    gap: 10px;
  }

  .modal-box { padding: 16px; }
  .modal-name-view { font-size: 17px; }
}

@media (min-width: 900px) {
  .cat-body {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  }
}

@media (min-width: 1200px) {
  .cat-body {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  }
}

/* ─── CARD OVERLAYS ──────────────────────────── */

/* Tag dietetici – lato destro sull'immagine */
.card-dietary-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 2;
}

.card-dietary-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  line-height: 1;
}

/* Logo marchio – angolo inferiore sinistro */
.card-brand-logo {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: rgba(255,255,255,.92);
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  z-index: 2;
}

/* ─── MODAL – BRAND LOGO OVERLAY ─────────────── */
.modal-brand-logo-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

/* ─── MODAL – SELECT ─────────────────────────── */
.modal-select {
  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='%23757575' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ─── MODAL – CODE INPUT ─────────────────────── */
.modal-code-input {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 13px;
}

/* ─── DIETARY CHECKBOXES (modal edit) ────────── */
.dietary-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dietary-check-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--nc-text);
  cursor: pointer;
  padding: 5px 10px;
  border: 1.5px solid var(--nc-border);
  border-radius: 100px;
  transition: border-color .15s, background .15s;
}

.dietary-check-label:hover {
  border-color: var(--nc-red);
  background: var(--nc-red-lt);
}

.dietary-check-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--nc-red);
  cursor: pointer;
}

/* ─── DIETARY VIEW PILLS (modal read-only) ───── */
.dietary-view-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dietary-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--nc-green-lt);
  color: var(--nc-green);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   SHARE – Bottone card
═══════════════════════════════════════════ */
.card-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--nc-muted);
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.card-share-btn:hover { color: var(--nc-red); background: var(--nc-gray-lt); }
.card-share-btn svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════
   SHARE – Bottone modal
═══════════════════════════════════════════ */
.modal-share-btn {
  position: absolute;
  top: 12px;
  right: 52px; /* sinistra rispetto al modal-close (14px + 30px + 8px) */
  background: var(--nc-gray-lt);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--nc-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  padding: 0;
}
.modal-share-btn:hover { background: var(--nc-border); color: var(--nc-red); }
.modal-share-btn svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════
   SHARE – Popup condivisione
═══════════════════════════════════════════ */
.share-popup {
  background: var(--nc-white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.08);
  padding: 10px 8px;
  min-width: 210px;
  z-index: 9999;
}
.share-popup-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--nc-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--nc-border);
  margin-bottom: 6px;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .12s;
  color: var(--nc-text);
}
.share-btn:hover { background: var(--nc-gray-lt); }
.share-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.share-wa    { color: #25D366; }
.share-email { color: #EA4335; }
.share-fb    { color: #1877F2; }
.share-copy  { color: var(--nc-gray); }
