/* ============================================================
   Galeria de opcoes (imagens) - abre um modal com todas as
   imagens de um select (moldura, estojo, cor do courino...).
   O select original continua sendo a fonte da verdade.
   ============================================================ */

.galeria-opcoes-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.galeria-opcoes-wrap select.form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.galeria-opcoes-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #b02a37;
    border: 1px solid #b02a37;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.galeria-opcoes-btn:hover { background: #8f1f2b; border-color: #8f1f2b; color: #fff; }
.galeria-opcoes-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(176, 42, 55, .18); }

.galeria-opcoes-btn .galeria-opcoes-qtd {
    background: rgba(255, 255, 255, .25);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Modal ---------- */
.galeria-opcoes-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(18, 18, 18, .72);
    z-index: 2147483000;
    display: none;
    padding: 18px;
}

.galeria-opcoes-overlay.aberto { display: flex; align-items: center; justify-content: center; }

.galeria-opcoes-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1080px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
}

.galeria-opcoes-topo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #ececec;
    flex-wrap: wrap;
}

.galeria-opcoes-topo h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #232323;
    flex: 0 0 auto;
}

.galeria-opcoes-topo .galeria-opcoes-sub {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: #7a7a7a;
}

.galeria-opcoes-busca {
    flex: 1 1 220px;
    min-width: 160px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
}

.galeria-opcoes-busca:focus { outline: none; border-color: #b02a37; box-shadow: 0 0 0 3px rgba(176, 42, 55, .12); }

.galeria-opcoes-fechar {
    flex: 0 0 auto;
    border: 0;
    background: #f2f2f2;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 1;
    color: #444;
    cursor: pointer;
}

.galeria-opcoes-fechar:hover { background: #e3e3e3; }

.galeria-opcoes-grid {
    overflow-y: auto;
    padding: 16px 18px 26px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.galeria-opcoes-item {
    position: relative;
    border: 2px solid #ececec;
    border-radius: 12px;
    padding: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.galeria-opcoes-item:hover { border-color: #e3a2ab; transform: translateY(-2px); }
.galeria-opcoes-item.ativo { border-color: #b02a37; box-shadow: 0 0 0 3px rgba(176, 42, 55, .10); }

.galeria-opcoes-item img {
    width: 100%;
    height: 112px;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
    display: block;
}

.galeria-opcoes-item .galeria-opcoes-sem-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 112px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #c4c4c4;
    font-size: 32px;
}

.galeria-opcoes-item .galeria-opcoes-nome {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.galeria-opcoes-item .galeria-opcoes-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #b02a37;
    color: #fff;
    font-size: 13px;
    display: none;
    align-items: center;
    justify-content: center;
}

.galeria-opcoes-item.ativo .galeria-opcoes-check { display: flex; }

.galeria-opcoes-vazio {
    grid-column: 1 / -1;
    text-align: center;
    color: #7a7a7a;
    padding: 44px 12px;
    font-size: 15px;
}

.galeria-opcoes-loader {
    grid-column: 1 / -1;
    text-align: center;
    color: #7a7a7a;
    padding: 44px 12px;
    font-size: 15px;
}

@media (max-width: 575px) {
    .galeria-opcoes-overlay { padding: 0; }
    .galeria-opcoes-box { height: 100vh; max-width: 100%; border-radius: 0; }
    .galeria-opcoes-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
    .galeria-opcoes-item img { height: 96px; }
    .galeria-opcoes-topo h4 { font-size: 16px; }
}
