.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
    margin: 0;
}

.product-card {
    border: 1px solid var(--lightest-gray);
    border-radius: 10px;
    box-sizing: border-box;
    overflow: clip;
    height: auto !important
}

.product-card:hover {
    box-shadow: 6px 6px 6px -6px rgba(204, 204, 204, 1);
}

.product-info {
    padding: 20px;
}

.product-card h3 {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 20px;
    min-height: 90px;
}

.product-card h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.product-card:hover h3 a {
    color: var(--secondary-red);
}

.product-card .product-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    transition: transform 0.3s ease;
    min-width: 100%;
}

.product-card .product-thumbnail img:hover {
    transform: scale(1.1);
}

.product-card p.stock {
    font-weight: bold;
    font-size: 1em;
    margin: 0;
}

.product-card p.stock.out-of-stock {
    color: var(--secondary-red);
}

.product-card p.stock.in-stock {
    color: var(--green);
}

.product-card p.no-price{
    font-style: italic;
    color: var(--lighter-gray);
}

/* Add-to-cart button styles have been moved to style.css for all states and templates. */

.product-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: 5px;
}

.product-pagination .page-numbers.current {
    background-color: var(--secondary-red);
    color: var(--white);
}

.product-pagination .page-numbers:hover {
    background-color: var(--primary-gray);
}

.txt-center {
    text-align: center;
}

.w100 {
    width: 100%;
}

.filter-by-auto-form {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    /* Allows wrapping to a new line if items don't fit */
    padding: 15px;
    border-radius: 5px;
    margin: auto;
}

.form-group {
    flex: 1;
    /* Allow select fields to grow equally */
    min-width: 150px;
    /* Ensure a minimum width for smaller screens */
}

select.form-control {
    width: 100%;
}

.product-filter-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-20);
    align-items: center;
}

.product-filter-actions:has(.bottom) {
    margin-top: 20px;
}

.search-results-container .product-filter-actions {
    justify-content: center;
}

.left-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

/* Label for the select dropdown */
.woocommerce-sorter label {
    font-size: 14px;
    font-weight: 600;
}

/* Style for the select dropdown */
.main-filter select,
.woocommerce-sorter select,
.filter-group select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    font-size: var(--font-normal);
    border-color: var(--lightest-gray);
}

/* Hover and focus effect for the select dropdown when it's not disabled */
.main-filter select:not([disabled]):hover,
.woocommerce-sorter select:not([disabled]):hover,
.filter-group select:not([disabled]):hover,
.main-filter select:not([disabled]):focus,
.woocommerce-sorter select:not([disabled]):focus,
.filter-group select:not([disabled]):focus {
    border-color: var(--secondary-red);
    outline: none;
}

/* Product not found info message */
.info {
    padding: 12px 20px 12px 25px;
    display: block;
    background: #fdf0d5;
    color: #6f4400;
    font-size: var(--font-small);
    padding-left: 45px;
    position: relative;
    border-left: 5px solid red;
}

.info::before {
    font-size: 20px;
    line-height: 20px;
    color: #c07600;
    font-weight: 900;
    vertical-align: middle;
    display: inline-block;
    position: absolute;
    text-align: center;
    left: 0;
    top: 12px;
    width: 45px;
}

/* Filters */

.sidebar {
    align-self: start;
    margin-bottom: var(--spacing-20);
}

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

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-gray)
}

.sidebar button {
    width: 100%;
    padding: 12px;
    background-color: var(--secondary-red);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: var(--font-small);
    font-weight: bold;
}

.sidebar button:hover {
    background-color: var(--primary-red);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.reset-filters {
    display: inline-block;
    padding: 10px 15px;
    background-color: #e9e6ed;
    color: var(--dark-gray);
    font-size: var(--font-small);
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid var(--lightest-gray);
    text-align: center;
}

.reset-filters:hover {
    background-color: var(--lightest-gray);
    color: var(--black);
}

.product-card .add-to-cart button.button.loading-state::before {
    content: "\f463";
    animation: spin 1s linear infinite;
}