html {
    overflow-x: hidden;
    height: 100%; /* Ensure html takes full height */
}

body {
    font-family: Arial, sans-serif;
    font-size: 1em;
    margin: 0;
    padding: 0;
    text-align: center;
    background-color: #f4f4f4;
    scroll-behavior: smooth;
    overflow-x: hidden; /* Ensure no horizontal scrolling */
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('assets/WONDERFUL OF.png');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
}

header {
    background: url('banner.jpg') center/cover no-repeat;
    color: black;
    padding: 100px 20px;
    font-size: 2em;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75); /* Make topbar slightly transparent */
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.topbar .left {
    font-weight: bold;
}

.dropdown {
    position: relative;
    display: inline-block;
    margin-left: auto; /* Push to the right */
    margin-right: 40px; /* Adjust to be a bit more left */
}

.dropdown .right {
    font-weight: bold;
    cursor: pointer;
}

.dropdown-content {
    display: none; /* Hide by default */
    position: absolute;
    right: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block; /* Show on hover */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.container {
    width: 80%;
    margin: auto;
    padding: 80px 20px;
}

.featured {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    justify-items: center; /* Center the items */
    opacity: 0.8; /* Make featured products slightly transparent */
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-item {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 500;
    height: 500;
    max-width: 100%;
}

.gallery-item img {
    width: 500;
    height: 500;
    object-fit: cover;
    border-radius: 10px;
}

.gallery-desc {
    flex: 1;
    text-align: left;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 50%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-desc h3 {
    font-size: 1em;
    margin: 0;
}

.gallery-desc p {
    font-size: 1em;
    margin: 5px 0 0;
}

.sliding-gallery {
    position: relative;
    width: 80vw; /* Responsive width */
    height: 500px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    animation: fade 1s;
}

.gallery-slide img {
    width: 50%;
    height: 100%;
    object-fit: cover;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 60%;
    max-width: 90vw; /* Ensure it doesn't exceed viewport width */
    display: flex;
    align-items: center;
    gap: 20px;
    transform: translateY(-10px);
    transition: transform 0.3s ease-in-out;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal img {
    width: 40%;
    border-radius: 10px;
}

.modal-text {
    flex: 1;
    text-align: left;
}

.modal-text h2 {
    font-size: 24px;
    margin: 0 0 10px;
}

.modal-text p {
    font-size: 16px;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 20px;
    cursor: pointer;
    color: black;
}

footer {
    background: rgba(0, 0, 0, 0.75); /* Make footer slightly transparent */
    color: white;
    padding: 10px;
    position: relative; /* Change to relative */
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: auto; /* Ensure footer sticks to the bottom when content is short */
}

.footer-column {
    flex: 1;
    padding: 10px;
}

.topbar-home {
    text-decoration: none;
    font-weight: bold;
    color: white; /* Adjust color as needed */
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0); /* Make topbar-home slightly transparent */
    border-radius: 5px;
    transition: background 0.3s;
}

.topbar-home:hover {
    color: #e1e1e1; /* Darker color on hover */
}

a, .button, .gallery-item, .dropdown .right, .topbar-home {
    transition: background 0.3s, color 0.3s;
}

a:hover, .button:hover, .gallery-item:hover, .dropdown .right:hover, .topbar-home:hover {
    background: rgba(0, 0, 0, 0.1); /* Darker background effect */
    color: #e1e1e1; /* Darker color on hover */
}

h1, h2, h3 {
    font-weight: bold;
}

h4, h5, h6 {
    font-weight: normal;
}

/* Responsive layout for smartphones */
@media (max-width: 600px) {
    .featured {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, auto);
    }

    .topbar {
        flex-direction: row; /* Ensure items stay in a row */
        justify-content: space-between; /* Space between items */
        align-items: center; /* Center items vertically */
    }

    .dropdown-content {
        right: auto;
        left: 0;
    }

    .modal-content {
        width: 90%;
        max-width: 90vw; /* Ensure it doesn't exceed viewport width */
    }

    .gallery {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 10px; /* Reduce gap */
        padding: 10px; /* Reduce padding */
    }

    .gallery-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-item img {
        width: 100%;
        max-width: 300px;
    }

    .gallery-desc {
        width: 100%;
        text-align: center; /* Center text */
    }

    .gallery-desc {
        padding: 10px; /* Add padding */
        background: #fff; /* White background */
        border-radius: 5px; /* Rounded corners */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    }

    .gallery-desc h3 {
        font-size: 1.2em; /* Adjust font size */
    }

    .gallery-desc p {
        font-size: 0.9em; /* Adjust font size */
    }
}

@media (max-width: 480px) and (orientation: portrait) {
    body {
        font-size: 0.7em;
    }

    .featured {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
        padding: 3px;
    }

    .featured img {
        width: 80px;
        height: 80px;
    }

    .featured-row-header {
        font-size: 0.9em;
        margin: 5px 0;
    }

    .gallery-item, .gallery-item img {
        width: 150px;
        height: 150px;
    }

    .gallery-desc {
        padding: 8px;
        width: 100%;
        font-size: 0.65em;
    }

    .gallery-desc h3 {
        font-size: 0.75em;
    }

    .gallery-desc p {
        font-size: 0.65em;
    }

    .sliding-gallery {
        width: 98vw;
        height: 150px;
    }

    .topbar {
        font-size: 0.6em;
        padding: 6px;
    }

    .topbar .left {
        font-size: 0.65em;
    }

    .dropdown .right {
        font-size: 0.65em;
    }

    .dropdown-content {
        font-size: 0.6em;
        min-width: 120px;
        padding: 4px 0;
    }

    .dropdown-content a {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    body {
        font-size: 0.75em;
    }

    .featured {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .featured img {
        width: 90px;
        height: 90px;
    }

    .featured-row-header {
        font-size: 0.95em;
    }

    .gallery-item, .gallery-item img {
        width: 200px;
        height: 150px;
    }

    .gallery-desc {
        font-size: 0.7em;
    }

    .sliding-gallery {
        width: 95vw;
        height: 140px;
    }

    .topbar {
        font-size: 0.65em;
        padding: 8px;
    }

    .topbar .left {
        font-size: 0.7em;
    }

    .dropdown .right {
        font-size: 0.7em;
    }

    .dropdown-content {
        font-size: 0.65em;
        min-width: 140px;
    }
}

/* Update mobile background adjustments */
@media (max-width: 768px) {
    body {
        background-size: cover;
        background-position: center top;
        background-attachment: fixed;
    }
}

@media (max-width: 480px) {
    body {
        background-size: cover;
        background-position: center top;
        background-attachment: fixed;
    }
}
