/**
 * Avatar com imagem: exibição para todos e botão de edição (somente staff).
 */

/* O avatar precisa ser referência para a imagem e o botão de edição */
.store-avatar,
.product-avatar,
.item-avatar {
    position: relative;
    overflow: hidden;
}

/* Botão de câmera sobre o avatar (staff) */
.avatar-edit-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 3;
    width: 40%;
    height: 40%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E") center / 62% no-repeat;
    cursor: pointer;
}

.avatar-edit-btn:hover,
.avatar-edit-btn:focus-visible {
    background-color: var(--primary-color, #000);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    cursor: pointer;
}

/* Diálogo de edição */
.avatar-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
}

.avatar-dialog-overlay.show {
    display: flex;
}

.avatar-dialog {
    width: 100%;
    max-width: 380px;
    padding: 24px;
    border-radius: 16px;
    background: var(--card-bg, #fff);
    color: var(--text-color, #222);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.avatar-dialog h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    word-break: break-word;
}

.avatar-dialog-hint {
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: var(--text-muted, #666);
}

.avatar-dialog-preview {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    background: var(--primary-color, #444);
}

.avatar-dialog-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-dialog-status {
    min-height: 1.2em;
    margin: 0 0 12px;
    font-size: 0.85rem;
}

.avatar-dialog-status.error {
    color: var(--danger-color, #c0392b);
}

.avatar-dialog-status.ok {
    color: var(--success-text, #2e7d32);
}
