.product-img {
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    animation: slideshow 2s linear infinite;
    cursor: pointer;
    object-fit: cover;
}

#product-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3em;
}

.product-card {
    position: relative;
    width: 45%;
}

.product-card-item{
    position: relative;
    width: 100%;
}

.product-info {
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1% 6%;
    color: black;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.sold-out {
    position: absolute;
    color: black;
    top: 5%;
    left: 5%;
    text-transform: capitalize;
    font-weight: 600;
    border: 2px solid;
    padding: 1% 2%;
    border-radius: 10px;
}


.shopping-cart-add {
    color: #190f0e;
    position: absolute;
    bottom: 2%;
    right: 2%;
    font-size: 2.5rem;
    background-color: #ffe1b2;
    border-radius: 50%;
    padding: 3%;
    border: solid 1px;
    cursor: pointer;
}

i:hover {
    box-shadow: 0 0 10px;
    transition: .5s;
}

.product-gallery {
    /* width: 50%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1em;
    margin: 2% 0; */
    display: grid;
    grid-template-columns: repeat(5,1fr);
    width: 50%;
    min-height: 100px;
    gap: 0.5em;
    margin: 2% 0;
}

.product-gallery img {
    cursor: pointer;
    z-index: 10;
    /* change original width from 40% to show more images to customers */
    width: 100%;
    border-radius: 5px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.error-message {
    color: black;
}

.modal {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #000000aa;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.modal-img {
    position: relative;
    width: 30%;
    margin-top: 5%;
    background: transparent;
    aspect-ratio: 1 / 1;
}

.modal-img img {
    width: 100%;
    /* max-height: 454px; */
    object-fit: contain;
    border-radius: 10px;
}

#modal-close {
    position: absolute;
    top: 5%;
    right: 5%;
    font-size: 1.25rem;
    color: #503a34;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
    box-shadow: none;
    transition: 0.75s;
}

#modal-close:hover, #next:hover, #prev:hover {
    transform: scale(1.2);      
}

#next, #prev {
    position: absolute;
    top: 80%;
    font-size: 1.25rem;
    color: #503a34;
    cursor: pointer;
    z-index: 1100;
    background: none;
    border: none;
    box-shadow: none;
}

#next {
    right: 2%;
    bottom: 30%;
}

#prev {
    left: 2%;
    bottom: 50%;
}

.inactive {
    color: #00000036;
}

.details-modal {
    position: absolute;
    top: 0;
    left: 0;
    padding: 10% 0;
    backdrop-filter: blur(12px);
    background-color: #dcbf9bd4;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1em;
    /* remove after pagination done */
    display: none;
}

.detail-name {
    text-transform: capitalize;
}

.detail-img {
    width: 20%;
}

.detail-description {
    font-size: 1.5rem;
    width: 35%;
    color: black;
}

#detail-modal-close {
    position: absolute;
    top: 2%;
    right: 30%;
    font-size: 2rem;
    color: #503a34;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
    box-shadow: none;
    transition: 0.75s;
} 

#detail-next, #detail-prev {
    position: absolute;
    top: 10%;
    font-size: 2.5rem;
    color: #503a34;
    cursor: pointer;
    z-index: 1100;
    background: none;
    border: none;
    box-shadow: none;
}

#detail-next {
    right: 2%;
    bottom: 30%;
}

#detail-prev {
    left: 2%;
    bottom: 50%;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 40%;
    align-self: center;
}

.pagination h3, .pagination i {
    transition: .75s;
    font-size: 2rem;
}

.pagination h3:hover, .pagination i:hover {
    transform: scale(1.5);
    cursor: pointer;
}

.pagination h3:active {
    transform: scale(1.5);
}

.pagination h3.active {
    transform: scale(1.5);
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    padding: 4px 8px;
}

/* loading overlay as product cards are loaded */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: bisque;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20%;
}

/* loading spinner */
.spinner {
    border: 8px solid #503a34;
    border-top: 8px #9e7341;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* media queries */
@media screen and (max-width: 768px) {
    .product-card {
        min-width: 45%;
    }
    .product-gallery {
        min-height: 60px;
    }
    .modal-img {
        width: 50%;
        /* margin-top: 30%; */
    }
    #detail-next, #detail-prev {
        top: 6%;
    }
    .pagination {
        width: 100%;
    }
}

@media screen and (max-width: 425px) {
    .modal-img {
        margin-top: 45%;
        width: 80%;
       
    }
}

@media screen and (min-width: 376px) and (max-width: 500px) {
    .product-card {
        width: 100%;
    }
    .modal-img {
        /* width: 90%;
        height: 8%; */
        /* margin-top: 60%;
        width: 80%; */
    }
    #modal-close {
        top: 8%;
        right: 5%;
        font-size: 1.25rem;
    }
    #prev, #next {
        top: 90%;
        font-size: 1.25rem;
    }
    .details-modal {
        padding: 20% 0;
    }
    .detail-img {
        width: 50%;
        #detail-modal-close {
            top: 1%;
            right: 14%;
        }
    }
    .detail-description {
        font-size: 1rem;
        line-height: 1.2em;
    }
    #detail-next, #detail-prev {
        top: 5%;
    }
}