/* ═══════════════════════════════════════
   Catalogo Gres – styles.css
   Minimalist white / editorial style
   ═══════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #ffffff;
  color: #111111;
  min-height: 100dvh;
}



img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
}

/* ── CSS VARS ── */
:root {
  --white: #ffffff;
  --off-white: #f7f6f4;
  --light: #efefed;
  --border: #e2e0dc;
  --mid: #a0a09e;
  --dark: #111111;
  --accent: #1a1a1a;
  --blue: #2563eb;
  /* for active radio / sort icons */
  --radius-sm: 4px;
  --radius-md: 8px;
  --transition: 0.18s ease;
  --sidebar-w: 260px;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  font-size: 18px;
  color: var(--dark);
}

.topbar-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dark);
}

.topbar-logo-img {
  height: 32px;
  width: auto;
  display: block;
  transition: opacity var(--transition);
}

.topbar-logo-img:hover {
  opacity: 0.8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #a0a09e;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.topbar-admin-btn:hover {
  background: var(--off-white);
  color: var(--dark);
  border-color: var(--border);
}

.topbar-admin-btn.logged {
  background: #f0faf5;
  color: #2a9d5c;
  border-color: rgba(42, 157, 92, 0.4);
}

/* ── HERO ── */
.hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  background: #111;
}

/* Sfondo sfocato (Sotto) */
.hero-bg {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  object-fit: cover;
  filter: blur(20px) brightness(0.6);
  opacity: 0.8;
  z-index: 1;
}

/* Immagine centrata (Sopra lo sfondo) */
.hero-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 2;
  animation: heroFadeIn 1.2s ease-out;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Overlay & Contenuto (In primo piano) */
.hero-overlay {
  z-index: 3;
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
}

.hero-content {
  z-index: 4;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bolla effetto vetro (Glassmorphism) */
.hero-logo-bubble {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 30px 50px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 95%;
  transition: transform 0.3s ease;
}

.hero-logo-bubble:hover {
  transform: translateY(-5px);
}

.hero-logo {
  max-width: 640px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* FIX MOBILE (Centratura senza tagli) */
@media (max-width: 640px) {
  .hero { height: 48vh; min-height: 280px; }
  .hero-img { object-fit: contain; height: 92%; }
  .hero-logo-bubble { padding: 16px 28px; border-radius: 12px; }
  .hero-logo { max-width: 160px; max-height: 50px; }
}

/* Mobile adjustments (deprecated by the one above, but kept for general responsiveness) */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100dvh - 53px);
  align-items: start;
}

/* ── SIDEBAR ── */
.sidebar {
  position: sticky;
  top: 53px;
  height: calc(100dvh - 53px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--white);
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sb-section {
  padding: 18px 20px;
}

.sb-divider {
  height: 1px;
  background: var(--border);
}

/* Search */
.sb-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sb-search-icon {
  position: absolute;
  left: 0;
  width: 16px;
  height: 16px;
  color: var(--mid);
  pointer-events: none;
}

.sb-search {
  width: 100%;
  padding: 6px 28px 6px 24px;
  border: none;
  border-bottom: 1.5px solid var(--border);
  background: transparent;
  font-size: 14px;
  color: var(--dark);
  outline: none;
  transition: border-color var(--transition);
}

.sb-search::placeholder {
  color: var(--mid);
}

.sb-search:focus {
  border-color: var(--dark);
}

.sb-search-clear {
  position: absolute;
  right: 0;
  font-size: 11px;
  color: var(--mid);
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.sb-search-clear.visible {
  display: block;
}

/* Section headings */
.sb-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--dark);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}

.sb-chevron {
  width: 14px;
  height: 14px;
  color: var(--mid);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.sb-heading.collapsed .sb-chevron {
  transform: rotate(180deg);
}

/* "Filtra" section title (desktop only) */
.sb-filtra-title {
  padding-bottom: 0;
}

.sb-filtra-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--dark);
}

.sb-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sb-body.hidden {
  display: none;
}

/* Sort radios */
.sb-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sb-radio:hover {
  background: var(--off-white);
}

