:root {
    --green: #00a24e;
}

#preloader {
    display: none;
    position: static;
    margin-top: 10rem;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(255, 255, 255, 0.7);  */
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
}


section.ppe-category {
    margin-top: 6rem;
    padding: 2.5rem 0;
}

.ppe-category h3 {
    font-size: 4rem;
    text-align: center;
    font-weight: bold;
    margin-bottom: 2.5rem;
    color: #003200;
}

.ppe-category p {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #003200;
}

.category-box {
    margin-top: 2rem;
}

.sub-category-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* gap: 2rem; */
    column-gap: 2rem;
    /* Horizontal gap */
    row-gap: 2rem;
    /* Vertical gap */
    padding: 0.5rem 2rem;
    margin-top: 3rem;
    margin-bottom: 4rem;
}

.sub-category-grid-item {
    background-color: #f9f9f9;
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
    height: 43rem;
    border-radius: 1rem;
}

.sub-category-grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

.overlay-box {
    background-color: var(--green);
    color: #fff;
    padding: 0.5rem 0.6rem;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 0.3s ease, padding 0.3s ease;
    height: 6.5rem;
    overflow: hidden;
}

.overlay-box h4 {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
    margin-top: 1.5rem;
}

.overlay-box p {
    margin: 0.6rem 0 0.9rem;
    font-size: 1.3rem;
    opacity: 0;
    color: white;
    transition: opacity 0.3s ease;
}

.overlay-box .btn {
    background-color: #fff;
    color: var(--green);
    font-weight: bold;
    border: none;
    padding: 0.6rem 0.9rem;
    border-radius: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.2rem;
    margin-top: 1.3rem;
}

.overlay-box .btn:hover {
    color: white;
    background-color: #003200;
}

/* .overlay-box .btn:hover {
    background-color: #003200;
    color: #fff;
} */

.sub-category-grid-item:hover .overlay-box {
    height: 25%;
    padding: 1.25rem 0.625rem;
}

.sub-category-grid-item:hover .overlay-box p,
.sub-category-grid-item:hover .overlay-box .btn {
    opacity: 1;
}

.sub-category-grid-item:hover {
    transform: translateY(-0.3rem);
}

/* Product section */

section.catgory-product-listing {
    margin-top: 2rem;
    padding: 1rem 0;
}

h3.product-section-title {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: bold;
    color: #003200;
}

.product-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    margin-bottom: 4rem;
}

.product-grid-item {
    background: #fff;
    padding: 1rem;
    border-radius: 1.25rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    border: none !important;
    /* Ensures no borders including right */
}

.product-grid-item:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}

.product-grid-item img {
    max-width: 100%;
    height: auto;
    border-radius: 1.25rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-grid-item img:hover {
    transform: scale(1.05);
}

.product-title {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 8rem;
}

.product-title p {
    font-size: 1.8rem;
    margin-top: 1.5rem;
    font-weight: 600;
    color: #003200;
}

.product-price {
    margin-top: 0.5rem;
    font-size: 1.125rem;
}

.product-price .old-price {
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.no-products-message {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .product-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    h3.product-section-title {
        font-size: 3rem;
    }

    .product-grid-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Product Section end */


@media (max-width: 1240px) {
    .sub-category-grid-container {
        column-gap: 2rem; /* Horizontal gap */
        row-gap: 7rem; /* Vertical gap */
    }

    .sub-category-grid-item {
        height: 115%;
    }

    .overlay-box h4 {
        margin-top: 0.5rem;
    }

    .sub-category-grid-item:hover .overlay-box {
        height: 35%;
    }
}

/* Responsive: Tablet */
@media (max-width: 768px) {
    .sub-category-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .overlay-box h4 {
        font-size: 2rem;
    }

    .overlay-box p {
        font-size: 1.3rem;
    }

    .overlay-box .btn {
        font-size: 1.2rem;
    }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
    .sub-category-grid-container {
        grid-template-columns: repeat(1, 1fr);
        row-gap: 2rem;
    }

    .sub-category-grid-item {
        height: 36rem;
    }

    .ppe-category h3 {
        font-size: 2.8rem;
    }

    .overlay-box {
        height: 8rem;
        padding: 0.6rem;
    }

    .overlay-box h4 {
        font-size: 2rem;
        margin-top: 1.4rem;
    }

    .overlay-box p {
        font-size: 1rem;
    }

    .overlay-box .btn {
        font-size: 1.2rem;
        padding: 0.25rem 0.75rem;
    }

    .sub-category-grid-item:hover .overlay-box {
        height: 12rem;
    }
}