/* =============================================================
   CeramiX Pages â€“ BASE CSS
   Componenti riutilizzabili per tutte le pagine istituzionali
   Caricato SOLO sulle pagine CMS gestite dal modulo
   ============================================================= */

/* RESET SCOPED */
.cx * { box-sizing: border-box; }
.cx img { max-width: 100%; height: auto; display: block; }
.cx a { text-decoration: none; }

/* VARIABILI */
:root {
  --cx-blue:    #001e6a;
  --cx-blue-hover: #002d9e;
  --cx-red:     #ff0000;
  --cx-red-hover: #cc0000;
  --cx-bg:      #f7f8fb;
  --cx-border:  #e8eaed;
  --cx-text:    #111;
  --cx-muted:   #555;
  --cx-light:   #f0f2f8;
  --cx-white:   #fff;
  --cx-radius:  4px;
  --cx-shadow:  0 2px 10px rgba(0,30,106,.07);
  --cx-shadow-hover: 0 6px 22px rgba(0,30,106,.13);
  --cx-gap:     24px;
}

/* ---- INTRO ---- */
.cx-intro {
  text-align: center;
  padding: 24px 0 20px;
  max-width: 700px;
  margin: 0 auto 20px;
}
.cx-intro p {
  color: var(--cx-muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

/* ---- FILTRI ---- */
.cx-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
  padding: 0;
  list-style: none;
}
.cx-fbtn {
  background: var(--cx-white);
  border: 1.5px solid #d1d5db;
  border-radius: var(--cx-radius);
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: all .18s;
  line-height: 1.4;
}
.cx-fbtn:hover,
.cx-fbtn.active {
  background: var(--cx-blue);
  border-color: var(--cx-blue);
  color: var(--cx-white);
}

/* ---- GRIGLIA 3 COLONNE ---- */
.cx-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--cx-gap);
  margin-bottom: 40px;
  width: 100%;
}
@media (max-width: 991px) { .cx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .cx-grid { grid-template-columns: 1fr; } }

/* ---- GRIGLIA 2 COLONNE ---- */
.cx-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--cx-gap);
  margin-bottom: 40px;
}
@media (max-width: 767px) { .cx-grid-2 { grid-template-columns: 1fr; } }

/* ---- GRIGLIA LISTA (1 colonna) ---- */
.cx-grid-list {
  display: flex;
  flex-direction: column;
  gap: var(--cx-gap);
  margin-bottom: 40px;
}

/* ---- CARD BASE ---- */
.cx-card {
  background: var(--cx-white);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--cx-shadow);
  transition: box-shadow .22s, transform .22s;
}
.cx-card:hover {
  box-shadow: var(--cx-shadow-hover);
  transform: translateY(-3px);
}

/* ---- IMMAGINE CON RATIO 16:9 ---- */
.cx-img-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #111;
  display: block;
}
.cx-img-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s, opacity .3s;
  border: none; margin: 0; padding: 0;
}
.cx-card:hover .cx-img-wrap img { transform: scale(1.04); opacity: .85; }

/* ---- IMMAGINE CON RATIO 780x330 (case study) ---- */
.cx-img-wrap-cs {
  position: relative;
  width: 100%;
  padding-bottom: 42.3%;
  height: 0;
  overflow: hidden;
  background: var(--cx-bg);
  display: block;
}
.cx-img-wrap-cs img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
  border: none; margin: 0; padding: 0;
}
.cx-card:hover .cx-img-wrap-cs img { transform: scale(1.03); }

/* ---- BADGE ---- */
.cx-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--cx-blue);
  color: var(--cx-white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 2px;
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 3;
}

/* ---- BODY CARD ---- */
.cx-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cx-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 11px;
  color: #888;
}
.cx-meta i { color: var(--cx-blue); margin-right: 3px; }
.cx-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--cx-text);
  margin: 0 0 8px;
  line-height: 1.35;
}
.cx-title a { color: inherit; text-decoration: none; }
.cx-title a:hover { color: var(--cx-blue); }
.cx-title-sm { font-size: 13px; }
.cx-desc {
  font-size: 13px;
  color: var(--cx-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 14px;
}
.cx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.cx-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--cx-light);
  color: var(--cx-blue);
  border-radius: 2px;
  padding: 2px 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---- BOTTONE ---- */