.sb-radio input[type="radio"] {
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.sb-radio span {
  font-size: 13px;
  color: var(--dark);
}

.sb-radio input:checked+span {
  color: var(--blue);
  font-weight: 500;
}

/* Checkbox list */
.sb-check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sb-check:hover {
  background: var(--off-white);
}

.sb-check input[type="checkbox"] {
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.sb-check span {
  font-size: 13px;
  color: var(--dark);
}

/* Reset button */
.sb-reset {
  font-size: 12px;
  color: var(--mid);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.sb-reset:hover {
  color: var(--dark);
}

/* Mobile filter toggle */
.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  background: var(--white);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-filter-toggle:hover {
  background: var(--off-white);
}

/* Mobile toolbar (search + filtri button, mobile only) */
.mobile-toolbar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.mobile-search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.mobile-search-wrap .sb-search {
  padding-left: 34px;
  width: 100%;
}

.mobile-search-wrap .sb-search-icon {
  position: absolute;
  left: 10px;
  color: var(--mid);
  pointer-events: none;
}

.mobile-search-wrap .sb-search-clear {
  position: absolute;
  right: 8px;
}

/* Sidebar mobile header (title + close button) */
.sb-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sb-mobile-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
}

.sb-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid);
  padding: 4px;
  line-height: 0;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.sb-close-btn:hover {
  color: var(--dark);
  background: var(--off-white);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 199;
}

.sidebar-overlay.visible {
  display: block;
}

/* ── MAIN ── */
#main-content {
  padding: 32px 36px 60px;
}

/* ── STATES ── */
.state-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  text-align: center;
  color: var(--mid);
  font-size: 14px;
}

.state-screen.hidden {
  display: none;
}

.state-icon {
  font-size: 40px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn-primary {
  padding: 10px 24px;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-primary:hover {
  opacity: 0.8;
}

/* ── LOAD MORE ── */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  width: 100%;
}

.load-more-container.hidden {
  display: none;
}

.btn-load-more {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-load-more:hover {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.btn-load-more svg {
  transition: transform 0.2s ease;
}

.btn-load-more:hover svg {
  transform: translateY(2px);
}

/* ── CACHE BANNER ── */
.cache-banner {
  background: #fff8e1;
  color: #856404;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid #ffeeba;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── PRODUCT GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.product-grid.hidden {
  display: none;
}

/* ── PRODUCT CARD ── */
.product-card {
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0;
  transition: background var(--transition);
  background: var(--white);
  outline: none;
}

.product-card:nth-child(odd) {
  border-left: none;
}

.product-card:hover {
  background: var(--off-white);
}

/* Card image */
.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--light);
}

.card-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.4s ease;
}

.product-card:hover .card-image {
  transform: scale(1.03);
}

/* ── Card Carousel ── */
.card-slide {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.card-slide.active {
  opacity: 1;
}

/* Arrow buttons on card */
.card-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 10;
}

.card-arrow:hover {
  background: #fff;
}

.card-arrow-prev {
  left: 8px;
}

.card-arrow-next {
  right: 8px;
}

/* Show arrows on card hover (desktop) or always on touch devices */
.product-card:hover .card-arrow,
.product-card:focus-within .card-arrow {
  opacity: 1;
}

@media (hover: none) {
  .card-arrow {
    opacity: 0.85;
  }
}

/* Counter badge on card */
.card-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 99px;
  z-index: 10;
}

/* ── Modal Carousel ── */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-arrow:hover {
  background: #fff;
}

.modal-arrow-prev {
  left: 12px;
}

.modal-arrow-next {
  right: 12px;
}

.modal-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 99px;
  z-index: 10;
}

