/* BLOQUE 1: Estilos del vídeo con padding superior */
.chi-siamo-blocco1 {
    width: 100%;
    height: 600px; /* Altura forzada */
    background-color: #f5f5f5; /* Cambia el color si es necesario */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0 0 0; /* Padding superior añadido */
    box-sizing: border-box;
    padding-bottom: 0; /* Desktop por defecto */
}

.video-container {
    max-width: 1200px;
    width: 100%;
    height: calc(100% - 30px); /* Compensa el padding */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container iframe {
    width: 100%;
    max-width: 1200px;
    height: calc(100% - 40px); /* Mantiene el equilibrio visual */
    border-radius: 20px; /* Esquinas redondeadas */
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra estética */
}

/* Estilos para pantallas pequeñas (max-width: 768px) */
@media (max-width: 768px) {
    .chi-siamo-blocco1 {
        height: auto; /* Altura dinámica según el contenido */
        padding: 20px 0 0 0; /* Menos padding */
    }

    .video-container {
        height: auto; /* Altura dinámica */
    }

    .video-container iframe {
        height: 200px; /* Altura específica en móvil */
        border-radius: 15px; /* Radio más pequeño */
    }

    .chi-siamo-blocco1 {
        padding-bottom: 20px; /* Padding inferior extra en móvil */
    }
}

/* BLOQUE 2: Imagen + texto (desktop) */
.chi-siamo-blocco2 {
    width: 100%;
    background-color: #2c2c2c; /* Antracita */
    padding: 50px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blocco2-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dos columnas en desktop */
    gap: 50px; /* Más espacio entre imagen y texto */
    align-items: center;
}

.blocco2-immagine img {
    width: 100%;
    border-radius: 20px; /* Esquinas redondeadas */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Sombra ligera */
}

.blocco2-testo {
    color: #ffffff; /* Texto blanco */
}

.blocco2-testo h2 {
    font-size: 2.4rem; /* Tamaño desktop */
    margin-bottom: 20px;
}

.blocco2-testo p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Responsive móvil para el bloque 2 */
@media (max-width: 768px) {
    .blocco2-container {
        grid-template-columns: 1fr; /* Una columna en móvil */
    }

    .blocco2-immagine {
        order: 2; /* Imagen después del texto */
    }

    .blocco2-testo {
        order: 1; /* Texto antes de la imagen */
    }

    .blocco2-testo h2 {
        font-size: 25px; /* Título en móvil */
    }

    .blocco2-testo p {
        font-size: 16px; /* Descripción en móvil */
    }

    .blocco2-immagine img {
        max-width: 100%;
        margin-bottom: 20px;
    }
}

/* Desktop: muestra todo el texto y oculta el botón “Leer más” */
@media (min-width: 769px) {
    #more-text {
      display: inline !important; /* Mostrar siempre todo el texto */
    }
    #read-more {
      display: none; /* Ocultar botón en desktop */
    }
}

/* Móvil: oculta parte del texto y muestra el botón */
@media (max-width: 768px) {
    #more-text {
      display: none; /* Texto adicional oculto por defecto */
    }
    #read-more {
      display: inline-block; /* Mostrar botón en móvil */
      background-color: #dedacf;
      color: #000;
      border: none;
      padding: 10px 20px;
      border-radius: 5px;
      cursor: pointer;
    }
    #read-more:hover {
      background-color: #00aaad;
    }
}

/* BLOQUE 3: Estilos sección marcas */
.chi-siamo-brands {
    background-color: #fff; /* Fondo blanco */
    padding: 50px 20px;
}

.brands-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.brands-title {
    font-size: 2.4rem;
    margin-bottom: 20px;
}

.brands-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #666;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none; /* Sin subrayado */
    padding: 10px; /* Más compacto en altura */
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    color: inherit; /* Mantiene el color del texto */
}

