.about-factories {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px 0 rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    backdrop-filter: blur(5px);
    width: 65%;
    height: 126px;
    gap: 14px;
    margin-bottom: 96px;
}

.factories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 378px));
    row-gap: 24px;
    column-gap: 32px;
    max-width: 85%;
    justify-content: center;
}

.factory-box {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px 0 rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    /* height: 319px; */
    /* height: fit-content; */
    height: 100%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.factory-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 40px 0 rgba(0, 0, 0, 0.2);
}

.factory-box img {
    border-radius: 16px;
    object-fit: cover;
}

.factory-box .factory-image {
    height: 240px;
}

/* Skeleton loader styles */
.image-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 216px;
    border-radius: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Lazy image styles */
.factory-box .lazy-image {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    position: relative;
    z-index: 2;
}

.factory-box .lazy-image.loaded {
    opacity: 1;
}

.factory-box .factory-title {
    font-size: 17px;
    color: rgba(1, 60, 93, 1);
}

.factory-box .factory-location {
    font-size: 14px;
    color: rgba(1, 60, 93, 1);
}

.factory-box .factory-not-active {
    color: black;
    border-radius: 4px;
    background-color: rgba(207, 230, 255, 1);
    font-size: 12px;
}

@media (max-width: 1409.98px) {
    .factories-grid {
        max-width: 90%;
    }
}

@media (max-width: 991.98px) {
    .about-factories {
        margin-bottom: 52px;
    }
}

@media (max-width: 877.98px) and (min-width: 768px) {
    .factories-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

@media (max-width: 767.98px) {
    .factories-grid {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
        grid-template-columns: repeat(auto-fit, minmax(0, 320px));
        column-gap: 16px;
    }
    .factory-header-image {
        height: 348px;
    }
    .factory-header-image img {
        object-fit: cover;
    }
    .about-factories {
        margin-bottom: 40px;
        width: 90%;
    }
}

@media (max-width: 694.98px) {
    .factories-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

@media (max-width: 575.98px) {
    .about-factories h5 {
        font-size: 15px;
    }
    .factory-box .factory-title {
        font-size: 16px;
    }
    .about-factories {
        width: 95%;
        margin-bottom: 24px;
    }
}

@media (max-width: 407.98px) {
    .about-factories h5 {
        font-size: 13.4px;
    }
}