/* Global styles for a dark theme */
* {
    box-sizing: border-box;
}

img {
    width: 100%;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: grey; /* Dark background for the body */
    color: #e0e0e0; /* Light grey text for readability */
    font-family: 'Roboto', sans-serif;
}

h2 {
    font-size: 3rem;
    margin: 1rem 0 0;
}

main {
    padding: 0 2rem 2rem;
}

/* Styles for the navigation tabs */

.hamburger {
    top: 0; /* Adjust as needed */
    z-index: 11; /* Higher than the nav to stay on top */
    display: none; /* Hidden by default, shown in the media query */
    font-size: 30px;
    height: 3rem;
    align-items: center;
}

.hamburger > * {
    flex: 1;
    text-align: center;
}

#hamburgerIcon {
    color: #fff;
    padding: 10px;
    margin-left: auto;
    cursor: pointer;
    flex: none;
}

#pageHeading {
    margin-left: 40px;
}

nav {
    position: sticky;
    top: 0;
    overflow: hidden;
    background-color: #333;
    z-index: 10;
    box-shadow: 10px 10px 39px -4px rgba(0,0,0,0.75);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    flex-grow: 1;
    text-align: center;
    transition: background-color 0.3s ease;
}

nav li a {
    display: block;
    padding: 15px 0;
    color: #fff; /* White text */
    text-decoration: none;
    transition: color 0.3s ease;
}

nav li:hover {
    background-color: #444; /* Slightly lighter on hover */
}

nav li:hover a {
    color: #ddd; /* Lighten text color on hover */
}

/* Selected tab style */
nav li.selected {
    background-color: #85772b; /* Green background for the active tab */
}

nav li.selected a {
    color: #fff; /* Keep text white for contrast */
    pointer-events: none; /* Prevent clicking on the active tab */
}

/* Additional styles for dark theme */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px; /* Space between items */
    color: #e0e0e0;
    margin-bottom: 4rem;
}

.content > div {
    align-items: center;
    justify-content: center;
}

.price > div {
    text-align: center;
}


.price {
    background-color: darkkhaki;
    color: black;
    margin: auto;
    width: 90%;
    border-radius: 1rem;
}

.inStock .price {
    display: grid;
    grid-template-columns: 30% 35% 35%; /* Creates two columns */
    grid-template-rows: auto auto auto 1fr; /* Defines the rows, last one takes remaining space */
}

.inStock .price > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .25rem;
}

.inStock .price .d {
    font-size: .7rem;
    margin-left: .5em;
}

.inStock .price .p {
    display: block;
    font-weight: bold;
}

/* First item - double height */
.inStock .price > div:nth-child(1) {
    border-right: thin solid black;
    font-size: 1.3rem;
    grid-row: 1 / 3; /* Spans two rows */
}

.inStock .price > div:nth-child(n+2) {
    grid-column: 2; /* All placed in the second column */
}

.inStock .price > div:nth-child(n+3) {
    grid-column: 3; /* All placed in the second column */
}

.inStock .price > div:nth-child(n+4) {
    grid-column: 2; /* All placed in the second column */
}

.inStock .price > div:nth-child(n+5) {
    grid-column: 3; /* All placed in the second column */
}


/* Sixth item - full width at the bottom */
.inStock .price > div:nth-child(6),.inStock .price > div:nth-child(7) {
    grid-column: 1 / -1; /* Spans all columns */
}

.inStock .price > div:nth-child(6) .p, .inStock .price > div:nth-child(7) .p {
    display: inline;
    margin-left: 1rem;
}

.inStock .price > div:nth-child(6), .inStock .price > div:nth-child(7)  {
    border-top: thin solid black;
    padding: .5rem;
}


.itemImage {
    position: relative;
}

.organic .itemImage::after {
    content: ''; /* Essential for generating the content */
    display: inline-block; /* or block, depending on your layout needs */
    width: 60px;
    height: 60px;
    position: absolute;
    bottom: 30px;
    right: 0;
    background-image: url('images/OrganicLogo.png');
    background-size: contain; /* This ensures the image fits within the dimensions, adjust as needed */
    background-repeat: no-repeat;
    background-position: center; /* Centers the background image */
    background-color: darkkhaki;
    border-radius: 3rem;
}

.outOfStock .itemImage {
    opacity: .5;
}

.outOfStock .price {
    height: 123px;
    display: flex;
    align-items: center;
    background-color: darkgray;
}

.outOfStock .price img {
    width: 140px;
    height: auto;
    margin: -1em auto;
    filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.5));
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
}



/* Hide the menu items by default on smaller screens */
@media screen and (max-width: 768px) {

    .hamburger {
        display: flex; /* Show the hamburger icon */
    }

    .price {
        display: block!important;
    }

    .price > div > div {
        width: 100%;
        display: flex;
        align-items: center;
    }

    .price .n {
        flex: 1;
        text-align: right;
    }
    .price .p {
        flex: none;
        width: 75px;
    }


    .inStock .price > div:nth-child(1) {
        border-right: none;
    }

    .inStock .price .p {
        display: inline;
    }

    nav ul {
        position: fixed;
        right: -100%; /* Start off-screen */
        top: 3rem;
        flex-direction: column;
        width: 60%; /* Width of the menu */
        height: 100%;
        overflow-y: auto;
        transition: right 0.3s;
        background-color: darkkhaki; /* Match the nav background */
        box-shadow: -10px 10px 39px -4px rgba(0,0,0,0.75);
    }

    .content {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    main {
        padding: 0 1rem 1rem;
    }

    nav li {
        flex-grow: 0;
    }

    /* When the menu is active */
    .menu-active nav ul {
        right: 0; /* Slide in */
    }
}