:root {
    --chart-green: #28a745; /* A slightly more vibrant green */
    --chart-green-bg: rgba(40, 167, 69, 0.1);
    --darker-green: #218838;
    --light-gray: #f8f9fa;
    --medium-gray: #dee2e6;
    --dark-gray: #343a40;
    --text-gray: #6c757d;
    --background-color: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background-color: var(--background-color);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
}

.nav-left {
    flex-shrink: 0;
}

.nav-center {
    flex-grow: 1;
    max-width: 700px; /* Adjust max-width as desired */
}

.nav-right {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.nav-links a,
.nav-right a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-speed), border-color var(--transition-speed);
}

nav .logo-brand span {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--dark-gray);
}

.nav-links a:hover,
.nav-right a:hover {
    color: var(--dark-gray);
}

.nav-links a.active,
.nav-right a.active {
    color: var(--chart-green);
    border-bottom-color: var(--chart-green);
    font-weight: 600;
}

/* Style for the new header search form */
.header-search-form {
    width: 100%;
}

.header-search-bar {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 20px;
    font-size: 1rem;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.header-search-bar:focus {
    outline: none;
    border-color: var(--chart-green);
    box-shadow: 0 0 0 3px var(--chart-green-bg);
}

main {
    padding: 0;
}

.product-page-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.filter-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    align-self: flex-start;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-main {
    flex-grow: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
}

.form-group select,
.form-group input[type="date"],
.form-group input[type="text"] {
    background-color: var(--background-color);
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group select:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: var(--chart-green);
    box-shadow: 0 0 0 3px var(--chart-green-bg);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.shop-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px; /* Space between logo, checkbox and text */
}

.shop-filter-logo {
    height: 30px; /* Adjust as needed */
    width: auto;
    max-width: 60px; /* Ensure logos don't get too wide */
    object-fit: contain; /* Ensure the image is contained within its bounds */
}

.form-actions {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.form-actions input[type="submit"] {
    width: 100%; /* Ensure the button takes full width of the container */
}

/* --- Button Styles --- */
.btn {
    display: inline-block;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--chart-green);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--darker-green);
}

.btn-secondary {
    background-color: var(--chart-green);
    color: white;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    width: auto;
}

.btn-secondary:hover {
    background-color: var(--darker-green);
}

.results-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.date-range {
    color: var(--text-gray);
    margin-bottom: 2.5rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.chart-container {
    border: 1px solid var(--medium-gray);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    background-color: var(--background-color);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.chart-container a {
    text-decoration: none;
    color: inherit;
}

.chart-container h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    text-align: center;
}

.info-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.info-title {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
}

.info-price {
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.no-results h2 {
    font-size: 1.5rem;
}

.no-results p {
    color: var(--text-gray);
    max-width: 450px;
    margin: 0.5rem auto 0;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--medium-gray);
}

.central-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 10px;
    border-radius: 3px;
}

.product-category {
    color: var(--text-gray);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.shop-logo {
    width: 36px;
    height: 20px;
}

.chart-title {
    display: flex;
    align-items: center;
}

.logo-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 40px;
    margin-right: 10px;
}

/* Alert styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Shared search bar styles */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20vh;
}

.shared-search-bar {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border-radius: 25px;
    border: 1px solid #ccc;
}

/* Pagination Styles */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: var(--chart-green);
    border-color: var(--chart-green);
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--chart-green);
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.page-link:hover {
    z-index: 2;
    color: #1b6d2f;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item:first-child .page-link {
    margin-left: 0;
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.page-item:last-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* Loading Overlay Styles */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid var(--chart-green); /* Green */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.index-text {
    text-align: center;
    padding-top: 20px;
}