/**
 * CC Size Picker -- Google-style autocomplete
 * Warm neutral palette to match mattresscenter.com design system
 */

/* -- Container ---------------------------------------------------------------- */

.cc-size-picker {
    margin-bottom: 1.5rem;
    font-family: inherit;
}

.cc-size-picker__header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cc-size-picker__label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4a3728;
}

.cc-size-picker__selected-label {
    font-size: 0.875rem;
    color: #7c6454;
}

/* -- Search input wrapper ----------------------------------------------------- */

.cc-size-picker__search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #d9ccc5;
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cc-size-picker__search-wrap:focus-within {
    border-color: #8b6350;
    box-shadow: 0 0 0 3px rgba(139, 99, 80, 0.15);
}

.cc-size-picker.has-error .cc-size-picker__search-wrap {
    border-color: #d93025;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.12);
}

.cc-size-picker__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #9e8a7e;
    margin-left: 12px;
}

.cc-size-picker__input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 13px 10px 13px 8px !important;
    font-size: 1rem !important;
    color: #2c1f13 !important;
    box-shadow: none !important;
    min-height: unset !important;
    line-height: 1.4 !important;
}

.cc-size-picker__input::placeholder {
    color: #b8a8a0;
}

.cc-size-picker__clear {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-right: 4px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #9e8a7e;
    transition: background 0.12s, color 0.12s;
    padding: 0;
}

.cc-size-picker__clear:hover {
    background: #f0e8e4;
    color: #4a3728;
}

.cc-size-picker__clear svg {
    width: 14px;
    height: 14px;
}

/* -- Dropdown ----------------------------------------------------------------- */

.cc-size-picker__dropdown {
    list-style: none;
    margin: 4px 0 0 !important;
    padding: 6px 0 !important;
    background: #fff;
    border: 1.5px solid #d9ccc5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(74, 55, 40, 0.12), 0 2px 8px rgba(74, 55, 40, 0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
    position: relative;
}

.cc-size-picker__dropdown[hidden] {
    display: none;
}

.cc-size-picker__option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #2c1f13;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
}

.cc-size-picker__option::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #d9ccc5;
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 0.1s, background 0.1s;
}

.cc-size-picker__option:hover,
.cc-size-picker__option.is-focused {
    background: #faf5f2;
}

.cc-size-picker__option.is-selected {
    background: #f5ede8;
    font-weight: 600;
}

.cc-size-picker__option.is-selected::before {
    background: #8b6350;
    border-color: #8b6350;
}

.cc-size-picker__option strong {
    font-weight: 700;
    color: #8b6350;
}

.cc-size-picker__no-results {
    padding: 12px 16px;
    color: #9e8a7e;
    font-size: 0.9rem;
    font-style: italic;
}

/* -- Quick-pick chips --------------------------------------------------------- */

.cc-size-picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cc-size-picker__chip {
    padding: 7px 14px;
    border: 1.5px solid #d9ccc5;
    border-radius: 999px;
    background: #fff;
    color: #4a3728;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
    line-height: 1;
}

.cc-size-picker__chip:hover {
    border-color: #8b6350;
    background: #faf5f2;
}

.cc-size-picker__chip.is-active,
.cc-size-picker__chip[aria-pressed="true"] {
    border-color: #8b6350;
    background: #8b6350;
    color: #fff;
    box-shadow: 0 2px 6px rgba(139, 99, 80, 0.3);
}

/* -- Error message ------------------------------------------------------------ */

.cc-size-picker__error {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #d93025;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-size-picker__error[hidden] {
    display: none;
}

/* -- Mobile adjustments ------------------------------------------------------- */

@media (max-width: 480px) {
    .cc-size-picker__chips {
        gap: 6px;
    }

    .cc-size-picker__chip {
        padding: 6px 11px;
        font-size: 0.8125rem;
    }

    .cc-size-picker__input {
        font-size: 0.9375rem !important;
    }
}
