* {
    margin: 0px;
    padding: 0px;
    font-family: 'Patrick Hand', serif;
}

body{
    background-color: #333;
}

/* navbar */
.nav {
    padding: 15px;
    display: flex;
    align-items: center;
    text-align: center;
    background-color: #272623;
    height: calc(10px + 6vh);
}

#left, #center, #right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#left {
    justify-content: flex-start;
}

#right {
    justify-content: flex-end;
}

#logo {
    width: calc(45px + 6vw);
}

.nav img {
    width: calc(10px + 1vw);
}

#left a, #right a, #right div {
    margin-right: calc(15px + 1.2vw);
    color: #CCCCCC;
}


/* search bar citation: https://codepen.io/k185/pen/PQajXE */

.search-container {
	position: relative;
	display: inline-block;
	margin: 4px 2px;
    height: calc(30px + 1.5vw);
    width: calc(30px + 1.5vw);
	vertical-align: bottom;
}

.mglass {
    color: #CCCCCC;
	display: inline-block;
	pointer-events: none;
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	-o-transform: rotate(-45deg);
	-ms-transform: rotate(-45deg);
}

.search.active-transition, .searchbutton.active-transition {
    transition-duration: 0.4s;
    -moz-transition-duration: 0.4s;
    -webkit-transition-duration: 0.4s;
    -o-transition-duration: 0.4s;
}

.searchbutton.inactive-transition {
    transition-duration: 0.4s;
    -moz-transition-duration: 0.4s;
    -webkit-transition-duration: 0.4s;
    -o-transition-duration: 0.4s;
    transition-delay: .2s;
}  

.no-transition {
    transition-property: none !important;
    -moz-transition-property: none !important;
    -webkit-transition-property: none !important;
    -o-transition-property: none !important;
}

.searchbutton {
	position: absolute;
    text-align: center;
    font-size: calc(20px + 1vw);
	height: 85%;
	width: 85%;
    border-radius: 12px 0px 0px 12px;
    cursor: pointer;
}

.search:focus + .searchbutton {
	transition-duration: 0.4s;
	-moz-transition-duration: 0.4s;
	-webkit-transition-duration: 0.4s;
	-o-transition-duration: 0.4s;
    transition-delay: -1s;
	background-color: #333333;
}

.search {
    transform: translate3d(0,0,0);  /* force hardware acceleration to remove artifacts */
	position: absolute;
    left: 135%;
	background-color: #333333;
    caret-color: #CCCCCC;
    color: #CCCCCC;
    font-size: calc(3px + 0.6vw);
	outline: none;
	border: none;
	padding: 0;
	width: 0px;
	height: 85%;
	z-index: 10;
	transition-duration: 0.4s;
	-moz-transition-duration: 0.4s;
	-webkit-transition-duration: 0.4s;
	-o-transition-duration: 0.4s;
    border-radius: 0px 12px 12px 0px;
}

.search:focus {
	width: calc(100px + 6vw);
	padding: 0 16px 0 0;
}

.expandright {
	left: auto;
	right: calc(10px + 1vw);
}

.expandright:focus {
	padding: 0 0 0 16px;
}


/* cart */
.cart-container {
    position: relative;
    display: inline-block;
}

.cart-dropdown {
    display: none;
    position: absolute;
    top: 150%;
    right: -180%;
    background-color: #24251e;
    border-radius: calc(5px + .5vw);
    width: calc(50px + 10vw);
    max-height: 25vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    cursor: auto;
    border: 1px solid black;
    scrollbar-width: none;
}

.cart-dropdown::-webkit-scrollbar {
    display: none;
}