.cx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid #333;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--cx-radius);
  text-decoration: none;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: all .18s;
  cursor: pointer;
}
.cx-btn:hover {
  background: var(--cx-blue);
  border-color: var(--cx-blue);
  color: var(--cx-white);
  text-decoration: none;
}
.cx-btn-primary {
  background: var(--cx-blue);
  border-color: var(--cx-blue);
  color: var(--cx-white);
}
.cx-btn-primary:hover {
  background: var(--cx-blue-hover);
  border-color: var(--cx-blue-hover);
  color: var(--cx-white);
}

/* ---- CTA BOX ---- */
.cx-cta {
  background: var(--cx-blue);
  border-radius: var(--cx-radius);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 36px;
}
.cx-cta h3 { color: var(--cx-white); font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.cx-cta p  { color: rgba(255,255,255,.78); font-size: 14px; margin: 0 0 20px; }

/* ---- NOTA E-E-A-T ---- */
.cx-eeat {
  background: var(--cx-bg);
  border-left: 4px solid var(--cx-blue);
  border-radius: 0 var(--cx-radius) var(--cx-radius) 0;
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.cx-eeat-icon {
  width: 36px; height: 36px;
  background: var(--cx-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cx-eeat-icon svg { width: 16px; fill: var(--cx-white); display: block; }
.cx-eeat-text { font-size: 13px; color: var(--cx-muted); line-height: 1.55; }
.cx-eeat-text strong { color: var(--cx-text); }
.cx-eeat-text a { color: var(--cx-blue); }

/* ---- ACCORDION FAQ ---- */
.cx-faq-item {
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--cx-white);
}
.cx-faq-q {
  width: 100%;
  background: var(--cx-white);
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  color: var(--cx-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background .18s;
  line-height: 1.4;
}
.cx-faq-q:hover { background: var(--cx-bg); }
.cx-faq-q.open { background: var(--cx-blue); color: var(--cx-white); }
.cx-faq-q .cx-faq-icon { flex-shrink: 0; width: 18px; height: 18px; transition: transform .25s; }
.cx-faq-q.open .cx-faq-icon { transform: rotate(45deg); }
.cx-faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--cx-muted);
  line-height: 1.65;
  border-top: 1px solid var(--cx-border);
}
.cx-faq-a.open { display: block; }

/* ---- TESTIMONIAL CARD ---- */
.cx-testimonial {
  background: var(--cx-white);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 24px;
  box-shadow: var(--cx-shadow);
}
.cx-testimonial blockquote {
  font-size: 14px;
  color: var(--cx-muted);
  line-height: 1.7;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  font-style: italic;
}
.cx-testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cx-testimonial-author img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.cx-testimonial-name { font-size: 13px; font-weight: 700; color: var(--cx-text); }
.cx-testimonial-role { font-size: 11px; color: #888; }
.cx-stars { color: #f5a623; font-size: 14px; margin-bottom: 12px; }

/* ---- MODAL LIGHTBOX ---- */
.cx-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.88);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cx-modal.open { display: flex; }
.cx-modal-inner { position: relative; width: 100%; max-width: 860px; }
.cx-modal-close {
  position: absolute;
  top: -40px; right: 0;
  background: none; border: none;
  color: var(--cx-white);
  font-size: 34px; line-height: 1;
  cursor: pointer; padding: 0;
}
.cx-ratio {
  position: relative;
  padding-bottom: 56.25%;
  height: 0; overflow: hidden;
  border-radius: var(--cx-radius);
  background: #000;
}
.cx-ratio iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---- YOUTUBE PLAY BUTTON ---- */
.cx-play {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.cx-play-circle {
  width: 54px; height: 54px;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
}
.cx-card:hover .cx-play-circle { background: #fff; transform: scale(1.1); }
.cx-play-circle svg { width: 20px; height: 20px; fill: var(--cx-blue); margin-left: 3px; display: block; }

/* ---- SEZIONE LINK RAPIDI ---- */
.cx-subpages { background: var(--cx-bg); border-radius: var(--cx-radius); padding: 24px; margin-bottom: 32px; }
.cx-subpages-title { font-size: 15px; font-weight: 700; color: var(--cx-text); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--cx-blue); }
.cx-subpage-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--cx-white);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--cx-text);
  transition: all .18s;
}
.cx-subpage-link:last-child { margin-bottom: 0; }
.cx-subpage-link:hover { border-color: var(--cx-blue); box-shadow: 0 2px 10px rgba(0,30,106,.1); text-decoration: none; }
.cx-subpage-link-icon { width: 36px; height: 36px; background: var(--cx-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cx-subpage-link-icon svg { width: 16px; fill: var(--cx-blue); }
.cx-subpage-link-text { flex: 1; }
.cx-subpage-link-text strong { display: block; font-size: 13px; font-weight: 700; }
.cx-subpage-link-text span { font-size: 11px; color: #888; }
.cx-subpage-link .fa-angle-right { color: #bbb; font-size: 14px; }
.cx-subpage-link:hover .fa-angle-right { color: var(--cx-blue); }

/* ---- HERO BOX ---- */
.cx-hero {
  background: linear-gradient(135deg, var(--cx-blue) 0%, #002d9e 100%);
  border-radius: var(--cx-radius);
  padding: 40px 32px;
  margin-bottom: 32px;
  color: var(--cx-white);
}
.cx-hero h2 { font-size: 22px; font-weight: 700; margin: 0 0 10px; color: var(--cx-white); }
.cx-hero p { font-size: 15px; color: rgba(255,255,255,.82); margin: 0; line-height: 1.6; }

/* ---- STAT BOX ---- */
.cx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 767px) { .cx-stats { grid-template-columns: 1fr; } }
.cx-stat {
  background: var(--cx-white);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--cx-shadow);
}
.cx-stat-num { font-size: 28px; font-weight: 700; color: var(--cx-blue); line-height: 1; margin-bottom: 6px; }
.cx-stat-label { font-size: 12px; color: var(--cx-muted); letter-spacing: .04em; text-transform: uppercase; }

/* ---- MAPPA RIVENDITORI ---- */
.cx-map-wrap { border-radius: var(--cx-radius); overflow: hidden; margin-bottom: 24px; }
.cx-map-wrap iframe { width: 100%; height: 400px; border: 0; display: block; }

/* ---- GDPR CONSENT BANNER per iframe ---- */
.cx-consent-wrap {
  position: relative;
  background: #1a1a2e;
  border-radius: var(--cx-radius);
  overflow: hidden;
}
.cx-consent-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 5;
}
.cx-consent-overlay p { color: var(--cx-white); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.cx-consent-overlay .cx-btn { background: var(--cx-blue); border-color: var(--cx-blue); color: var(--cx-white); }

/* ---- RIDUCI MOVIMENTO ---- */
@media (prefers-reduced-motion: reduce) {
  .cx-card, .cx-img-wrap img, .cx-play-circle, .cx-fbtn, .cx-btn { transition: none !important; }
}

/* ============================================================
   CeramiX — Classi responsive per CMS page
   Da aggiungere in fondo a /modules/ceramixpages/views/css/ceramixpages.css
   Dopo ogni modifica incrementare VERSION_ASSETS in ceramixpages.php
   ============================================================ */

/* --- Griglie --- */
.cx-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.cx-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.cx-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.cx-flex   { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.cx-flex-center { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* --- Colonne flessibili --- */
.cx-col-text  { flex: 1.2; min-width: 280px; }
.cx-col-side  { flex: 1;   min-width: 260px; }
.cx-col-equal { flex: 1;   min-width: 260px; }

/* --- Hero layout --- */
.cx-hero-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3.5rem;
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Trust bar --- */
.cx-trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

/* --- Separatori trust bar --- */
.cx-trust-sep {
  width: 1px;
  background: #e5e8ee;
  margin: 4px 0;
}

/* ============================================================
   TABLET  — max-width: 900px
   ============================================================ */
@media (max-width: 900px) {
  .cx-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cx-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cx-trust-sep { display: none; }
  .cx-hero-inner { padding: 2.5rem 1.2rem 2rem; gap: 2rem; }
}

/* ============================================================
   MOBILE  — max-width: 600px
   ============================================================ */
@media (max-width: 600px) {
  .cx-grid-3  { grid-template-columns: 1fr; }
  .cx-grid-2  { grid-template-columns: 1fr; }
  .cx-grid-4  { grid-template-columns: 1fr; }
  .cx-flex    { flex-direction: column; }
  .cx-col-text,
  .cx-col-side,
  .cx-col-equal { min-width: 100%; }
  .cx-hero-inner { flex-direction: column; text-align: center; }

  /* Hero: immagine SVG sotto il testo su mobile */
  .cx-hero-visual { order: 2; max-width: 280px; margin: 0 auto; }
  .cx-hero-text   { order: 1; }

  /* Font hero ridotto su mobile */
  .cx-h1-hero { font-size: 1.7rem !important; }
  .cx-h2-section { font-size: 1.3rem !important; }

  /* Nascondi separatori colonna trust bar su mobile */
  .cx-trust-sep { display: none; }

  /* Card prodotti full width su mobile */
  .cx-product-card { min-width: 100%; }

  /* CTA buttons full width su mobile */
  .cx-cta-btn { width: 100%; text-align: center; box-sizing: border-box; }
}