/* Stili per la sezione I NOSTRI PRODOTTI */
.divider {
    width: 100px;
    height: 2px;
    background-color: #333;
    margin: 20px 0;
}

.product-showcase {
    margin-top: 30px;
}

.product-item {
    margin-bottom: 30px;
}

/* Classe personalizzata per 5 colonne in desktop */
.col-xl-2-4 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Assicura che su smartphone ci siano 2 colonne */
@media (max-width: 767px) {
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Riduce il padding per migliorare la visualizzazione su schermi piccoli */
    .product-item {
        padding-right: 8px;
        padding-left: 8px;
    }
}

/* Assicura che su tablet ci siano massimo 3 colonne */
@media (min-width: 768px) and (max-width: 1199px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 1200px) {
    .col-xl-2-4 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 300px;
}

/* Adatta l'altezza delle immagini per schermi più piccoli */
@media (max-width: 767px) {
    .product-image-container {
        height: 220px;
    }
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stile per il logo ruotato */
.product-logo-rotated {
    transform: rotate(-90deg);
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: none !important;
    max-width: 70px;
}

/* Aggiornamento dello stile per il product-label per centrare meglio l'immagine */
.product-label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 10px;
    z-index: 2;
}

/* Aggiornamento per il label della porta */
.door-label .product-logo-rotated {
    transform: rotate(90deg);
}

.product-label span {
    transform: rotate(-90deg);
    display: block;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
}

.door-label {
    right: 0;
    left: auto;
    padding-right: 10px;
    padding-left: 0;
}

.door-label span {
    transform: rotate(90deg);
}

.product-title {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

/* Adatta la dimensione del titolo per schermi più piccoli */
@media (max-width: 767px) {
    .product-title {
        font-size: 1rem;
    }
}

.product-divider {
    width: 40px;
    height: 2px;
    background-color: #333;
    margin-top: 10px;
}

/* Stili per la galleria */
.gallery-container {
    display: flex;
    flex-wrap: wrap;
}

.gallery-item {
    margin-bottom: 20px;
}

.gallery-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    /* Dimensioni fisse per il contenitore dell'immagine */
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* Rapporto 4:3 */
}

.gallery-image-container img {
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene le proporzioni riempiendo lo spazio */
    position: absolute;
    top: 0;
    left: 0;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
}

.gallery-image-container:hover img {
    transform: scale(1.05);
}

.gallery-image-container:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item a {
    text-decoration: none;
    color: inherit;
}

.gallery-item h5 {
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
}

/* Nuovi stili per i link dei progetti */
.gallery-item .project-link {
    display: block;
    text-align: center;
    margin-top: 5px;
}

.gallery-item .project-link .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.gallery-item .lightbox-link {
    display: block;
    cursor: zoom-in;
}

/* Gestione visualizzazione galleria desktop/mobile */
@media (max-width: 767px) {
    /* Nascondi la galleria a griglia su smartphone */
    .gallery-container {
        display: none;
    }
    
    /* Mostra il carousel su smartphone */
    #galleryMobileCarousel {
        display: block;
    }
    
    /* Stili per i link dei progetti su mobile */
    #galleryMobileCarousel .project-link {
        display: block;
        text-align: center;
        margin-top: 5px;
        z-index: 10;
        position: relative;
    }
    
    #galleryMobileCarousel .carousel-caption {
        padding-bottom: 40px;
    }
}

@media (min-width: 768px) {
    /* Mostra la galleria a griglia su tablet e desktop */
    .gallery-container {
        display: flex;
    }
    
    /* Nascondi il carousel su tablet e desktop */
    #galleryMobileCarousel {
        display: none !important;
    }
}

/* Stili per il carousel mobile */
#galleryMobileCarousel {
    width: 100%;
}

#galleryMobileCarousel .carousel-item {
    height: 0;
    padding-bottom: 75%; /* Rapporto 4:3 */
    position: relative;
}

#galleryMobileCarousel .carousel-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#galleryMobileCarousel .carousel-caption {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 10px;
    bottom: 0;
    left: 0;
    right: 0;
}

#galleryMobileCarousel .carousel-control-prev,
#galleryMobileCarousel .carousel-control-next {
    width: 45px;
    height: 45px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
}

/* Modifica per rendere le frecce bianche */
#galleryMobileCarousel .carousel-control-prev-icon,
#galleryMobileCarousel .carousel-control-next-icon {
    filter: brightness(0) invert(1);
    width: 24px;
    height: 24px;
}

#galleryMobileCarousel .carousel-control-prev {
    left: 10px;
}

#galleryMobileCarousel .carousel-control-next {
    right: 10px;
}

/* Stili per i pulsanti "Scopri di più" nella galleria */
.gallery-item .project-link .btn-outline-dark,
#galleryMobileCarousel .project-link .btn-outline-dark {
    background-color: rgba(33, 37, 41, 0.7);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.gallery-item .project-link .btn-outline-dark:hover,
#galleryMobileCarousel .project-link .btn-outline-dark:hover {
    background-color: rgba(33, 37, 41, 0.9);
    color: white;
    border-color: white;
}

/* Posizionamento del pulsante nel carousel mobile */
#galleryMobileCarousel .project-link {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

#galleryMobileCarousel .carousel-caption {
    padding-bottom: 5px;
}

/* Stile per i link dei prodotti */
.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.product-link:hover {
    text-decoration: none;
    color: inherit;
}

.product-link:hover .product-card {
    transform: translateY(-5px);
}

/* Rimuovi la trasformazione dal product-card poiché ora è gestita dal link */
.product-card:hover {
    transform: none;
}

/* Stili per la sezione applicazioni */
.applications-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.applications-section p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.application-cards {
    margin-top: 2rem;
}

.application-card {
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.application-image-container {
    position: relative;
    overflow: hidden;
    height: 600px;
}

.application-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.application-card:hover .application-image-container img {
    transform: scale(1.05);
}

.application-label {
    position: absolute;
    bottom: 0;
    right: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 10px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.5rem;
    letter-spacing: 2px;
    height: 100%;
    display: flex;
    align-items: center;
}

.application-content {
    background-color: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.application-content p {
    margin-bottom: 1.5rem;
    color: #333;
}

.btn-link {
    display: inline-block;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

.btn-link-decor:after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background-color: #333;
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.btn-link:hover {
    color: #000;
}

.btn-link:hover:after {
    width: 100%;
}

.btn-link i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.btn-link:hover i {
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 767px) {
    .application-image-container {
        height: 300px;
    }
    
    .application-label {
        font-size: 1.2rem;
        padding: 10px 8px;
    }
    
    .applications-section h2 {
        font-size: 2rem;
    }
}

/* Stili per la sezione scura */
.dark-section {
    background-color: #212529;
    color: #fff;
}

/* Modifiche per il divider nella sezione scura */
.divider-light {
    background-color: #fff;
}

/* Modifiche per le card dei prodotti nella sezione scura */
.dark-section .product-card {
    background-color: transparent;
}

.dark-section .product-link {
    color: #fff;
}

.dark-section .product-link:hover {
    color: #fff;
}

/* Modifiche per il divider dei prodotti nella sezione scura */
.product-divider-light {
    background-color: #fff;
}