/**
 * Soapstore Product Configurator Styles
 *
 * Frontend styles for the product customization interface.
 */

/* ==========================================================================
   Configurator Container
   ========================================================================== */

#cse-configurator {
    margin: 20px 0;
}

#cse-configurator fieldset {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#cse-configurator legend {
    font-weight: 600;
    padding: 0 10px;
}

/* ==========================================================================
   Material Buttons (Substrates, Pigments, Scents)
   ========================================================================== */

.cse-material-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cse-material-btn {
    --btn-color: #cccccc;
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    background: color-mix(in srgb, var(--btn-color) 20%, white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    opacity: 0.6;
}

.cse-material-btn:hover {
    background: var(--btn-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cse-material-btn input[type="checkbox"],
.cse-material-btn input[type="radio"] {
    display: none;
}

.cse-material-btn:has(input:checked) {
    font-weight: 700;
    background: color-mix(in srgb, var(--btn-color) 70%, white);
    border-color: var(--btn-color);
    border-width: 3px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.75);
    opacity: 1;
}

/* ==========================================================================
   Blend Pattern Buttons
   ========================================================================== */

.cse-blend-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cse-blend-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    background: #f9f9f9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 70px;
}

.cse-blend-btn:hover {
    background: #fff;
    border-color: #999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cse-blend-btn input[type="radio"] {
    display: none;
}

.cse-blend-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 4px;
}

.cse-blend-label {
    font-size: 11px;
    color: #666;
}

.cse-blend-btn:has(input:checked) {
    background: #fff;
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
}

.cse-blend-btn:has(input:checked) .cse-blend-icon {
    color: #2271b1;
}

.cse-blend-btn:has(input:checked) .cse-blend-label {
    color: #1d2327;
    font-weight: 600;
}

/* ==========================================================================
   Ingredient Display
   ========================================================================== */

.cse-ingredients-section {
    margin: 20px 0;
}

#cse-ingredients-grouped {
    margin-top: 10px;
}

.cse-ingredient-group {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #fafafa;
    border-left: 3px solid #2271b1;
    border-radius: 0 4px 4px 0;
}

.cse-ingredient-group.hidden {
    display: none;
}

.cse-ingredient-group.collapsed .cse-ingredient-list {
    display: none;
}

.cse-ingredient-group.collapsed .cse-ingredient-type::before {
    transform: rotate(-90deg);
}

.cse-ingredient-type {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
    cursor: pointer;
}

.cse-ingredient-type:hover {
    color: #2271b1;
}

.cse-ingredient-type::before {
    content: '\25BC';
    font-size: 10px;
    margin-right: 6px;
    display: inline-block;
    transition: transform 0.2s;
}

.cse-ingredient-count {
    font-weight: normal;
    color: #999;
    font-size: 12px;
}

.cse-ingredient-list {
    margin-top: 4px;
    padding-left: 18px;
    font-size: 13px;
    color: #50575e;
}

/* ==========================================================================
   Type Filters
   ========================================================================== */

.cse-type-filters {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.cse-type-filters-label {
    font-size: 12px;
    color: #666;
}

.cse-type-filters-list {
    margin-top: 5px;
}

.cse-type-filters-list label {
    display: inline-block;
    margin-right: 12px;
    font-size: 13px;
}

#cse-toggle-all-types {
    font-size: 11px;
    padding: 2px 8px;
    margin-left: 10px;
}

/* ==========================================================================
   Price Display
   ========================================================================== */

.cse-price-section {
    margin: 15px 0;
    font-size: 14px;
}

#cse-price {
    font-weight: 600;
    color: #2271b1;
}

/* ==========================================================================
   No Data Messages
   ========================================================================== */

.cse-no-ingredients {
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.cse-hidden {
    display: none;
}