/* Placeholder */
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* Card badges */
.card-badge-left {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-badge-right {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* Carousel dots (visual) */
.card-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.card-dot.active {
  background: rgba(255, 255, 255, 0.95);
}

/* Card body */
.card-body {
  padding: 18px 20px 24px;
  border-top: 1px solid var(--border);
}

.card-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 2px;
}

.card-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

.card-collezione {
  font-size: 13px;
  color: var(--mid);
  font-weight: 400;
  margin-bottom: 4px;
}

.card-meta-line {
  font-size: 12px;
  color: #888;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Collection name — frosted white */
.badge-collection {
  background: rgba(255, 255, 255, 0.88);
  color: #111;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  letter-spacing: 0.07em;
}

/* Premium Tech — dark circle with lightning bolt */
.badge-premium-icon {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  background: #111;
  color: #f5d778;
  border: none;
}

.badge-premium {
  background: #111;
  color: #e8d08c;
}

.badge-bookmatch {
  background: rgba(20, 20, 35, 0.80);
  color: #b8ccdf;
  backdrop-filter: blur(4px);
}

/* ── Badge tooltip expand on hover ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(10, 10, 10, 0.88);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Right-side badges: anchor tooltip to the right edge to avoid overflow */
.card-badge-right [data-tooltip]::after {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}

.card-badge-right [data-tooltip]:hover::after {
  transform: translateY(0);
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  max-width: 860px;
  width: 100%;
  max-height: 92dvh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--dark);
}

.modal-close:hover {
  background: var(--off-white);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}

.modal-image-wrap {
  position: relative;
  background: var(--light);
  min-height: 420px;
  overflow: hidden;
}

.modal-img {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
  cursor: zoom-in;
}

.modal-img.hidden {
  display: none;
}

.modal-placeholder {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.modal-img-badges {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-info {
  padding: 36px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Share button */
/* Document buttons row */
.modal-docs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.modal-docs-row:empty {
  display: none;
}

.modal-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: #fafafa;
  color: #222;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.modal-doc-btn:hover {
  background: #fff;
  border-color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modal-doc-btn svg {
  flex-shrink: 0;
  color: #555;
}

.modal-share-btn {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--mid);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  align-self: flex-start;
}

.modal-share-btn:hover {
  border-color: var(--dark);
  color: var(--dark);
}

.modal-share-btn.share-copied {
  border-color: #2a9d5c;
  color: #2a9d5c;
  background: #f0faf5;
}

.modal-collezione {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 10px;
}

.modal-colore {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--dark);
  line-height: 1.15;
  margin-bottom: 6px;
}

.modal-variants-count {
  font-size: 12px;
  color: var(--mid);
  margin-bottom: 24px;
}

.modal-specs {
  flex: 1;
}

/* ── FORMAT BUTTONS ── */
.fmt-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 10px;
}

.fmt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.fmt-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.fmt-btn:hover {
  border-color: var(--dark);
  color: var(--dark);
}

.fmt-btn.active {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--white);
}

.fmt-btn-disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: auto;
}

/* ── VARIANT DETAIL ── */
.fmt-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.12s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.variant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  transition: background var(--transition);
  background: var(--white);
}

.variant-row:hover {
  background: var(--off-white);
}

.vr-sku {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark);
  background: var(--light);
  padding: 3px 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.vr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.vr-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-fmt {
  background: #f0f0ee;
  color: #333;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chip-sp {
  background: var(--light);
  color: #444;
}

.chip-su {
  background: #e8edf5;
  color: #2d4870;
}

.chip-premium {
  background: #111;
  color: #e8d08c;
}

.chip-bookmatch {
  background: #333;
  color: #b8ccdf;
}

.no-variants {
  font-size: 13px;
  color: var(--mid);
  padding: 12px 0;
}

/* ── TOAST ── */
.refresh-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.refresh-toast.show {
  opacity: 1;
}

/* ── HELPERS ── */
.hidden {
  display: none !important;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mid);
}

/* ═══════════ RESPONSIVE ═══════════ */

