/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
:root {
    --caf-primary-text: #2c2c2c;
    --caf-secondary-text: #555;
    --caf-border-color: #e5e5e5;
    --caf-background-color: #ffffff;
    --caf-accent-color: #ab9365; /* Elegant Gold */
    --caf-card-shadow: 0 5px 20px rgba(0,0,0,0.06);
    --caf-card-hover-shadow: 0 8px 25px rgba(0,0,0,0.09);
}

/* ==========================================================================
   Main Filter Bar & Wrapper
   ========================================================================== */
.caf-container .caf-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 12px 20px;
    border: 1px solid var(--caf-border-color);
    border-radius: 10px;
    margin-bottom: 45px;
    background-color: var(--caf-background-color);
}

.caf-container .caf-shape-filters-wrapper { 
    display: flex; 
    align-items: center; 
    min-width: 0; 
    flex-grow: 1; 
    padding-top: 5px;
    padding-bottom: 5px;
}
.caf-container .caf-attribute-filters-wrapper { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }

/* ==========================================================================
   Shape Filters
   ========================================================================== */
.caf-container #caf-shape-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-left: 5px;
    padding-right: 5px;
}
.caf-container #caf-shape-filter::-webkit-scrollbar { display: none; }

.caf-container .caf-filter-label {
    font-weight: 500;
    font-size: 15px;
    color: var(--caf-secondary-text);
    margin-right: 15px;
    white-space: nowrap;
}

.caf-container .shape-filter {
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid #eee;
    background-color: #fdfdfd;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 0 0 0px var(--caf-accent-color);
    overflow: hidden;
}
.caf-container .shape-filter:hover { transform: translateY(-2px); border-color: #ddd; }
.caf-container .shape-filter.active {
    border-color: var(--caf-accent-color);
    box-shadow: 0 0 0 2px var(--caf-accent-color);
}
.caf-container .shape-filter img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.caf-container .shape-filter:hover img { transform: scale(1.05); }

.caf-container .all-shapes {
    width: auto;
    height: 48px;
    border-radius: 24px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--caf-primary-text);
    background-color: #f5f5f5;
    border-color: #f5f5f5;
}
.caf-container .all-shapes.active {
    background-color: var(--caf-accent-color);
    color: #fff;
    border-color: var(--caf-accent-color);
    box-shadow: none;
}

/* ==========================================================================
   Attribute Dropdowns & Clear Button
   ========================================================================== */
.caf-container .caf-dropdown-group { display: flex; align-items: center; gap: 8px; }

