body {
    font-family: fangsong;
    font-size: large;
    margin: 30px;
    padding: 0;
    color: #817a7a;
    background-color: #e8e8e8;
    box-sizing: border-box;
}

header {
    background-color: #e8e8e8;
    font-size: 20px;
    color: #817a7a;
    padding: 30px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    border-bottom: 2px solid #969696;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px; /* Adjust the logo size */
    margin-right: 10px;
}

nav .nav-links a:hover {
    transform: scale(1.31);
    transition: transform 0.3s ease;
    text-decoration-color: #3b3b3b;
}

nav a {
    color: #817a7a;
    text-decoration: none;
    font-size: 28px;
    margin: 0 30px; /* Adjusts spacing between titles */
    transition: transform 0.3s ease; /* Add transition for smooth scaling */
}

nav a:first-child {
    margin-left: 0; /* Prevents extra space on the left */
}

nav a:last-child {
    margin-right: 0; /* Prevents extra space on the right */
}

nav a:hover {
    transform: scale(1.31); /* Scale effect on hover */
    text-decoration-color: #3b3b3b;
}

.container {
    display: flex;
    padding: 20px;
    gap: 20px;
}

/* Sidebar Styling (Search & Filters) */
.sidebar {
    width: 25%;
    padding: 20px;
    border-right: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.sidebar h3 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button[type="submit"]:hover {
    background-color: #555;
}

/* Main Content Styling (Product Gallery) */
.main-content {
    width: 75%;
    padding: 20px;
}

#products h2 {
    text-align: center;
    margin-bottom: 20px;
}

#product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

footer {
    background-color: #e8e8e8;
    padding: 40px 20px;
    margin-top: 50px;
    border-top: 2px solid #969696;
    display: flex;
    justify-content: space-around;
    text-align: left;
}

.footer-section {
    flex: 1;
}

.footer-section h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.footer-section p {
    font-size: 18px;
    color: #444;
    margin: 5px 0;
}

.footer-section a {
    color: #000;
    text-decoration: none;
    font-size: 18px;
}

.footer-section a:hover {
    text-decoration: none;
}

/* Product Page Layout */
.product-container {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.product-images {
    width: 50%;
}

.product-images img#main-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.thumbnails {
    display: flex;
    gap: 10px;
}

.thumbnails img.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.product-details {
    width: 40%;
}

.product-details h2 {
    margin-bottom: 10px;
    font-size: 22pt;
    font-weight: bold;
}

.product-details p {
    margin-bottom: 10px;
    font-size: 16pt;
    
}

.product-details p strong {
    font-weight: bold;
}

.product-card {
    cursor: pointer; /* Changes the cursor to a pointer when hovering */
}

.thumbnails img.thumbnail {
    cursor: pointer; /* Changes the cursor to a pointer when hovering over thumbnails */
}

.status-In-Stock {
    color: green;
}

.status-outofstock {
    color: red;
}

/* Ensure all form elements have the same width */
.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select,
.filter-group input[type="range"],
button[type="submit"] {
    width: 100%;  /* Ensure full-width uniformity */
    max-width: 550px; /* Set a consistent max width */
    padding: 10px; /* Uniform height */
    font-size: 16px; /* Readable text */
    border-radius: 5px; /* Rounded corners */
    border: 1px solid #ccc; /* Subtle border for consistency */
    box-sizing: border-box; /* Prevent width expansion */
}

/* Remove all default styling and force a thin track */
.filter-group input[type="range"] {
    -webkit-appearance: none; /* Remove default styles (Chrome, Safari, Edge) */
    -moz-appearance: none; /* Remove default styles (Firefox) */
    appearance: none;
    width: 100%;
    height: 4px !important; /* Force track height */
    background: #808080; /* Gray track */
    border-radius: 1px;
    outline: none;
    margin: 0;
    padding: 0;
    display: block;
}

