.occp-palettes {
    margin: 24px 0;
    clear: both;
}

.occp-palette {
    margin: 0 0 22px;
    padding: 18px;
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 10px 28px rgba(17, 24, 39, .06);
}

.occp-palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.occp-palette-title {
    font-size: 16px;
    color: #111827;
    font-weight: 800;
}

.occp-required {
    color: #dc2626;
}

.occp-selected-label {
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #1f2937;
    background: #f3f4f6;
    padding: 6px 11px;
    border-radius: 999px;
}

.occp-color-grid {
    display: grid;
    grid-template-columns: repeat(var(--occp-desktop-cols, 8), minmax(0, 1fr));
    gap: 12px;
}

.occp-color-option {
    display: block;
    cursor: pointer;
    min-width: 0;
}

.occp-color-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.occp-color-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-height: 100%;
    padding: 8px 6px 9px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.occp-color-option:hover .occp-color-card,
.occp-color-option.is-selected .occp-color-card,
.occp-color-option input:checked + .occp-color-card {
    border-color: #2563eb;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .16), inset 0 0 0 1px rgba(37, 99, 235, .24);
    transform: translateY(-2px);
    background: #f8fbff;
}

.occp-color-image {
    display: block;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #f9fafb;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e5e7eb, 0 4px 12px rgba(17, 24, 39, .10);
}

.occp-color-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.occp-color-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
    justify-content: center;
    width: 100%;
    min-height: 22px;
}

.occp-color-name,
.occp-color-sku {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.occp-color-name {
    font-size: 11px;
    line-height: 1.55;
    color: #4b5563;
}

.occp-color-sku {
    font-size: 12px;
    color: #111827;
    font-weight: 800;
    direction: ltr;
}

.occp-checkmark {
    position: absolute;
    top: 5px;
    inset-inline-end: 5px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transform: scale(.8);
    transition: opacity .18s ease, transform .18s ease;
}

.occp-color-option.is-selected .occp-checkmark,
.occp-color-option input:checked + .occp-color-card .occp-checkmark {
    opacity: 1;
    transform: scale(1);
}

.occp-hidden-color {
    display: none !important;
}

.occp-show-more,
.occp-open-modal {
    margin-top: 14px !important;
    border-radius: 999px !important;
    padding: 8px 18px !important;
    font-weight: 700 !important;
}

.occp-admin-warning {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    margin-bottom: 12px;
}

.occp-modal {
    display: none;
}

.occp-modal.is-open {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: block;
}

.occp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .58);
    backdrop-filter: blur(5px);
}

.occp-modal-panel {
    position: relative;
    width: min(980px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 40px));
    margin: 20px auto;
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.26);
}

.occp-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 18px;
}

.occp-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.occp-search {
    width: 100%;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
}

body.occp-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .occp-color-grid {
        grid-template-columns: repeat(var(--occp-mobile-cols, 4), minmax(0, 1fr));
        gap: 9px;
    }

    .occp-palette {
        padding: 14px;
    }

    .occp-palette-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .occp-selected-label {
        max-width: 100%;
    }

    .occp-color-image {
        width: 48px;
        height: 48px;
    }

    .occp-color-card {
        border-radius: 16px;
        padding: 7px 5px 8px;
    }

    .occp-color-sku {
        font-size: 11px;
    }
}
