/*
BCS Stone Filter v1.8.2
Final Design as per detailed specification.
*/

:root {
    --bcs-light-border-color: #ddd;
    --bcs-dark-text-color: #333;
    --bcs-light-text-color: #FFFFFF;
    --bcs-dark-bg-color: #000000;
}

/* === General Layout & Centering === */

.bcs-filter {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 20px;
}

.bcs-filter-group {
    margin-bottom: 35px;
}

.bcs-filter-group__title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center; /* REQUIRED: Center all titles */
    color: var(--bcs-group-title-color, #111);
}

.bcs-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center; /* REQUIRED: Center all filter options */
}


/* === Group 1: By Stone (High-Fidelity Image Cards) === */

.bcs-filter-options--stone-tiles {
    gap: 25px; /* Spacing between cards */
}

/* This is a button, so we reset default styles first */
.bcs-filter-button.bcs-filter-tile {
    /* Reset */
    padding: 0;
    background: none;
    font-family: inherit;

    /* Card Structure */
    position: relative;
    width: 220px;
    height: 165px; /* 4:3 aspect ratio */
    border-radius: 8px;
    border: 3px solid transparent; /* Transparent border for inactive state */
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0; /* Fallback color */
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Subtle dark overlay for text legibility */
.bcs-filter-button.bcs-filter-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.3); /* Subtle overlay */
    z-index: 1;
    transition: background-color 0.3s ease;
}

/* Text Styling */
.bcs-filter-tile__name {
    position: relative;
    z-index: 2;
    font-size: 20px;
    font-weight: 600; /* Semibold */
    color: #FFFFFF; /* Pure white text */
    padding: 10px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

/* --- Interaction States --- */

/* Hover State */
.bcs-filter-button.bcs-filter-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    filter: brightness(0.95); /* Slight darken effect on image */
}

/* Active State */
.bcs-filter-button.bcs-filter-tile.active {
    border-color: var(--bcs-border-color-active); /* Green border when selected */
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.4); /* Optional: add a glow */
}


/* === Group 2 & 3: Color & Application (Standard Buttons) === */

/* Generic button for Application */
.bcs-filter-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    border: 2px solid var(--bcs-light-border-color);
    background-color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out;
    text-align: center;
    color: var(--bcs-dark-text-color);
}

.bcs-filter-button:hover {
    border-color: var(--bcs-dark-text-color);
}

/* Pill-shaped button for Color */
.bcs-filter-button--color {
    border-radius: 20px;
    gap: 8px;
}

.bcs-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Active state for standard buttons */
.bcs-filter-button.active {
    border-color: var(--bcs-border-color-active);
}


/* === Action Buttons (Add Filter / Reset) === */

.bcs-action-buttons {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center; /* REQUIRED: Center action buttons */
}

.bcs-button-primary,
.bcs-button-secondary {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    border: 2px solid var(--bcs-dark-bg-color);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

/* "Add Filter" Button */
#bcs-add-filter.bcs-button-primary {
    background-color: var(--bcs-dark-bg-color);
    color: var(--bcs-light-text-color);
}
#bcs-add-filter.bcs-button-primary:hover {
    background-color: #333;
    border-color: #333;
}

/* "Reset" Button */
#bcs-reset-filter.bcs-button-secondary {
    background-color: var(--bcs-light-text-color);
    color: var(--bcs-dark-bg-color);
    border-color: var(--bcs-dark-bg-color);
}
#bcs-reset-filter.bcs-button-secondary:hover {
    background-color: #f5f5f5;
}


/* === Fallback & Shop Styles (Kept for compatibility) === */
#bcs-results { margin-top: 30px; }
.bcs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.bcs-empty { text-align: center; padding: 40px 0; }
.bcs-card { border: 1px solid #eee; text-align: center; display: flex; flex-direction: column; height: 100%; transition: box-shadow 0.2s ease; }
.bcs-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.bcs-card__link { display: flex; flex-direction: column; flex-grow: 1; text-decoration: none; color: inherit; }
.bcs-card__link:hover .bcs-card__title { color: var(--bcs-border-color-active); }
.bcs-card__img { max-width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.bcs-card__title { font-size: 16px; margin: 10px; padding: 0 5px; transition: color 0.2s ease; flex-grow: 1; }
.bcs-card__price { font-weight: bold; margin: 0 10px 10px; }
.bcs-shop-layout { display: flex; flex-wrap: wrap; gap: 30px; }
.bcs-sidebar { flex: 1 1 280px; min-width: 240px; }
.bcs-main-content { flex: 3 1 60%; }
.bcs-sidebar .bcs-filter-group__title { text-align: left; font-size: 16px; }
.bcs-sidebar .bcs-filter-options { justify-content: flex-start; }
.bcs-sidebar .bcs-action-buttons { flex-direction: column; gap: 10px; }
.bcs-sidebar .bcs-button-primary, .bcs-sidebar .bcs-button-secondary { width: 100%; }
.bcs-filter-style-sidebar .bcs-filter-select { width: 100%; padding: 10px; font-size: 14px; background-color: #E0E0E0; border: 1px solid #ccc; border-radius: 4px; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23333%22/%3E%3C/svg%3E'); background-repeat: no-repeat; background-position: right 10px center; background-size: 1em; color: #333; }
.bcs-filter-style-sidebar .bcs-color-circle { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #ccc; cursor: pointer; background-color: transparent; padding: 0; transition: border-color 0.2s ease; }
.bcs-filter-style-sidebar .bcs-color-circle.active { border-width: 2px; border-color: var(--bcs-border-color-active); }