body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.product-page {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 1s ease-in-out;
}

.product-gallery {
    flex: 1;
    display: flex;
    flex-wrap: wrap; /* Ensure flex items wrap */
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.main-image img {
    width: 100%;
    max-width: 500px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: zoomIn 1s ease-in-out;
    border-radius: 5px;
}

.main-image img:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.thumbnail-images {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.thumbnail {
    width: 100px;
    border-radius: 5px;
    margin: 0 5px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: bounceIn 1s ease-in-out;
}

.thumbnail:hover {
    border: 2px solid #6F4E37;
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.product-details {
    flex: 1;
    padding: 0 20px;
    animation: slideInRight 1s ease-in-out;
    max-width: 100%; /* Take full width on smaller screens */
    margin: 20px 0; /* Add spacing around the details */
}

.product-details h1 {
    color: #0E8DBF;
    font-size: 2rem; /* Adjust font size for responsiveness */
    margin-bottom: 10px;
    animation: slideInDown 1s ease-in-out;
}

.rating {
    font-size: 1rem; /* Adjust font size for responsiveness */
    color: #6F4E37;
    margin-bottom: 15px; /* Adjust spacing */
    display: flex;
    align-items: center;
    animation: slideInRight 0.9s ease-in-out;
}

.rating .stars {
    margin-right: 5px; /* Adjust margin */
}

.description {
    font-size: 0.9rem; /* Adjust font size for responsiveness */
    color: #333;
    margin-bottom: 15px; /* Adjust spacing */
    animation: fadeIn 1.5s ease-in-out;
}

.price {
    font-size: 1.5rem; /* Adjust font size for responsiveness */
    color: #6F4E37;
    margin-bottom: 15px; /* Adjust spacing */
    animation: zoomIn 1s ease-in-out;
}

.add-to-cart {
    background-color: #0E8DBF;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem; /* Adjust font size for responsiveness */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    animation: pulse 2s infinite;
}

.add-to-cart:hover {
    background-color: #095a7e;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
    }
    to {
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(10%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-10%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.gallery {
    display: flex;
    flex-wrap: wrap; /* Ensure flex items wrap */
    justify-content: center;
    gap: 10px; /* Adjust gap between gallery items */
    padding: 10px; /* Add padding to gallery container */
    width: 100%;
    cursor: pointer;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    flex: 1 0 calc(25% - 20px); /* Adjust item width based on screen size */
    max-width: calc(25% - 20px); /* Adjust maximum width based on screen size */
    margin: 10px; /* Adjust margin */
    border-radius: 5px;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease-in-out;
    border-radius: 5px;
}

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

@media screen and (max-width: 768px) {
    .product-page {
        padding: 10px;
        display: flex;
        flex-direction: column;
        margin: auto;
    }

    .product-details {
        max-width: 100%;
        margin-left: 0;
    }

    .product-details h1 {
        font-size: 1.8rem;
    }

    .rating {
        font-size: 0.9rem;
    }

    .description {
        font-size: 0.8rem;
    }

    .price {
        font-size: 1.2rem;
    }

    .add-to-cart {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .gallery-item {
        max-width: calc(100% - 20px);
    }
}

@media screen and (max-width: 480px) {
    .gallery-item {
        flex: 1 0 calc(100% - 20px);
        max-width: calc(100% - 20px);
    }
    .main-image{
        width: 95vw;
    }
    .thumbnail{
        width: 20%;
    }
}