.brand-card h3 {
    font-size: 1.2rem; /* Título más compacto */
    margin-bottom: 5px;
    color: #333;
    text-align: center;
    min-height: 40px; /* Altura uniforme para títulos */
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-card p {
    font-size: 0.9rem; /* Texto más compacto */
    color: #666;
    text-align: center;
    margin-bottom: 5px;
}

.brand-card img {
    width: 80px; /* Logo más pequeño */
    height: 80px;
    object-fit: contain; /* Mantiene proporciones */
    margin: 0 auto;
    display: block;
}

.brand-card img[alt="ATECK"] {
    max-width: 70px; /* Tamaño distinto para ATECK */
    height: auto;
}

.brand-card img[alt="Otto Bull"] {
    content: url("http://35.180.229.108/wp-content/uploads/2025/01/OTTOBULL-orizzontale.png"); /* Nuevo logo Otto Bull */
}

/* Desktop */
@media (min-width: 769px) {
    .mobile-only,
    .popup,
    .popup-content {
        display: none; /* Oculta por completo el popup en desktop */
    }
}

/* Móvil */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }

    .brands-title {
        font-size: 20px; /* Título más pequeño en móvil */
    }

    .brand-card p {
        font-size: 14px; /* Texto más pequeño en móvil */
    }

    .brands-grid {
        grid-template-columns: repeat(2, 1fr); /* Dos tarjetas por fila */
        gap: 10px;
    }

    .brand-card h3 {
        font-size: 16px;
    }

    .popup.hidden {
        display: none;
    }
    .popup {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
    .popup-content {
        background: #fff;
        padding: 20px;
        border-radius: 10px;
        text-align: center;
        max-width: 320px; /* Ancho máximo */
        min-height: 150px; /* Altura mínima */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        word-wrap: break-word; /* Gestiona palabras largas */
    }

    #full-description {
        white-space: normal; /* Permite salto de línea */
        overflow: visible;   /* Evita cortes */
        text-align: center;
        max-width: 90%;
        line-height: 1.4; /* Legibilidad */
        margin: 10px 0;
    }

    .popup-content img {
        width: 60px; /* Tamaño fijo del logo */
        height: auto;
        margin-bottom: 10px;
    }

    .popup-content .close-popup {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 20px;
        cursor: pointer;
    }
}

/* BLOQUE 4 */
/* Estilos generales */
.chi-siamo-blocco4 {
    padding: 50px 20px;
    background-color: #ffffff; /* Fondo blanco */
}

.blocco4-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.blocco4-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
}

/* Carrusel — más ancho */
.carosello {
  display: flex;
  gap: 20px; /* Espacio entre imágenes */
  overflow-x: auto; /* Scroll horizontal */
  margin-bottom: 20px;
  padding: 10px; /* Espacio alrededor del carrusel */
  justify-content: flex-start; /* Alineación a la izquierda */
  width: 100%;
  max-width: 1200px; /* Ancho máximo */
  margin-left: auto;
  margin-right: auto;
}

/* Slide del carrusel */
.carosello-slide {
  flex: 0 0 280px; /* Anchura de cada slide */
  width: 280px;
  height: 200px; /* Altura fija para evitar saltos */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imágenes del carrusel */
.carosello-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mantiene proporciones sin deformar */
  display: block;
}

/* Pestañas (tabs) */
.linguette-testi {
  margin-top: 20px;
  background-color: #f9f9f9; /* Fondo claro */
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.linguette {
  display: flex;
  flex-wrap: wrap; /* Permite varias filas */
  gap: 10px;
  justify-content: space-between;
}

.linguetta {
  flex: 1 1 calc(33.33% - 10px); /* Cada pestaña ocupa 1/3 con gap */
  text-align: center;
  padding: 10px;
  font-size: 1rem;
  font-weight: bold;
  border: 1px solid #ddd;
  background-color: #dedacf;
  color: #000; /* Texto negro en pestaña inactiva */
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.linguetta.attiva {
  background-color: #00474f;
  color: #ffffff; /* Texto blanco en activa */
  border-color: #00474f;
}

.linguetta:hover {
  background-color: #00474f;
  color: #ffffff;
}

.contenuti-testi {
  color: #333;
  border-radius: 10px;
  padding: 20px;
  text-align: left;
}

.testo-tab {
  display: none;
}

.testo-tab.attivo {
  display: block;
}

/* Responsividad móvil */
@media (max-width: 768px) {
  .carosello-slide {
    flex: 0 0 80%; /* Slides más grandes en móvil */
    max-width: 100%;
  }

  .linguette {
    flex-direction: column; /* Pestañas en columna */
    align-items: stretch;
  }

  .linguetta {
    flex: 1 1 calc(33.33% - 10px); /* Pestañas lado a lado si hay espacio */
  }

  .contenuti-testi {
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
  }
}