.caf-container .caf-attribute-select {
    min-width: 150px;
    padding: 9px 30px 9px 14px; font-size: 14px; font-family: inherit; color: var(--caf-primary-text);
    border: 1px solid var(--caf-border-color); border-radius: 8px; background-color: var(--caf-background-color);
    -webkit-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-5%22%20stroke%3D%22%23888%22%20stroke-width%3D%221.2%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E');
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.caf-container .caf-attribute-select:hover { border-color: #ccc; }
.caf-container .caf-attribute-select:focus { outline: none; border-color: var(--caf-accent-color); box-shadow: 0 0 0 1px var(--caf-accent-color); }

#caf-clear-filters {
    background: transparent; border: 1px solid #dcdcdc; color: #777;
    font-size: 13px; font-weight: 500; border-radius: 6px; padding: 8px 15px;
    cursor: pointer; transition: all 0.2s ease;
}
#caf-clear-filters:hover { border-color: var(--caf-accent-color); color: var(--caf-accent-color); }

/* ==========================================================================
   Product Grid, Cards & "No Products Found" Message
   ========================================================================== */
.caf-container ul.products::before, .caf-container ul.products::after { display: none !important; }
.caf-container .caf-product-grid { display: grid; grid-template-columns: repeat(var(--caf-desktop-cols, 4), 1fr); gap: 40px 30px; list-style: none; padding: 0; margin: 0; }
.caf-container ul.products li.product { float: none; margin: 0; width: auto; padding: 0; border: none; background: none; box-shadow: none; }

.caf-container .caf-product-grid .caf-no-products-found {
    grid-column: 1 / -1; text-align: center; padding: 60px 20px;
}
.caf-container .caf-product-grid .caf-no-products-found p {
    font-size: 1.1em; color: var(--caf-secondary-text); margin: 0;
}

.caf-container .caf-product-card { background-color: var(--caf-background-color); border-radius: 10px; overflow: hidden; box-shadow: var(--caf-card-shadow); transition: transform 0.3s ease, box-shadow 0.3s ease; height: 100%; display: flex; flex-direction: column; }
.caf-container .caf-product-card:hover { transform: translateY(-6px); box-shadow: var(--caf-card-hover-shadow); }
.caf-container .caf-product-image-link { display: block; overflow: hidden; background-color: #fdfdfd; }
.caf-container .caf-product-image-link img { transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.caf-container .caf-product-card:hover .caf-product-image-link img { transform: scale(1.08); }
.caf-container .caf-product-details { padding: 20px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.caf-container .caf-product-title { font-size: 17px; font-weight: 400; color: var(--caf-primary-text); margin: 0 0 10px; }
.caf-container .caf-product-price { font-size: 16px; font-weight: 600; color: var(--caf-accent-color); }

/* ==========================================================================
   Loader and Load More Button
   ========================================================================== */
.caf-products-grid-wrapper { position: relative; }
.caf-loader-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.8); display: flex; align-items: center; justify-content: center; z-index: 10; }
.caf-loader { width: 40px; height: 40px; border: 3px solid #f3f3f3; border-top: 3px solid var(--caf-accent-color); border-radius: 50%; animation: caf-spin 1s linear infinite; }
@keyframes caf-spin { to { transform: rotate(360deg); } }

.caf-load-more-container { text-align: center; margin-top: 45px; }
#caf-load-more { background-color: transparent; color: var(--caf-accent-color); border: 1px solid var(--caf-accent-color); border-radius: 8px; padding: 10px 30px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.25s ease; }
#caf-load-more:hover { background-color: var(--caf-accent-color); color: #fff; }

/* ==========================================================================
   Responsive Design (FINAL fix for mobile ovals)
   ========================================================================== */
@media (max-width: 1024px) {
    .caf-container .caf-product-grid { grid-template-columns: repeat(var(--caf-tablet-cols, 3), 1fr); }
    .caf-container .caf-filter-bar { flex-wrap: wrap; }
    .caf-container .caf-shape-filters-wrapper, .caf-container .caf-attribute-filters-wrapper { flex-basis: 100%; }
    .caf-container .caf-attribute-filters-wrapper { justify-content: flex-start; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--caf-border-color); }
}
@media (max-width: 767px) {
    .caf-container .caf-product-grid { grid-template-columns: repeat(var(--caf-mobile-cols, 2), 1fr); gap: 25px 20px; }
    .caf-container .caf-filter-bar { gap: 15px; }
    
    /* FINAL FIX: Reduce size on mobile to guarantee circle shape */
    .caf-container .shape-filter,
    .caf-container .all-shapes {
        width: 44px;
        height: 44px;
    }
    .caf-container .all-shapes {
        width: auto; /* Allow 'All' button to have variable width */
        border-radius: 22px;
    }

    .caf-container .caf-attribute-filters-wrapper { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 15px; }
    .caf-container .caf-attribute-filters-wrapper #caf-clear-filters { grid-column: 1 / -1; justify-self: start; }
    .caf-container .caf-dropdown-group { gap: 5px; }
    .caf-container .caf-dropdown-group .caf-filter-label { margin-right: 5px; }
}
@media (max-width: 480px) {
    .caf-container .caf-product-grid { grid-template-columns: repeat(var(--caf-mobile-cols, 2), 1fr); }
    .caf-container .caf-dropdown-group .caf-filter-label { font-size: 14px; }
    .caf-container .caf-attribute-select { min-width: 0; width: 100%; }
}