/* Tablet */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 220px;
  }

  #main-content {
    padding: 24px 24px 60px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100dvh;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
  }

  /* Show sidebar header + close button on mobile */
  .sb-mobile-header {
    display: flex;
  }

  /* Hide desktop search and Filtra title inside sidebar on mobile */
  .sb-search-section,
  .sb-filtra-title {
    display: none;
  }

  /* Show mobile toolbar (search + filtri) */
  .mobile-toolbar {
    display: flex;
  }

  .mobile-filter-toggle {
    display: flex;
  }

  #main-content {
    padding: 16px 16px 60px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── MODAL MOBILE: full-screen scrollabile (identico a Level) ── */
  .modal-overlay {
    padding: 0;
    align-items: flex-end; /* bottom sheet */
  }

  .modal-card {
    border-radius: 16px 16px 0 0;
    max-height: 95dvh;
    height: 95dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    grid-template-columns: 1fr;
    min-height: auto;
    flex: 1;
    overflow-y: auto;  /* ← SCROLL sull'intero body */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .modal-image-wrap {
    min-height: 260px;
    height: 55vw;
    max-height: 300px;
    flex-shrink: 0;
  }

  /* Fix per Mobile in ORIZZONTALE (Landscape) */
  @media (orientation: landscape) and (max-height: 500px) {
    .modal-image-wrap {
      min-height: 180px;
      height: 65vh;
      max-height: 320px;
    }
    .modal-card {
      max-height: 100dvh;
      height: 100dvh;
      border-radius: 0;
    }
  }

  .modal-colore {
    font-size: 20px;
  }

  .modal-info {
    padding: 22px 20px;
    /* su mobile non scroll separato, scorre con modal-body */
    overflow-y: visible;
    max-height: none;
    /* padding per iPhone safe-area (notch) */
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

/* Fix Landscape (iPhone orizzontale: larghezza > 768px, altezza < 500px → forza layout mobile) */
@media (orientation: landscape) and (max-height: 500px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-card {
    border-radius: 0;
    max-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .modal-body {
    grid-template-columns: 1fr;
    min-height: auto;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal-image-wrap {
    min-height: 180px;
    height: 65vh;
    max-height: 320px;
    flex-shrink: 0;
  }
  .modal-info {
    padding: 22px 20px;
    overflow-y: visible;
    max-height: none;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

/* Very small */
@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Wide screens: 3+ columns */
@media (min-width: 1400px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Cache fallback banner ── */
.cache-banner {
  grid-column: 1 / -1;
  background: #fffbe6;
  border: 1px solid #f0d060;
  color: #7a5e00;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

/* ── Blur background dietro immagine principale nel modal ── */
.modal-img-blur {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(28px) brightness(0.75) saturate(1.3);
  transform: scale(1.05);
  pointer-events: none;
  z-index: 0;
}

/* ── CTA "Vedi realizzazione" in fondo all'immagine ── */
.realizzazione-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.65) 0%,
      rgba(0, 0, 0, 0.2) 65%,
      transparent 100%);
  padding: 24px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.18s ease;
}

/* Su schermi con poca altezza (es. landscape), rendiamo la sfumatura più compatta */
@media (max-height: 500px) {
  .realizzazione-cta {
    padding: 12px 15px 8px;
  }
  .realizzazione-cta-icon {
    width: 28px;
    height: 28px;
  }
}

.realizzazione-cta:hover {
  opacity: 0.85;
}

.realizzazione-cta.hidden {
  display: none;
}

.realizzazione-cta-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.realizzazione-cta-text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
}

/* ── PREZZI AREA RISERVATA ── */
.btn-show-price {
  margin-top: 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: #fdf2f2;
  border: 1px dashed #e53e3e;
  border-radius: 8px;
  color: #c53030;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-show-price:hover {
  background: #fff5f5;
  border-color: #c53030;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(197, 48, 48, 0.1);
}

.btn-show-price svg {
  opacity: 0.8;
}

.modal-price-wrap {
  margin-top: 24px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  animation: fadeIn 0.3s ease;
}

.price-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.price-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logout-btn {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.logout-btn:hover {
  color: #ef4444;
}

.price-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-name {
  font-size: 13px;
  color: #64748b;
}

.price-value {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  font-family: 'DM Sans', sans-serif;
}

/* ── Lightbox overlay ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000 !important;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.18s ease;
}

.lightbox-overlay.hidden {
  display: none;
}

.lightbox-img {
  width: 90vw;
  height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.22s ease;
  user-select: none;
}

/* Pulsante chiudi */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.18s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Frecce navigazione */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.18s ease;
  z-index: 1001;
  user-select: none;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.hidden {
  display: none;
}

.lightbox-nav-prev {
  left: 24px;
}

.lightbox-nav-next {
  right: 24px;
}

/* Counter */
.lightbox-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  z-index: 1001;
  pointer-events: none;
}

.lightbox-counter.hidden {
  display: none;
}

/* ── PRICE DISPLAY ── */
.vr-price {
  font-weight: 700;
  color: #c53030;
  font-size: 14px;
  margin-left: auto;
  padding-left: 12px;
}

.modal-price-alert {
  margin-top: 15px;
  padding: 10px;
  background: #fff5f5;
  border-left: 3px solid #fc8181;
  color: #c53030;
  font-size: 12px;
  font-weight: 600;
}