/* ═══════════════════════════════════════════
   INDACO FORNITURE — Catalogo CSS
   Design tablet-first, scroll fluido
   ═══════════════════════════════════════════ */

:root {
  --bg: #fff;
  --bg-dark: #0A043B;
  --bg-section: #f5f7fa;
  --text: #0A043B;
  --text-light: #ffffff;
  --muted: #5a6a7a;
  --muted-light: #8a9ab0;
  --accent: #e63946;
  --accent-hover: #c1121f;
  --line: #e0e4ea;
  --radius: .6rem;
  --radius-lg: 1rem;
  --sidebar-w: 256px;
  --header-h: 58px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 4px 18px rgba(0,0,0,.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.15);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ── */
html { scroll-behavior: smooth; overflow-x: clip; max-width: 100%; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; max-width: 100%; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Manrope", sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Header ── */
.cat-header {
  background: var(--bg-dark);
  color: #fff;
  padding: 0 2rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 1rem;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.cat-header .brand { display: flex; align-items: center; transition: opacity var(--transition); }
.cat-header .brand:hover { opacity: .82; }
.cat-header nav { display: flex; align-items: center; gap: 1.6rem; }
.cat-header nav a { color: rgba(255,255,255,.85); font-size: .88rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; transition: color var(--transition); }
.cat-header nav a:hover { color: var(--accent); }
.dl-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff !important;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-size: .83rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: all var(--transition);
  white-space: nowrap;
}
.dl-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ── Lang switch ── */
.lang-switch { display: flex; align-items: center; gap: .12rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 6px; padding: .12rem; flex-shrink: 0; }
.lang-btn { all: unset; display: inline-flex; align-items: center; justify-content: center; padding: .32rem .62rem; border-radius: 4px; font-family: "Space Grotesk", sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: rgba(255,255,255,.4); cursor: pointer; transition: all var(--transition); line-height: 1; }
.lang-btn:hover { color: rgba(255,255,255,.8); }
.lang-btn.active { background: var(--accent); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* ── Hero ── */
.cat-hero {
  background: linear-gradient(140deg, var(--bg-dark) 0%, #1a1052 60%, #2d1b69 100%);
  color: #fff;
  padding: 4.5rem 2rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cat-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(230,57,70,.18) 0%, transparent 70%);
  pointer-events: none;
}
.cat-hero h1 { font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; margin-bottom: .75rem; }
.cat-hero p { font-size: 1.05rem; color: rgba(255,255,255,.68); max-width: 580px; margin: 0 auto 1rem; line-height: 1.7; }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: .28rem .85rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .09em; margin-bottom: 1rem; }
.hero-stats { display: flex; justify-content: center; gap: 3rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.hero-stat span { font-family: "Space Grotesk", sans-serif; font-size: 2.2rem; font-weight: 700; color: #fff; line-height: 1; }
.hero-stat small { font-size: .7rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .09em; }

/* ── Inline search bar ── */
.cat-search-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 2rem;
  position: sticky;
  top: var(--header-h);
  z-index: 190;
  box-shadow: var(--shadow-sm);
}
.cat-search-bar #search-trigger { all: unset; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; transition: background var(--transition); flex-shrink: 0; }
.cat-search-bar #search-trigger:hover { background: var(--bg-section); }
#cat-search-inline { flex: 1; border: none; outline: none; background: transparent; font-family: "Manrope", sans-serif; font-size: .92rem; color: var(--text); max-width: 520px; }
#cat-search-inline::placeholder { color: var(--muted-light); }

/* ── Layout ── */
.cat-layout { display: flex; max-width: 1440px; margin: 0 auto; gap: 0; }

/* ── Sidebar ── */
.cat-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + 48px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding: 1.5rem .75rem 2rem 1.25rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.cat-sidebar::-webkit-scrollbar { width: 4px; }
.cat-sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.cat-sidebar::-webkit-scrollbar-thumb:hover { background: var(--muted-light); }

/* Sidebar groups */
.sidebar-group { margin-bottom: .2rem; }
.sidebar-group-btn {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .48rem .65rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  box-sizing: border-box;
}
.sidebar-group-btn:hover { background: var(--bg-section); color: var(--text); }
.sidebar-group-btn .chevron { transition: transform .28s ease; flex-shrink: 0; }
.sidebar-group.open .sidebar-group-btn .chevron { transform: rotate(180deg); }
.sidebar-group-list { overflow: hidden; max-height: 0; transition: max-height .35s ease; }
.sidebar-group.open .sidebar-group-list { max-height: 600px; }
.sidebar-group-list a {
  display: block;
  padding: .38rem .65rem .38rem 1.1rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  border-radius: 0 5px 5px 0;
  line-height: 1.4;
}
.sidebar-group-list a:hover { background: var(--bg-section); border-left-color: var(--accent); color: var(--text); }
.sidebar-group-list a.active { background: rgba(230,57,70,.07); border-left-color: var(--accent); color: var(--accent); font-weight: 700; }

/* ── Content ── */
.cat-content { flex: 1; min-width: 0; padding: 2.5rem 2.5rem 4rem; }

/* ── Sections ── */
.cs {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--header-h) + 52px);
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp .45s ease forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
/* stagger via nth-child — limited to 30 sections */
.cs:nth-child(1){animation-delay:.04s}.cs:nth-child(2){animation-delay:.08s}.cs:nth-child(3){animation-delay:.12s}
.cs:nth-child(4){animation-delay:.16s}.cs:nth-child(5){animation-delay:.2s}.cs:nth-child(6){animation-delay:.24s}
.cs:nth-child(7){animation-delay:.28s}.cs:nth-child(8){animation-delay:.32s}.cs:nth-child(9){animation-delay:.36s}
.cs:nth-child(n+10){animation-delay:.4s}

.cs-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 2px solid var(--line); }
.ci { width: 46px; height: 46px; background: var(--accent); border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; color: #fff; box-shadow: 0 3px 10px rgba(230,57,70,.3); }
.cs-head h2 { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.2rem, 2.5vw, 1.55rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.cs-head p { font-size: .87rem; color: var(--muted); margin-top: .25rem; line-height: 1.55; }
.cs h3 { font-family: "Space Grotesk", sans-serif; font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin: 1.6rem 0 .7rem; color: var(--muted); }

/* ── Images — swipe strip ── */
.img-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: .25rem;
}
.img-row::-webkit-scrollbar { display: none; }
.img-row img {
  height: 200px;
  min-width: 200px;
  max-width: 300px;
  flex-shrink: 0;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--bg-section);
  padding: .75rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.img-row img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

/* ── Tables — horizontal scroll on small screens ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.1rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 420px;
}
/* wrap all existing tables automatically via JS or just apply globally */
thead th {
  background: var(--bg-dark);
  color: #fff;
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .7rem .9rem;
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: rgba(245,247,250,.6); }
tbody tr:hover { background: rgba(230,57,70,.04); }
tbody td:first-child { font-weight: 700; font-family: "Space Grotesk", monospace; color: var(--accent); font-size: .78rem; }

/* ── Img scroll hint ── */
.img-scroll-hint {
  display: block;
  text-align: right;
  font-size: .7rem;
  color: var(--muted-light);
  margin-top: -.8rem;
  margin-bottom: .8rem;
  padding-right: .25rem;
  transition: opacity var(--transition);
  pointer-events: none;
  user-select: none;
}
.img-scroll-hint::before { content: '← scorri →'; letter-spacing: .04em; }

/* ── Product badges ── */
.prod-badge-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.prod-badge { display: inline-flex; align-items: center; padding: .28rem .78rem; border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.prod-badge-blue { background: #e8f0fe; color: #1a56db; }
.prod-badge-yellow { background: #fef3c7; color: #92400e; }
.prod-badge-green { background: #dcfce7; color: #166534; }
.prod-badge-red { background: #fee2e2; color: #991b1b; }

/* ── WD-40 icon ── */
.ci-wd40 { font-family: "Space Grotesk", sans-serif; font-size: .78rem; font-weight: 800; letter-spacing: .02em; background: #003087 !important; }

/* ── Intro / note ── */
.cs-intro { font-size: .9rem; color: var(--muted); line-height: 1.75; margin-bottom: 1.3rem; padding: .8rem 1.1rem; background: var(--bg-section); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.cs-note { font-size: .84rem; color: var(--muted); margin-top: .8rem; padding: .65rem 1rem; background: var(--bg-section); border-radius: var(--radius); }
.cs-note a { color: var(--accent); }

/* ── Feature grid (compressori etc.) ── */
.prod-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.prod-feature { background: var(--bg-section); border-radius: var(--radius); padding: 1.1rem 1.2rem; border: 1px solid var(--line); transition: box-shadow var(--transition); }
.prod-feature:hover { box-shadow: var(--shadow-md); }
.prod-feature h4 { font-family: "Space Grotesk", sans-serif; font-size: .88rem; font-weight: 700; margin-bottom: .38rem; color: var(--text); }
.prod-feature p { font-size: .82rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* ── CTA ── */
.dl-main { display: inline-flex; align-items: center; gap: .5rem; background: var(--accent); color: #fff; text-decoration: none; padding: .9rem 1.7rem; border-radius: var(--radius); font-weight: 700; font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; transition: all var(--transition); box-shadow: 0 4px 18px rgba(230,57,70,.32); }
.dl-main:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(230,57,70,.42); }

/* ── Footer ── */
.cat-footer { background: var(--bg-dark); color: rgba(255,255,255,.48); text-align: center; padding: 2.5rem 2rem; font-size: .84rem; line-height: 2; }
.cat-footer a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
.cat-footer a:hover { opacity: .8; }

/* ── Search overlay ── */
#search-trigger { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; color: rgba(255,255,255,.8); transition: background var(--transition); flex-shrink: 0; }
#search-trigger:hover { background: rgba(255,255,255,.12); }
#search-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(10,4,59,.72); backdrop-filter: blur(8px); display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; opacity: 0; pointer-events: none; transition: opacity .22s; }
#search-overlay.open { opacity: 1; pointer-events: all; }
.search-box { width: min(680px, calc(100% - 2rem)); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }
.search-input-wrap { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.search-icon-input { color: var(--muted); flex-shrink: 0; }
#search-input { flex: 1; border: none; outline: none; font-family: "Manrope", sans-serif; font-size: 1.05rem; color: var(--text); background: transparent; }
#search-input::placeholder { color: var(--muted-light); }
#search-close { all: unset; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; transition: background var(--transition); flex-shrink: 0; }
#search-close:hover { background: var(--bg-section); }
#search-results { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; }
.search-result-item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .65rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); text-decoration: none; transition: background var(--transition); cursor: pointer; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus { background: var(--bg-section); outline: none; }
.sr-badge { grid-row: 1/3; align-self: center; font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--accent); padding: .22rem .52rem; border-radius: 4px; white-space: nowrap; }
.sr-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.sr-desc { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-item mark { background: #fff3cd; color: var(--text); border-radius: 2px; padding: 0 1px; }
.search-hint { text-align: center; padding: 1.4rem; color: var(--muted); font-size: .85rem; margin: 0; }

/* ── Cookie Banner ── */

/* ── WhatsApp ── */
#whatsapp-btn { position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 9000; width: 52px; height: 52px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 22px rgba(37,211,102,.48); transition: transform var(--transition), box-shadow var(--transition); text-decoration: none; }
#whatsapp-btn:hover { transform: scale(1.08); box-shadow: 0 6px 30px rgba(37,211,102,.62); }

/* ── Back to top ── */
#back-to-top { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9000; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 18px rgba(230,57,70,.4); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity var(--transition), transform var(--transition); }
#back-to-top.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
#back-to-top:hover { background: var(--accent-hover); }

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

/* ── Tablet landscape (≤1100px) ── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .cat-content { padding: 2rem 1.8rem 4rem; }
}

/* ── Tablet portrait (≤860px) — sidebar drawer ── */
@media (max-width: 860px) {
  :root { --sidebar-w: 100%; }

  .cat-layout { flex-direction: column; }

  .cat-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1rem .75rem;
    overflow: visible;
  }

  /* On tablet: groups stay collapsible, links become pill chips */
  .sidebar-group-list { max-height: 0; transition: max-height .35s ease; }
  .sidebar-group.open .sidebar-group-list { max-height: 300px; }
  .sidebar-group-list a {
    display: inline-block;
    border-left: none;
    border-radius: 999px;
    padding: .3rem .75rem;
    font-size: .75rem;
    background: var(--bg-section);
    border: 1px solid var(--line);
    margin: .2rem .15rem;
    color: var(--text);
  }
  .sidebar-group-list a:hover,
  .sidebar-group-list a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  .cat-content { padding: 1.5rem 1.25rem 3rem; }

  .img-row img { height: 180px; min-width: 180px; }

  .cat-hero { padding: 3rem 1.25rem 2.5rem; }
  .hero-stats { gap: 2rem; }
  .hero-stat span { font-size: 1.8rem; }

  .cat-header nav .dl-btn { display: none; }

  table { min-width: 360px; }
  thead th, tbody td { padding: .5rem .65rem; }
}

/* ── Mobile (≤520px) ── */
@media (max-width: 520px) {
  .cat-header { padding: 0 1rem; }
  .cat-header nav { gap: 1rem; }
  .cat-header nav a:not(.dl-btn) { font-size: .78rem; }

  .cat-search-bar { padding: .5rem 1rem; }

  .cat-content { padding: 1.25rem 1rem 3rem; }

  .img-row img { height: 150px; min-width: 150px; }

  .cs-head h2 { font-size: 1.15rem; }
  .ci { width: 40px; height: 40px; font-size: 1.1rem; }

  .hero-stats { gap: 1.2rem; }
  .hero-stat span { font-size: 1.5rem; }
  .hero-stat small { font-size: .65rem; }

  table { font-size: .75rem; min-width: 320px; }
  thead th { font-size: .62rem; padding: .5rem .5rem; }
  tbody td { padding: .42rem .5rem; font-size: .75rem; }
  tbody td:first-child { font-size: .72rem; }

  .prod-feature-grid { grid-template-columns: 1fr; }
  .prod-badge { font-size: .65rem; }
  .cs-intro, .cs-note { font-size: .83rem; }
}
