﻿/* ==========================================
   1. RESET E ALLINEAMENTO HEADER PAGINA
   ========================================== */

/* Azzera lo spazio verticale ereditato dal wrapper generale */
.contenuti {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#cataloghi-main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2.5rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #666666;
  background-color: #ffffff;
}

.contenuti .path {
  display: none;
}

/* ==========================================
   TITOLO "CATALOGHI" IDENTICO A "CATEGORIE"
   ========================================== */

.safety-nav-menu {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 30px;
  padding: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  width: 100%;
  text-align: center;
}

.safety-nav-menu .nav-title {
  font-size: calc(1.6rem + 0.5vw) !important;
  font-weight: 700 !important;
  color: #666666 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

/* Descrizione del sottotitolo */
.downloads-header p,
.testo-personalizzato {
  text-align: center !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
  color: #666666 !important;
  max-width: 1200px;
  margin: 0 auto 1.5rem auto !important;
  font-weight: 400;
  opacity: 1 !important;
}

/* ==========================================
   2. BANNER CATALOGO COMPLETO (HERO BOX)
   ========================================== */
.main-catalog-banner {
  background: #4caf50;
  color: #ffffff;
  border-radius: 0 !important;
  padding: 2.5rem;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  box-shadow: none;
}

.banner-content {
  max-width: 750px;
  text-align: left;
}

.banner-tag {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem;
  border-radius: 0 !important;
  margin-bottom: 1rem;
}

.banner-title {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  line-height: 1.2;
  text-align: left;
}

.banner-description {
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  text-align: left;
}

/* CONTENITORE PULSANTE SOTTO IL TESTO */
.banner-button-wrapper {
  display: flex;
  justify-content: flex-start;
}

.banner-button-wrapper .btn-banner-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background-color: #388e3c;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 1.75rem;
  border-radius: 0 !important;
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

/* Hover Banner in grigio scuro */
.banner-button-wrapper .btn-banner-download:hover {
  background-color: #333333 !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}

/* CONTENITORE DESTRO (SOLO IMMAGINE CATALOGO) */
.banner-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-catalog-cover {
  max-width: 300px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-catalog-cover img {
  max-width: 100%;
  max-height: 380px;
  height: auto;
  object-fit: contain;
  box-shadow: none; /* Ombra rimossa dalla foto del Catalogo 58 in alto */
  transition: transform 0.3s ease;
}

.banner-catalog-cover img:hover {
  transform: scale(1.04);
}

/* ==========================================
   3. FILTRI PER CATEGORIA (PILLS BAR)
   ========================================== */
.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Allineati al centro della pagina */
  gap: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.25rem;
}

.filter-btn {
  background-color: #ffffff !important; /* Box bianco */
  border: 1px solid #e5e7eb !important;  /* Bordo grigio */
  color: #666666 !important;             /* Testo grigio #666666 */
  padding: 0.5rem 1.25rem;
  border-radius: 0 !important;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover Filtri in grigio scuro */
.filter-btn:hover {
  background-color: #333333 !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}

/* Stato attivo in grigio scuro */
.filter-btn.active {
  background-color: #333333 !important;
  color: #ffffff !important;
  border-color: #333333 !important;
}

/* Nasconde eventuali badge/numeri rimasti nell'HTML */
.filter-btn .badge {
  display: none !important;
}

/* ==========================================
   4. GRIGLIA CARDS DOWNLOAD
   ========================================== */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.download-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0 !important;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.download-card:hover {
  border-color: #666666;
  box-shadow: none;
}

/* Contenitore immagini cards */
.card-preview-thumb {
  width: 100%;
  height: 280px; /* Ingrandite le dimensioni dei cataloghi */
  background-color: transparent;
  border: none !important;
  border-radius: 0 !important;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-preview-thumb img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border: none !important;
  border-radius: 0 !important;
  transition: transform 0.3s ease;
}

.download-card:hover .card-preview-thumb img {
  transform: scale(1.03); /* Effetto ingrandimento (hover) ridotto */
}

.card-info .meta-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #666666;
  margin: 0 0 0.5rem 0;
  line-height: 1.35;
}

.card-info p {
  font-size: 0.9rem;
  color: #666666;
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.card-actions a {
  text-decoration: none;
  flex: 1;
}

.btn-download, .btn-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 0 !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
  color: #ffffff !important;
}

.btn-download {
  background-color: #4caf50;
}

.btn-preview {
  background-color: #4caf50;
  color: #ffffff !important;
  border: 1px solid #4caf50;
}

/* Hover Pulsanti Card in grigio scuro */
.btn-download:hover,
.btn-preview:hover {
  background-color: #333333 !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}

/* ==========================================
   5. POPUP UTENTE NON LOGGATO (TOOLTIP)
   ========================================== */
.popup-cat-richiesta-pdf {
  position: relative;
  width: 100%;
}

.popup-cat-richiesta-pdf .popuptext {
  visibility: hidden;
  width: 220px;
  background-color: #4caf50;
  color: #ffffff !important;
  font-size: 0.8rem;
  font-weight: 400;
  text-align: center;
  border-radius: 0 !important;
  padding: 0.75rem;
  position: absolute;
  z-index: 30;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  text-transform: none;
  line-height: 1.4;
}

.popup-cat-richiesta-pdf .popuptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #4caf50 transparent transparent transparent;
}

.popup-cat-richiesta-pdf .show {
  visibility: visible;
  opacity: 1;
}

/* ==========================================
   6. RESPONSIVE
   ========================================== */
@media (max-width: 850px) {
  .main-catalog-banner {
    flex-direction: column-reverse;
    align-items: center;
    padding: 1.75rem;
    text-align: center;
  }

  .banner-content {
    text-align: center;
  }

  .banner-title,
  .banner-description {
    text-align: center;
  }

  .banner-button-wrapper {
    justify-content: center;
  }

  .banner-button-wrapper .btn-banner-download {
    width: 100%;
  }

  .banner-action {
    width: 100%;
    margin-bottom: 1.5rem;
  }
}

/* SOLO MOBILE (SOTTO I 600PX) */
@media (max-width: 600px) {
  #cataloghi-main-wrapper {
    padding: 1rem 0.5rem;
  }

  .downloads-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .download-card {
    padding: 0.85rem;
  }

  /* Immagini più grandi su mobile */
  .card-preview-thumb {
    height: 220px !important;
    margin-bottom: 0.75rem;
  }

  .card-info h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
  }

  .card-info p {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Testo dei pulsanti uguale alla versione desktop */
  .btn-download, 
  .btn-preview {
    padding: 0.65rem 0.35rem;
    font-size: 0.875rem !important;
  }

  .banner-catalog-cover {
    max-width: 220px;
  }
}