/* Chrome, Safari, Edge - Thin track */
.filter-group input[type="range"]::-webkit-slider-runnable-track {
    height: 4px !important;
    background: #808080;
    border-radius: 1px;
}

/* Firefox - Thin track */
.filter-group input[type="range"]::-moz-range-track {
    height: 4px !important;
    background: #808080;
    border-radius: 1px;
}

/* Chrome, Safari, Edge - Hollow Knob */
.filter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #1d1c1c; /* White inner fill */
    border: 5px solid #1d1c1c; /* Black border */
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    margin-top: -7px; /* Centers the knob */
    transition: transform 0.2s ease-in-out, background 0.2s;
}

/* Firefox - Hollow Knob */
.filter-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid #000;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    margin-top: -9px; /* Centers the knob */
    transition: transform 0.2s ease-in-out, background 0.2s;
}

/* Ensure no padding or margins interfere */
.filter-group {
    padding: 0;
    margin: 5;
}

/* Price Label - Centered & Aligned */
#price-label {
    display: block;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    width: fit-content;
    margin: 6px auto 0;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: "Garamond", serif;
}

/* Make the Apply Filters Button Consistent */
button[type="submit"] {
    background-color: #000; /* Black button */
    color: white;
    border: none;
    top: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

button[type="submit"]:hover {
    background-color: #333; /* Darker hover effect */
}

.add-to-cart-btn {
    background-color: #252c27; /* Green background */
    color: rgb(65, 65, 65); /* White text */
    padding: 10px 20px; /* Padding for the button */
    border: none; /* Remove default border */
    border-radius: 5px; /* Rounded corners */
    font-size: 16px; /* Font size */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s ease, transform 0.3s ease; /* Smooth transition for background color and transform */
    margin-top: 20px; /* Add margin to the top */
    display: block; /* Make the button a block element */
    width: 100%; /* Make the button take the full width */
    text-align: center; /* Center the text */
}

.add-to-cart-btn:hover {
    background-color: #7f8580; /* Darker green on hover */
    transform: scale(1.05); /* Slightly enlarge on hover */
}

.add-to-cart-btn:disabled {
    background-color: #ccc; /* Gray background when disabled */
    cursor: not-allowed; /* Not-allowed cursor when disabled */
}

.selection-buttons {
    margin-top: 20px;
}

.selection-buttons h3 {
    margin-bottom: 10px;
    text-decoration: none;
}

.selection-buttons button {
    margin: 5px;
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f5f5f5;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.selection-buttons button.selected {
    background-color: #8b8b8b;
    color: rgb(0, 0, 0);
}

.selection-buttons button:hover {
    background-color: #35332d;
    color: rgb(255, 255, 255);
}

.cart-widget {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.cart-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.3s ease;
}


.cart-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 25px;  /* Adjust the size to make it more visible */
    height: 25px;
    z-index: 10;
    transition: transform 0.3s ease;
}
.cart-widget:hover .cart-icon,
.cart-widget:hover .cart-badge {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-links a {
        margin: 10px 0;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .main-content {
        width: 100%;
    }

    .input-group {
        display: flex;
        gap: 10px;
        justify-content: space-between; /* Ensures equal spacing */
        width: 100%; /* Ensures full width */
    }

    .input-group input {
        flex: 1; /* Ensures both fields take equal width */
        min-width: 0; /* Prevents unintended shrinking */
        max-width: 50%; /* Ensures they don’t exceed the width */
        padding: 12px;
        border: 2px solid #000;
        border-radius: 20px;
        font-size: 16px;
        outline: none;
    }

    .cart-item {
        flex-direction: column; /* Stack items vertically on small screens */
        align-items: flex-start; /* Align items to the start */
    }

    .cart-item img {
        margin-bottom: 10px; /* Add space between image and details */
    }

    .cart-item-details {
        margin-left: 0; /* Remove left margin on small screens */
    }

    .remove-btn {
        margin-top: 10px; /* Add space above the remove button */
    }
}
