.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));  /* Ensures 200px max per item */
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;  /* Center items within grid cells */
}

.shopitem {
    max-width: 300px;  /* Ensures max-width was 200*/
    width: 90%;  /* Ensure items don't exceed the max-width */
    background: #fff;
    padding: 15px;
   text-align: center;
    border: 2px solid #fcb0b3;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shopitem img {
    width: 100%;
   /* max-width: 400px; /* Set a max-width for better centering */
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.shopitem h2 {
    font-size: 1.5em;
    color: #555;
    margin-bottom: 10px;
}

.shopitem p {
    font-size: 1em;
    color: #777;
    margin: 5px 0;
}

button {
    background-color: #e91e63;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #d81b60;
}

/* Cart Styles */

.cart-items-container {
    max-height: 300px; /* Limit the height to make it scrollable */
    overflow-y: auto;  /* Enable vertical scrolling */
}

.cart-item img {
    width: 50px;      /* Thumbnail size */
    height: auto;
    margin-right: 10px; /* Spacing */
    border-radius: 5px;
    vertical-align: middle;
}

.cart-item {
    display: flex;
    align-items: centre;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}


.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 10px;
}

.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    flex: 1; /* Allows it to take up remaining space */
}

.cart-item-name {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 5px; /* Adds space between name and total */
    white-space: normal; /* Allows text wrapping for long names */
}

.cart-item-price-controls {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
}

.cart-item-total {
    font-size: 13px;
    color: #555;
}

.cart-item-controls {
    display: flex;
//    flex-direction: column;
    gap: 5px;
    align-items: centre;
    margin-left: auto;
}

.cart-item-controls button {
    padding: 5px;
    font-size: 12px;
    margin: 2px 0;
}


.cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: #fff;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cart-item-quantity {
    font-size: 14px;
    padding: 0 8px;
    font-weight: bold;
}

#cartCount {
    background-color: white;
    color: #e91e63;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 5px;
}

.cart-overlay {
    display: none;
    position: fixed;
    top: 2px;
    left: 0;
    width: 350px;
    max-height: 100vh%;
    overflow-y: auto; /* Enable vertical scrolling if content overflows */
    z-index: 1000;
}

.cart {
    background-color: #fff;
    padding: 20px;
    width: 300px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 0 auto; /* Center the cart */
    overflow-y: auto; /* Ensures the cart content is scrollable */
    max-height: 90vh; /* Limits cart height to 90% of the viewport */
}

.cart h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.cart-items p {
    font-size: 1em;
    color: #555;
    margin: 10px 0;
}

.cart-total {
    display: flex;
    font-size: 1.2em;
    margin: 20px 0;
    color: #333;
}

#cartButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3E3228; /* Brown */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#cartButton:hover {
    background-color: #e91e63; /* Darker hover color */
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: auto;
    text-align: center;
}

.carousel img {
    width: 100%;
    height: auto;
    display: block;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}

.arrow.left {
    left: 10px;
}

.arrow.right {
    right: 10px;
}

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

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.image-nav.left {
    left: 5px;
}

.image-nav.right {
    right: 5px;
}

#shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    box-sizing: border-box;
    justify-content: center;
}

.filter-pair {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    flex: 0 1 auto;
    max-width: 100%;
}

.filter-pair label {
    font-size: 1em;
    font-weight: bold;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-pair select {
    padding: 8px 12px;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
    outline: none;
    width: auto;           /* ensure it's only as wide as it needs to be */
    max-width: 100%;
    flex-grow: 0;          /* prevents from growing to fill extra space */
}

#shop-filters select:focus {
    border-color: #c94c4c;
    background-color: #ffffff;
}

@media (max-width: 600px) {
    #shop-filters {
        flex-direction: column;
        align-items: flex-start; /* Stack filters vertically */
    }

    .filter-pair {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .filter-pair label,
    .filter-pair select {
        width: 100%;
    }
}