.cart-items li.cart-item-grid {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.cart-items {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.cart-items li {
    font-size: calc(8px + .3vw);
    padding: calc(3px + .4vh) calc(3px + .6vw);
    text-decoration: none;
    display: block;
    text-align: left;
}

.delete-item {
    font-size: calc(3px + .4vw);
    cursor: pointer;
    justify-self: end;
}

.checkout-section {
    width: calc(36px + 10vw);
    display: grid;
    grid-template-columns: auto auto;
    gap: calc(3px + .4vh);
    padding: calc(3px + .4vh);
    border-top: 1px solid #ccc;
}

.subtotal {
    justify-self: start;
    font-size: calc(8px + .3vw);
}

.checkout-button {
    font-size: calc(3px + .4vw);
    justify-self: end;
    padding: calc(2px + .2vh) calc(3px + .6vw);
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
}

.cart-items .checkout-section {
    list-style-type: none;
}

/* was used to make sure the sidebar was always on the side and reached the bottom of the page but not in use anymore */
.container {
    /* display: grid;       -----        THIS CODE IS FOR SIDEBAR
    grid-template-columns: auto 1fr; */
    height: calc(100vh - (40px + 6vh));
}

/* topbar currently contains the categories */
.topbar {
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #272623;
    height: calc(13px + 4.3vh);
}

.topbar a, .topbar-dropdown-content a {
    align-items: center;
    cursor: pointer;
    text-align: center;
    display: block;
    padding: 10px;
    width: calc(30px + 2vw + 3vh);
    height: calc(5px + 3.5vh);
    text-decoration: none;
    color: #CCCCCC;
    box-sizing: border-box;
    border-radius: 5px;
    font-size: calc(5px + 0.3vw + 0.6vh);
    transition: background-color 0.3s;
}

.topbar div:not(.topbar-dropdown-content){
    height: calc(10px + 4vh);
    text-align: center;
    align-items: center;
}

.topbar a:hover, .topbar-dropdown-content a:hover {
    background-color: #757268;
}

.topbar-dropdown {
    display: block;
    z-index: 10;
}

.topbar-dropdown-content {
    z-index: 10;
    align-items: center;
    text-align: center;
    display: none;
    border-radius: 10px;
    background-color: #2c2c2b;
}

.topbar-dropdown:hover .topbar-dropdown-content, .topbar-dropdown-content:hover {
    display: block;
}

/* sidebar currently not in use */
.sidebar {
    width: calc(20px + 3vw);
    background-color: #2c2c2b;
    height: 100%;
}

.sidebar div {
    margin-top: 50px;
}

.sidebar a, .sidebar-dropdown-content a {
    cursor: pointer;
    text-align: center;
    display: block;
    margin: 30px 0px;
    padding: 10px;
    text-decoration: none;
    color: #CCCCCC;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    font-size: calc(3px + 0.6vw);
    transition: background-color 0.3s;
}

.sidebar-dropdown-content a{
    margin: 0px;
}

.sidebar a:hover, .sidebar-dropdown-content a:hover {
    background-color: #757268;
}

.sidebar-dropdown {
    position: relative;
    display: block;
}

.sidebar-dropdown-content {
    z-index: 10;
    align-items: center;
    text-align: center;
    display: none;
    position: absolute;
    left: calc(20px + 3vw);;
    top: -50px;
    width: calc(25px + 3vw);
    border-radius: 0px 5px 5px 0px;
    background-color: #2c2c2b;
}

.dropdown:hover .dropdown-content, .dropdown-content:hover {
    display: block;
}

/* fixing scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #888 #eee;
}

/* category gallery on the home page */
.gallery {
    flex: 1;
    width: 100%;
}

.shopall {
    width: 100%;
    height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.shopall .description {
    margin-top: 40px;
    background-color: transparent;
    color: #CCCCCC;
    width: calc(150px + 42vw);
    height: calc(30px + 15vh);
}

.shopall .description h2 {
    align-self: flex-start;
    font-size: calc(4px + 1.2vw + 1.2vh);
    text-align: center;
}

.shopall .description p {
    margin-top: 15px;
    align-self: center;
    font-size: calc(3px + 0.6vw + .6vh);
}

.shopall a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: calc(8px + 1.2vw);
    background-color: #272623;
    width: calc(23px + 4vw);
    height: calc(2% + 2vh);
    padding: calc(10px + 1vw);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: calc(20px + 7vh);
}

.gallery .categories {
    margin-top: calc(10px + 7vh);
    width: 100%;
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(3, 1fr); /* 3 columns, each taking up one fraction of the available space */
    gap: 5vw;
    max-width: 88vw;
    margin-left: auto;
    margin-right: auto;
}

.section {
    cursor: pointer;
    margin-bottom: 50px;
    border: 3px solid rgba(0, 0, 0, .5);
    border-radius: 24px;
}


.section a {
    text-decoration: none;
    color: #CCCCCC;
}

.section a:hover {
    text-decoration: underline;
}

.section img {
    object-fit: cover;
    height: 100%;
    width: 100%;
    border-radius: 20px;
}

.section p {
    text-decoration: none;
    text-align: center;
    color: #CCCCCC;
    margin-top: 5px;
}

/* breadcrumbes (categories and items pages) */
.breadcrumbs {
    font-size: calc(5px + .7vw);
    margin-left: calc(8px + 2vw);
    margin-top: calc(5px + 2vh);
    color: #CCCCCC;
}

.breadcrumbs a {
    color: #CCCCCC;
    text-decoration: none;
}

.breadcrumbs #no-underline:hover {
    text-decoration: none;
}

.breadcrumbs p {
    margin-top: calc(5px + .5vh);
    font-size: calc(10px + .7vw);
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* category page */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: calc(10px + 2.4vw);
    padding: calc(10px + 2vw);
    white-space: nowrap;
}

.items-grid a {
    text-decoration: none;
}

.item-card {
    width: calc(50% + 4.5vw);
    height: calc(60% + 4.5vh);
    background-color: #1A1A1A;
    color: #666;
    border: 2px solid #ddd;
    padding: calc(5px + 1vw);
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.item-card h3, .item-card p {
    font-size: calc(10px + .3vw);
}

.item-image {
    width: calc(60% + 4vw);
    height: calc(30% + 4vw);
    border-radius: 5px;
    margin-bottom: 10px;
    object-fit: cover;
}

.item-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin: 40px 0;
    padding: 20px;
}

/* item page */
.images {
    padding: 2vw;
    border-right: 1px solid #E0E0E0;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.images img {
    width: 80vw;
    max-width: 100%;
    margin-bottom: 2vw;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.item-details {
    padding: 2vw;
    position: sticky;
    top: 20px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.item-details h1 {
    font-size: calc(10px + 1.8vw);
    margin-bottom: calc(5px + .5vh);
    color: #CCCCCC;
}

.item-details p {
    font-size: calc(5px + .8vw);
    color: #7b7b7b;
}

.item-details #description {
    margin-bottom: calc(30px + 1.5vh);
    margin-right: 20px;
}

.item-details h2 {
    font-size: calc(5px + 1vw);
    margin-bottom: 1.5vh;
    color: #E91E63;
}

.item-details input {
    font-size: calc(5px + .6vw);
    width: calc(20px + 1vw);
}

.item-details button {
    margin-left: 10px;
    background-color: #E91E63;
    color: #FFF;
    padding: calc(3px + .5vw) calc(5px + 1vh);
    font-size: calc(5px + .7vw);
    width: calc(40px + 4vw);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.item-details #sold-out {
    background-color: #C97C8B;
    cursor: auto;
}

.item-details button:hover {
    background-color: #D01757;
}

.item-details #sold-out:hover {
    background-color: #C97C8B;
}

@media (max-width: 768px) {
    .nav img {
        width: 20px;
    }

    .shopall .description {
        width: 70vw;
    }

    #left a, #right a, #right div {
        margin-right: 5vw;  /* Increase margin on smaller screens */
    }
}

@media (max-width: 480px) {
    .section {
        width: 100%;
        flex-basis: 100%;
    }
}
