/* ═══════════════════════════════════════
   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;
}

/* ── LOAD MORE ── */
.load-more-btn {
  display: block;
  margin: 40px auto;
  padding: 14px 40px;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.load-more-btn:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── 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-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

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

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

.admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--mid);
  transition: all var(--transition);
  opacity: 0.6;
}

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

.admin-btn.active {
  color: var(--blue);
  opacity: 1;
}




/* ── HERO ── */
.hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  background: #000;
  display: block; /* Ora sempre visibile */
}

/* 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 principale 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;
}

/* 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: 90%;
  transition: transform 0.3s ease;
}

.hero-logo-bubble:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.12);
}

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

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

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

/* ── SIDEBAR (Solo Desktop) ── */
@media (min-width: 641px) {
  .sidebar {
    position: -webkit-sticky !important; /* Supporto Safari */
    position: sticky !important;
    top: 110px !important; /* Allineamento con margine sotto menu WordPress (110px) */
    height: fit-content;
    max-height: calc(100vh - 130px) !important; /* Calibrato per il nuovo top di 110px */
    overflow-y: auto !important;
    z-index: 10 !important;
  }
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--white);
  padding: 0;
  scrollbar-width: none; /* Nasconde scrollbar Firefox */
  -ms-overflow-style: none; /* Nasconde scrollbar IE/Edge */
}

/* Nasconde scrollbar sidebar su Chrome/Safari */
.sidebar::-webkit-scrollbar {
  display: none;
}

/* Fix per permettere il corretto funzionamento di position:sticky in WordPress/Elementor */
.page-wrapper, .elementor-section, .elementor-column, .elementor-widget-wrap {
  overflow: visible !important;
}

.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.45);
  z-index: 9999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.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;
}

/* ── 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;
  /* Performance hints */
  will-change: background;
}

.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; -- Vecchio layout verticale */
  aspect-ratio: 4 / 5;
  /* Ripristinato aspetto verticale originale */
  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;
  will-change: transform;
}

.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;
}

/* Realizzazioni in card: zoom per riempire senza bande laterali */
.card-slide-realizzazione {
  object-fit: cover;
  /* transform: scale(1.18); -- Ridotto zoom per orizzontali */
  transform: scale(1.05);
  transform-origin: center center;
}

.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 */
/* Collection name — clean white card style */
.badge-collection {
  background: #ffffff;
  color: #111111;
  border: 1.5px solid #e2e0dc;
  font-weight: 700;
  padding: 5px 12px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* 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: 960px;
  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);
}

/* Modal FORMATO label uppercase tracking */
.fmt-label {
  margin-top: 20px;
}

.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: 42% 58%;
  /* Immagine più compatta, più spazio per i dati */
  max-width: 100%;
  min-height: 500px;
}

.modal-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  /* Occupa tutta l'altezza del pannello */
  overflow: hidden;
  background: var(--light);
}

/* Sfondo sfocato molto leggero per non disturbare, ma riempire i vuoti */
.modal-img-blur {
  display: none;
}

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

/* Realizzazione: stessa cosa ma con cursor pointer per aprire lightbox */
.modal-img.realizzazione-thumb {
  cursor: zoom-in;
}

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

.modal-placeholder {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 420px;
}

/* ── LIGHTBOX ── */
.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;
}

.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 ── */
.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;
}

.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;
}


/* ── CTA 'Vedi realizzazione' (sempre visibile in fondo all'immagine) ── */
.realizzazione-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  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);
}

.modal-img-badges {
  display: none !important;
}

.modal-info {
  padding: 40px 40px 60px;
  background: var(--white);
  overflow-y: auto;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 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: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
}

.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);
}

/* ── 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-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: 10000;
    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 only "Filtra" title desktop inside sidebar on mobile */
  .sb-filtra-title {
    display: none;
  }

  /* Show search in mobile sidebar if user wants it */
  .sb-search-section {
    display: block !important;
    padding: 8px 20px 16px;
  }

  /* 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 ── */
  .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: 160px;
      height: 45vh;
      max-height: 200px;
    }
    .modal-card {
      max-height: 100dvh;
      height: 100dvh;
      border-radius: 0;
    }
  }

  .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));
  }

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

  /* Pulsanti fmt più grandi per touch */
  .fmt-btn {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 42px;
  }

  /* Variant rows più alte su touch */
  .variant-row {
    padding: 12px 12px;
  }

  /* Share button touch-friendly */
  .modal-share-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  /* Bottone close sempre visibile */
  .modal-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  }

  /* Floating filter button */
  .floating-filter-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    background: #111;
    color: white;
    border-radius: 50%;
    display: none !important; /* Managed by JS */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 150;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: none;
    cursor: pointer;
  }

  .floating-filter-btn.visible {
    display: flex !important;
  }

  .floating-filter-btn:active {
    transform: scale(0.9);
  }

  /* Rotate image 1 ONLY in LIGHTBOX on Mobile */
  .lightbox-img.rotated-mobile {
    transform: rotate(90deg);
    width: auto !important;
    height: auto !important;
    max-width: 90vh !important;
    max-height: 85vw !important;
    object-fit: contain !important;
    border-radius: 4px;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
  }
  
  /* Reset modal-img rotation (moved to lightbox) */
  .modal-img.rotated-mobile {
    transform: none !important;
    max-height: 100% !important;
    max-width: 100% !important;
  }
}

/* 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;
}

/* Bottone disabilitato (opzione incompatibile) */
.fmt-btn-disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* Chip formato nella riga variante */
.chip-fmt {
  background: #f0f0ee;
  color: #333;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ── 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;
}